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!

Clipplanes with shaders (OpenGL)

Postby BlockMen » Sun Jul 02, 2017 10:17 pm

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
cpp 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
BlockMen
 
Posts: 2
Joined: Sun Jul 02, 2017 9:54 pm

Re: Clipplanes with shaders (OpenGL)

Postby hendu » Mon Jul 03, 2017 6:50 am

Your shader has to act upon them. That's one of the parts a shader replaces.
hendu
 
Posts: 2583
Joined: Sat Dec 18, 2010 12:53 pm

Re: Clipplanes with shaders (OpenGL)

Postby BlockMen » Mon Jul 03, 2017 8:50 am

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?
BlockMen
 
Posts: 2
Joined: Sun Jul 02, 2017 9:54 pm


Return to Advanced Help

Who is online

Users browsing this forum: No registered users and 1 guest