Replying to Avatar binkle

nostr:npub16sz45sngz7k7ha48c9gekuaxc6gntujtynsfukdx6807m6lv7z5sgw378f I'm coloring the shadows red and the results make NO sense to me. They're receding as the sun goes up but they're going the wrong way

https://media.clubcyberia.co/pleroma/4d01f91498fc77be40b8f26ba5ca6d3673ebe7230911ba9d6c1f4d718ebe8989.mkv

have you tried peeking at the shadow map to see if it looks plausible? If I was going to guess I’d say you’re projecting it wrong though.

Reply to this note

Please Login to reply.

Discussion

nostr:npub16sz45sngz7k7ha48c9gekuaxc6gntujtynsfukdx6807m6lv7z5sgw378f not yet, although I should do that

I’m willing to bet you’re right and it is the projection, but tbh I have no idea what these glm::ortho() values should be. Right now I’ve got:

glm::mat4 lightProjection = glm::ortho(-1000.0f, 1000.0f, -1000.0f, 1000.0f, 0.0f, 5000.0f);

which should give me a VERY big projection, but that seems necessary since the sun is far away

and

light_view = glm::lookAt(Sun::dir * 900.0f,

glm::vec3(0.0f,0.0f,0.0f),

glm::vec3(0.0f,1.0f,0.0f));

which should give me a view matrix roughly where the sun is currently located, looking in the direction of the center of the map.

do either of those look totally whack?

nostr:npub16sz45sngz7k7ha48c9gekuaxc6gntujtynsfukdx6807m6lv7z5sgw378f got renderdoc working on my new distro and it looks like the shadowmap has a depth of 1 everywhere, which means the sun isn't seeing the landscape, which confuses me because it should be consistently black if that's the case. I'm wondering if it's a precision issue with my projection being so large