You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 thanlightMatrix * 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.The text was updated successfully, but these errors were encountered: