coin icon indicating copy to clipboard operation
coin copied to clipboard

Using GLSL Version >= 3.0

Open SherSpidey opened this issue 2 years ago • 8 comments

Sorry I'm new to open inventor. I'm trying to implement a cap-clip-plane function in coin(the original SoClipPlane does not render the clip face) by using stencilbuffer just like threejs and I've already done it in OpenGL 4.6. So, is there any chance I can do it in the coin? I try to follow the doc but the shader chapter using glsl with "ftransform" and "gl_ModelViewMatrix". I greatly appreciate any help you can offer.

SherSpidey avatar Nov 02 '23 03:11 SherSpidey

I can't help with this issue, but I guess freecad developers would love to see this implemented. Maybe there is a possibility to fund this. @luzpaz maybe you can help with getting the right people from freecad connected to this issue?

looooo avatar Nov 18 '23 15:11 looooo

Maybe @wwmayer ? (sorry for the ping, but perhaps you can weigh-in ?)

luzpaz avatar Nov 18 '23 15:11 luzpaz

Thanks for your reply, maybe I need to generate a clipped new shape before rendering instead of implementing it in rendering pipeline.

SherSpidey avatar Nov 18 '23 15:11 SherSpidey

@SherSpidey I played with a capping algorithm some years ago. I ended up with this python code: https://github.com/coin3d/pivy/blob/master/examples/utils/GlClipPlane.py

but I am not sure if this can help you.

looooo avatar Nov 18 '23 15:11 looooo

Does this help? https://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/moglgp/advclip.html

wwmayer avatar Nov 18 '23 16:11 wwmayer

@looooo wow, I can really look into it! thanks a lot!!!

SherSpidey avatar Nov 18 '23 16:11 SherSpidey

@wwmayer Yes! Thanks for your reply~

SherSpidey avatar Nov 18 '23 16:11 SherSpidey

glClipPlan in coin3d: https://github.com/coin3d/coin/blob/81dcd9f649ea34be409acbcdacdb877b88f52225/src/elements/GL/SoGLClipPlaneElement.cpp#L142L143

looooo avatar Nov 18 '23 17:11 looooo

Recently I decided to pick up it again by using pivy, and finally nailed it with the example code GlClipPlane.py! Big thanks to all of you~ image

SherSpidey avatar May 06 '24 09:05 SherSpidey