reepblue Posted January 15, 2023 Share Posted January 15, 2023 My Leadwerks glass materials no longer work correctly upon reloading lvl7. Also getting this gross artifact. Nott sure if you wanted to move off of this thread for minor bugs, but decided to post these here. 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 January 25, 2023 Share Posted January 25, 2023 I am not sure what I am looking for or what appears wrong: #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the display list auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Terrain Experiment", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); world->SetAmbientLight(0); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); auto scene = LoadScene(world, "Maps/lvl7.map"); //Camera controls auto actor = CreateActor(camera); actor->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { scene = LoadScene(world, "Maps/lvl7.map"); } world->Update(); world->Render(framebuffer); } return 0; } 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 January 25, 2023 Author Share Posted January 25, 2023 The main issue was that the glass wasn't using it's alpha value when I last tried this, Maybe this was fixed in a shader update since. I can try this again tonight. 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 January 25, 2023 Share Posted January 25, 2023 It looks like these materials have a material color of (255,255,255,255) and the texture has no alpha channel, or a solid opaque alpha channel, so there is no transparency even if the material is set to display transparency. If I set the alpha channel of the material color to 128 the material appears transparent in Ultra: 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 January 25, 2023 Author Share Posted January 25, 2023 Ok, so I'm guessing this was "hacked" in previous builds by the loader looking up the Alpha blend mode and assuming it should be transparent. Something must have changed since going to 1.0.1 so I brought this up as a "It was working before, and now it's not" issue. if it's a small change I need to do and will not effect the result in Leadwerks, I'll adjust. No idea about the artifact with the ball launcher, might have to do with the spotlight. 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 January 25, 2023 Share Posted January 25, 2023 I think when I was previously testing it I had already set the material alpha. I also did some final adjustments to transparency, but the way it is working now appears to be correct. Regarding the ball launcher model, I don't know what is wrong with the image above. How is it supposed to be different from that? 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 January 25, 2023 Author Share Posted January 25, 2023 14 minutes ago, Josh said: Regarding the ball launcher model, I don't know what is wrong with the image above. How is it supposed to be different from that? There's this over casting shadow I caught on the top left of the launcher. 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 January 25, 2023 Share Posted January 25, 2023 I thought that was just the environment map reflection. It behaves like a cubemap reflection, moving with the camera but not changing when the camera rotates. 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...
Josh Posted January 25, 2023 Share Posted January 25, 2023 It looks like this if I turn the roughness all the way down. Maybe there is an issue with the cubemap mipmaps loaded from the scene file... 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 January 25, 2023 Author Share Posted January 25, 2023 I thought it was a lighting issue like the previous artifact I brought up, but an issue with the environment map also makes sense. 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 January 25, 2023 Share Posted January 25, 2023 I can produce the same effect by tilting a block: 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...
Josh Posted January 25, 2023 Share Posted January 25, 2023 It's got to be an error in the shader because all sides of the cubemap texture look fine: 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...
Josh Posted January 26, 2023 Share Posted January 26, 2023 The problem is definitely related to the cubemap coord shifting in the lighting code: dist = BoxIntersectsRay(vec3(-0.5f), vec3(0.5f), orig, -reflection); if (dist > 0.0f) { cubecoord = orig - reflection * dist; vec4 p = Plane(localposition, localnormal); if (PlaneDistanceToPoint(p, cubecoord) > 0.0f) { float sinfluence = min(influence, 1.0f - probespecular.a); u_MipCount = textureQueryLevels(textureCubeSampler[shadowMapID]); lod = materialInfo.perceptualRoughness * float(u_MipCount - 1); probesample = textureLod(textureCubeSampler[shadowMapID], cubecoord, lod); probesample.rgb = min(probesample.rgb, 2.0f); probespecular.rgb += probesample.rgb * probesample.a * sinfluence; probespecular.a += sinfluence * probesample.a; } else { probespecular = vec4(1,0,0,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...
Solution Josh Posted January 26, 2023 Solution Share Posted January 26, 2023 Okay, I removed that plane distance test and it appears to work fine. I am not sure why that was even in there. Maybe we will see a problem in the future that was supposed to solve, but I don't even know why it is in the code. 2 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...
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.