SpiderPig Posted August 5, 2023 Share Posted August 5, 2023 Here's something I've never mastered. How to get my large voxel terrain to cast shadows onto itself? At the very least I want nearby mountains to cast shadows. Is this a separate pass done in a specific shader? Or some highly advanced custom code I need to write? Quote Link to comment Share on other sites More sharing options...
Josh Posted August 5, 2023 Share Posted August 5, 2023 Shouldn't it just work automatically? 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...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 That's what I originally thought but it never has... not for a custom mesh at least. Unless there's something extra I need to setup. Material or entity settings perhaps? Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 So this is it currently, not even shadows from the player. I'll double check my light setup first. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 Well if I actually created a light it might help, eh? void Atmosphere::CreateSun() { //light_sun = CreateDirectionalLight(world); //light_sun->SetRotation(45, 35, 0, true); } My dark patch friends are back with the light but no shadows. Shadows would need valid UV coords yeah? Quote Link to comment Share on other sites More sharing options...
Josh Posted August 5, 2023 Share Posted August 5, 2023 14 minutes ago, SpiderPig said: Shadows would need valid UV coords yeah? No 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 August 5, 2023 Share Posted August 5, 2023 Call world::SetIblIntensity(0) to get rid of the PBR lighting so you can see what's going on better. 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...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 This is with IBL intensity set to 0. I'm sure I posted this issue before and I thought I solved it.. it might be my shader... Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 Not my shader. This is the default shader.... Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 Posted the issue here: https://www.ultraengine.com/community/topic/62056-shadow-problems/ Quote Link to comment Share on other sites More sharing options...
Josh Posted August 5, 2023 Share Posted August 5, 2023 You can also save your model as a GLTF and view it in another program to make sure there's nothing strange going on. 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...
SpiderPig Posted August 5, 2023 Author Share Posted August 5, 2023 Ah okay. I'll try that too. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted September 6, 2023 Author Share Posted September 6, 2023 Shadows are being cast properly now. However the player and terrain don't have shadows... I think it might be due to both have pivots as a parent somewhere down the line... I will test this. pivot->SetShadows(true) Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted September 6, 2023 Author Share Posted September 6, 2023 The terrain does have shadows now but what I really want to do is have terrain shadows far into the distance. Ideally the whole terrain casts shadows at least onto itself at a low resolution if required. Is this something that can be done with shaders and an extra camera? Quote Link to comment Share on other sites More sharing options...
Josh Posted September 6, 2023 Share Posted September 6, 2023 I suppose you could create a second camera and another directional light, but the performance will probably not be good. Maybe use a single box light instead. A baked lightmap for distance terrain shadows is something I have thought about. 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...
SpiderPig Posted September 6, 2023 Author Share Posted September 6, 2023 That actually gives me an idea. I suppose I could create a series of low resolution shadow maps and use a shader to blend between them depending on the light direction. Or even a compute shader to calculate the shadow map on the fly. 🤔 Quote Link to comment Share on other sites More sharing options...
miladenaa Posted October 10, 2023 Share Posted October 10, 2023 I'll try that too. teatv download apk Quote 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.