opengl: glBlendFunc stencil-buffer
in
Programming Questions
•
1 year ago
hi there,
i use the well known
glBlendFunc for getting some gloweffect.
for drawing is use this code:
- drawImage();
- pgl.beginGL();
- gl.glDepthMask(false);
- gl.glBlendFunc( GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_COLOR);
- pgl.endGL();
- for (int i = 0; i < splints.size(); i++) {
- Splinter s = (Splinter) splints.get(i);
- s.update();
- s.paint();
- }
i get this result:
first i draw the image (toothpaste), then i set the blendfunc and then i use 3d bezier-splines and draw an unsharp filled circle on every beszierpoint to get the lines. the problem is, i need to set the depthmask to false, to get the blendig, but the image of the toothpaste (png with transparence) is then not transparent. this is just an pimage which is always orientated to the cam.
i think i need a stencil-buffer, to cut out those points and their pixels, which are behind the image.
do i need also a depthbuffer?
i found some stencil examples on the net, and try to implement them.
but is this the right way?
thanks in advance,
christoph.
1