Advertisement

OpenGL 4 projective texture mapping

Started by November 03, 2022 02:01 AM
3 comments, last by taby 2 years ago

Does anyone have any recommendations for tutorials or whatnot that show how to do projective texture mapping? I found one small example in a book that I own:

https://github.com/daw42/glslcookbook/blob/master/chapter04/sceneprojtex.cpp

I got it to work, after struggling with layout issues. When it comes down to it, the only thing to set is the projector matrix.

The code given above is pretty easy to migrate into other projects.

reticle projected onto board
reticle with transparent background, made in paint.net

Advertisement

Here I only apply the projected texture where the normal is like vec3(0, 1, 0). Looks better?

With lines and a reticle and depth of field all highlighting the selected object. I know the lines are not popular, but what alternative do I have for highlighting a character?

This topic is closed to new replies.

Advertisement