Original Post
Hi, wondering if you guys can give me some pointers (pun unintended
, am using C#/CsGL) on this issue...
My app renders a carpark scene with tons of pillars. Now, I need to add signs as decals to most of these pillar faces. The way im currently doin it is using Stencil Decaling.
quote:Draw Poly to be stencilled
GL.glEnable(GL.GL_STENCIL_TEST); GL.glStencilFunc(GL.GL_ALWAYS, 1, 1); GL.glStencilOp(GL.GL_KEEP, GL.GL_KEEP, GL.GL_REPLACE);
quote:Draw decal
GL.glStencilFunc(GL.GL_EQUAL, 1, 1); GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA ); GL.glEnable(GL.GL_BLEND);
quote:The problem is I have to clear the stencil buffer at the beginning of this code and this code has to be repeated for all pillars (~100). This drops my FPS from 60 to 30. If i dont clear, FPS is back up but got artefacts coz the stencil buffer now contains all the pillar faces as stencils. Any advice would be appreciated. Thnx.
GL.glDisable( GL.GL_BLEND ); GL.glDisable( GL.GL_STENCIL_TEST );