Clipplanes with shaders (OpenGL)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
BlockMen
Posts: 2
Joined: Sun Jul 02, 2017 9:54 pm

Clipplanes with shaders (OpenGL)

Post 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
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Clipplanes with shaders (OpenGL)

Post by hendu »

Your shader has to act upon them. That's one of the parts a shader replaces.
BlockMen
Posts: 2
Joined: Sun Jul 02, 2017 9:54 pm

Re: Clipplanes with shaders (OpenGL)

Post 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?
Post Reply