Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


The final word on stencil buffer and FBOs


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 _necrophilissimo_   Members   -  Reputation: 136

Like
0Likes
Like

Posted 07 January 2012 - 04:59 AM

I've been reading from all sorts of Internet articles about trying to get stencil buffer to work within Frame Buffer Objects and what I've encountered is a massive amount of conflicting information. Some articles say it doesn't work, others say it does but requires the use of Depth Buffer as well - and a couple mention potential hacks using multiple FBOs. So, what exactly is the case with Stencil Buffers and FBOs?

What I really need is an FBO with just color and stencil buffers - adding a depth buffer I do not use results a serious framerate dip. Is there a special multi-FBO work-around to do this or this a lost cause?

Any help is appreciated.

Sponsor:

#2 V-man   Members   -  Reputation: 805

Like
1Likes
Like

Posted 07 January 2012 - 06:04 AM

I don't think that any GPU support a color buffer and stencil buffer. Mots GPUs support the D24S8 format (Depth = 24 bit + stencil = 8 bit ==== total 32 bit)
http://www.opengl.org/wiki/Framebuffer_Object_Examples#Stencil
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

#3 _necrophilissimo_   Members   -  Reputation: 136

Like
0Likes
Like

Posted 07 January 2012 - 08:30 AM

Thank you, just what I wanted to know :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS