Greetings, I hope everyone is well.

I recently came across this wonderful demo on youtube for cutoff shaders and was trying to implement it in my project.

The creators github is linked in the description where the project can be found. I've also included the files in this post.

The shader basically turns part of the object invisible as it passes through a defined area.

Out of the shaders the creator has provided I am playing around with "Simple_cutoff_plane_SHADER_CODE.shader"

With the default code my object begins to turn transparent as it moves through the world plane on the Y axis but in the provided demo the objects begin to turn transparent as they pass an invisible diagonal wall.

My question is, how can I learn to understand the code so I can begin to make use of it? I would like to attach a simple invisible plane to a camera which when passing through objects causes those objects to turn transparent because of the shader applied to them.

Any help would be appreciated.

Kind regards and thank you in advance.

Welcome to the forums @eh3825!

I would highly recommend asking the developer on GitHub who made the shader for how to use it, as they would know best how it works and how it might be used. Especially for understanding the code, they likely be able to help give pointers since they wrote it originally. Though keep in mind they may be busy and/or not have the time to explain.

Something else you can do to try and understand the shader and its code is selectively comment out parts of it to see what they do and how they function. print statements are helpful for showing data in the console for GDScript code, which can also be invaluable for figuring out how something works.

Thank you TwistedTwigleg, I'll see if I can get in touch with them.

2 years later