Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculating shadow map coordinates from model space or world space position. #35

Open
neon64 opened this issue Apr 8, 2015 · 0 comments

Comments

@neon64
Copy link

neon64 commented Apr 8, 2015

I've just noticed in the shadow mapping code, the shadow map coordinates are generated by multiplying the lightMatrix with the model-space position of the vertex.

Considering that the light matrix only contains the 'view' and 'projection' parts, don't we need to do lightMatrix * vec4(worldSpacePosition, 1.0) rather than lightMatrix * vec4(modelSpacePosition, 1.0).

Or does your rendering engine include the model matrix in the lightMatrix somewhere.

This is a weird issue because it seems fine with your game, but with my own game engine (with the shadow mapping code inspired by yours) I need to use the worldSpacePosition for it to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant