0

I'm trying to draw to a subrect of a texture based FBO, but am having difficulty. The FBO has dimensions of say 500x500 and I am trying to have the fragment shader only redraw say a 20x20 pixel subrect. Modiyfing the full texture works without difficulty.

At first I tried setting glViewport to the needed subrect, but it doesn't look to be that simple. I'm suspecting that the Vertex attributes affecting gl_Position and the varying texture coordinates are involved, but I can't figure out how.

genpfault
  • 51,148
  • 11
  • 85
  • 139
OnesAndZeroes
  • 315
  • 1
  • 9
  • What is your problem and what kind of result do you get? Just a shot in the dark: You are not clearing the buffer (glClear) are you? – Matic Oblak Mar 11 '13 at 15:13

1 Answers1

0

Turns out that I was trying to modify the texture coordinate attributes, but was more easily able to just modify the viewport using glViewport and gl_FlagCoord within the shader.

OnesAndZeroes
  • 315
  • 1
  • 9