Writing to FBO at multiple coords possible?

Standard syntax for writing to FBO:

layout(location = 1) out vec4 colOut;
...
colOut=col;

Assuming the FBO texture attached has the FBO id fboc, am I constrained to writing to fboc at the set of coordinates associated with colOut, or can I offset the texel colOut will write to? What I have in mind is generating a shadow map for the floor:

if the fragment belongs to an occluding object:
  calculate the vector from the light to this fragment;
  extend the vector away from the fragment 
  foreach texel coincident with the vector darken it.

No, you cannot write to arbitrary offsets. The location is decided based on the location of the current fragment where the fragment shader is running. You can output to a different attachment but the output will be written to the same location for all the attachments as well. This is the limitation of the shader APIs.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.