Skip to content

Conversation

@andreasterrius
Copy link

Pass camera position to shader to calculate fragment to camera direction.
Will be useful for specular/fresnel calculation later on

@karroffel karroffel added the A-Rendering Drawing game state to the screen label Aug 18, 2020
@lachlansneff
Copy link
Contributor

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.

@andreasterrius
Copy link
Author

andreasterrius commented Aug 19, 2020

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 ?

@lachlansneff
Copy link
Contributor

Actually, I spoke too soon, those aren't appropriate to pass here.

@cart
Copy link
Member

cart commented Aug 20, 2020

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.

@andreasterrius
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants