Sign in to follow this  

Projecting a texture to normalized screen coordinates

Recommended Posts

Hey guys, im having a slight problem getting texture projection to work based on the camera's view correctly. Ive been using projected textures for lighting etc for a while now and understand how it works, but i cant seem to get the projection planes to match the view frustum when im trying to use projected textures for reflection/refraction shaders. I get strange distortions dependant on how far up or down the camera is tilted, despite that my projection planes are using the forward, right and up vectors of the camera. Im not sure if it has something to do with how gluPerspective works in comparison to the texture coordinate generation. The only fix i have been able to do is to project the texture using window coordinates in the Fragment Shader, however this is introducing crap i'd rather have per vertex. If anyone could help that would be cool.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this