SpiderPig Posted March 10, 2019 Posted March 10, 2019 auto _currentWorld = World::GetCurrent(); world = World::Create(); auto b = Model::Box(); b->SetColor(1, 0, 0, 1); World::SetCurrent(_currentWorld); worldBuffer = Buffer::Create(512, 512); I'm trying to create a second world where I can render an object in and then draw that render on screen. But so far I can't get the second world to show anything, can anyone see anything wrong with my code? Texture* cInventory::_renderWorldBuffer() { auto _currentBuffer = Buffer::GetCurrent(); worldBuffer->Enable(); //World::GetCurrent()->Render(); <- This works world->Render(); //This is not _currentBuffer->Enable(); return worldBuffer->GetColorTexture(); } Quote
Solution reepblue Posted March 10, 2019 Solution Posted March 10, 2019 I don't think this is possible as I believe with Leadwerks, only one world at a time can be rendered. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
SpiderPig Posted March 10, 2019 Author Posted March 10, 2019 Okay thanks. Do you think this would be possible if I render too a second camera instead? Or maybe render the object on top of the context somehow... ? Quote
reepblue Posted March 10, 2019 Posted March 10, 2019 A camera that's part of the same world for sure. I've did it before, but it's a cost to do more renders. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
SpiderPig Posted March 10, 2019 Author Posted March 10, 2019 Thanks, I'll give that a go. Does the second camera get rendered automatically in World->Render()? Quote
SpiderPig Posted March 10, 2019 Author Posted March 10, 2019 I think I got it working, just call camera->Render() with a buffer enabled. Thanks for your help. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.