reepblue Posted June 2, 2024 Share Posted June 2, 2024 This example shows the face flipping (See the cone) when rendering the scene on a texture. This is something you'll see when in VR, which might be related. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(world); auto cone = CreateCone(world); cone->SetPosition(1.25, 0, 0); cone->SetColor(0, 0, 1); auto sphere = CreateSphere(world); sphere->SetPosition(-1.25, 0, 0); sphere->SetColor(1, 0, 0); //Create camera and texture buffer auto texbuffer = CreateTextureBuffer(256, 256, 1, true, 0); auto cam2 = CreateCamera(world); cam2->SetClearColor(1, 1, 1); cam2->SetRenderTarget(texbuffer); //Create material auto mtl = CreateMaterial(); mtl->SetShaderFamily(LoadShaderFamily("Shaders/Unlit.fam")); auto tex = texbuffer->GetColorAttachment(); mtl->SetTexture(tex); box->SetMaterial(mtl); //cone->SetMaterial(mtl); //sphere->SetMaterial(mtl); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { //Orient the texturebuffer camera cam2->SetPosition(0, 0, 0); cam2->Turn(0, 1, 0); cam2->Move(0, 0, -3); world->Update(); world->Render(framebuffer); } return 0; } I found this while trying to do a Portal effect. 2 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
SpiderPig Posted June 2, 2024 Share Posted June 2, 2024 Yes I'm seeing this too. 1 Quote Link to comment Share on other sites More sharing options...
klepto2 Posted June 3, 2024 Share Posted June 3, 2024 As temporary fix you could try this: camera->SetBackfaceCulling(0); this solved it for me. 2 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Solution Josh Posted June 11, 2024 Solution Share Posted June 11, 2024 Fixed. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted June 11, 2024 Author Share Posted June 11, 2024 Hopefully this fixes VR but I'm not gonna count on it. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted June 11, 2024 Share Posted June 11, 2024 With VR, you are always rendering to a texture. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted June 11, 2024 Author Share Posted June 11, 2024 1 minute ago, Josh said: With VR, you are always rendering to a texture. Ok, hopefully that does it! Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
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.