Page 1 of 1

Clipplanes with shaders (OpenGL)

Posted: Sun Jul 02, 2017 10:17 pm
by BlockMen
Hi, I'm running into a problem when using a clipplane and the custom ISceneNode renders my vertices (video::S3DVertex) with a shader material.

I'm setting my clipplane via

Code: Select all

 
core::plane3df clipPlane = core::plane3df(0.0, -0.530, 0.0,  0.0, 1.0, 0.0);
driver->setClipPlane(0, clipPlane, true);
 
which works as expected, but when using my shader materialtype it doesn't work anymore.

The (base-) materialtype is in both cases (shader, no shader) video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF


Any hint how I get the clipplane working with shader materialtypes or idea for workarounds?


PS: Seen on Win 8.1, OpenGL 4.2 & 4.5, Irrlicht 1.8.3

Re: Clipplanes with shaders (OpenGL)

Posted: Mon Jul 03, 2017 6:50 am
by hendu
Your shader has to act upon them. That's one of the parts a shader replaces.

Re: Clipplanes with shaders (OpenGL)

Posted: Mon Jul 03, 2017 8:50 am
by BlockMen
Ah, thx. Googled that and it works fine for me with gl_ClipDistance[0] = ... . Just one small question left: Is there any gl_* thingy i can use for the clipPlane pos and normal (that might be set by using irrlichts setClipPlane()) or do i have to use an uniform vec for that?