jogl's glColorMask access through Xith

Hey everybody.

I’m trying to realise some occlusion by “invisible” objects. I.e. I draw some objects with gl.glColorMask(false,false,false,false) - but writing to the depthBuffer. Afterwards I turn color writing back on and draw my regular objects…

The latter are “occluded” by the first ones… Perfect in jogl.

Now I try to do the same thing in Xith (because I’d like to have loaders and scenegraph-convenience as well) using jogl as a renderer. But I didn’t figure it out where or from where I can trigger these low-level-GL-commands, since I just add my scene to an universe and all I can do is set some Appearances.

Can I control colorMask-writings during the drawing of the scenegraph?

Well, hopefully I just didn’t take a precise look into the documentation and it’s possible. If so: perhaps someone could point out the passage and I’ll turn red in shame and that’s it. :wink:

I can go into more detail, but perhaps it’s already sufficient…

You can lookup an OpenGL funciton in Xith3D simply by searching for it :slight_smile: I did a search for “ColorMask” and got a few hits. The *Peer classes are the interesting ones, that’s where the OGL stuff happens.

I see in com.xith3d.render.jogl.RenderingShaderPeer:


        RenderingAttributes ra = ((RenderingShader)shader).getRendering();

        gl.glDepthMask(ra.getDepthBufferWriteEnable());
        gl.glColorMask(ra.getEnableRedWrite(), ra.getEnableGreenWrite(), ra.getEnableBlueWrite(), ra.getEnableAlphaWrite());

It looks like the colour mask, just like disabling the depth buffer is done from RenderAttributes. RenderAttributes are attached to Appearence.

Cheers,

Will.

Hey. Yeah, thanks a lot. That’s working.

Great! ;D You’re welcome.

Will.