Pass camera position to shader - #228
Conversation
|
Can we pass more to the camera here? A particular usecase of mine requires the world matrix, the projection matrix, and an inverted view matrix. |
|
I could try, I'll look into it after I get off work today. What's a world matrix btw ? I am not too familiar with the terminologies I am also curious about the use case, is it for shading purposes ? |
|
Actually, I spoke too soon, those aren't appropriate to pass here. |
|
The "world matrix" would probably be useful in some cases and the world position can be extracted from it. That might be the more "general purpose" solution. We could also consider making this an "optional" binding that is separate from the ViewProj. I honestly don't know the best choice here. Maybe we should look at what other engines do for this. |
|
I'm closing this PR, I think this is better if this is done alongside shader implementations (such as #261 ), since we would know better what to pass to the shaders |
Pass camera position to shader to calculate fragment to camera direction.
Will be useful for specular/fresnel calculation later on