using a shader and a heightmap?

michelez's icon


Question: I want to use the wonderful "mat.glass.jxs" shader provided in the C74-reources-media-jitter-shaders folder. It looks great. I can use the jit.gl.shader object to attach it to a gridshape and, again, it loos great. But now I want to use the jit.gl.material @heightmap_mode ... to create surface displacement. The material overrides the shader :( Is there a way to use the material and a shader? I would try to edit the mat.glass.jxs file and add a heightmap feature to it but I amstill not conversant in GLSL. Please suggestions?

Rob Ramirez's icon

yeah you'll have to get your hands dirty with GLSL to combine these two material effects.
alternatively you can simply use jit.gl.mesh position matrix input to perform the displacement, with a glass shader applied.

i've attached the vtf heightmap effect jxs below. you could combine this with the glass shader to get the effect you want. you would combine the main functions of the fragment shaders.

vtf-normals-gl2.jxs
jxs 9.24 KB


michelez's icon

Thanks Rob, I will try to work with the .jxs. Federico has provided a solution is GLSL here
https://www.patreon.com/posts/23349541?fbclid=IwAR3PCDITpNnTD1PEE4OX4ICIV7SXww9tmkhWWBX-K6RhSb55YrglNeB_LRg