0
votes

I've a strange problem with multiple render targets. I attached 3 textures to my FBO: color, normal and position. I can correctly render color and position, but rendering normal texture yields (green and red are part of a spinning cube):

enter image description here

In lower left corner, there is the result of rendering normal texture to a quad.

In my vertex shader, I'm computing normal as: normal = gl_NormalMatrix * gl_Normal, and in my fragment shader, I'm emitting it as: gl_FragData[1] = vec4(normal, 1);.

What's the issue here?

1

1 Answers

0
votes

Turns out I forgot to supply normals for rendered quads. Adding glNormal3f() calls fixed the problem.