2

I have an input texture in a certain resolution, and a target texture (attached as GL_COLOR_ATTACHMENT0) which is in a bigger resolution. I am using glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) to upscale the input and draw some stuff on the target.

I have a buffer which is in the same resolution as my input that I would like to use as GL_STENCIL_ATTACHMENT. Is it possible to attach it somehow without getting an error of GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS?

joshweir
  • 5,427
  • 3
  • 39
  • 59
C Coder
  • 55
  • 5

1 Answers1

3

It is not possible to attach textures with different sizes to a framebuffer.

The OpenGL-ES 2.0 Spec states in Section 4.4:

The framebuffer object target is said to be framebuffer complete [...] if all the following conditons are true:

  • All attached images have the same width and height.

If this is not the case, the framebuffer status has to return FRAMEBUFFER_INCOMPLETE_DIMENSIONS.

BDL
  • 21,052
  • 22
  • 49
  • 55