GHGL shader - matcap opacity

Hi all,

I saw this recent forum post about doing iridescent materials, and my Googling led me to OpenGL shaders.

I’m a big fan of artist Zach Lieberman’s work, which has a particular softness and brilliance to it (especially in the context of his animations) that I am trying to emulate within Grasshopper. To my understanding he uses OpenGL shaders in his code - I don’t know how to code in JavaScript, so I’m trying to see if it’s possible to keep my workflow within Rhino. What I enjoy about using GHGL is that it live updates in the viewport, without having to go and render a frame, which I presume the alternative would be.

Coding experience zero, so it’s very much a case of diving in cold turkey. I followed this tutorial explaining how to code a shader referencing a matcap file, which I was able to recreate successfully. Pretty cool! There is unfortunately very limited tutorials available on the subject with a similar video format.

What this shader does lack is transparency, however I am unsure how to adapt the code in order to achieve this. If you look at the matcap image, it does have a degree of transparency to it. Any help in trying to achieve this? Definition attached below.

shader test 2023-06-24.gh (13.5 KB)

1 Like