I'm using OpenGL and I need to render the vertecies of a 3D model to a FBO at the UV coordinate of the vertex. To do that, I first have to convert the UV coordinate space to the screen space.
I came to the conclusion that:
uv.x * 2 - 1
uv.y * 2 - 1
…should do the trick.
I used that in my vertex shader to place the vertex at those new positions. The result looks like this:
…while it should should look like this:
It seems like it's scaled up. I dont know where the problem is.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…