After a few years it’s probably a good idea that I delve into the depths of GLSL :yes:
However, as a first project, i’ve decided to tackle my interpretation of a solution for leonnn in his game (whether he wants it or not).
Now, i know what i need to do, or at least what would make sense…
He wants to invert the color of any object behind a (invisible i presume) plane.
So, my thoughts:
- Get the plane’s vertices
- Multiply their xyz() coordinates with the object’s worldTransform()
- Get the screen space (camera.getScreenPosition())
- Use something similar to a point in polygon as a condition
- If true, invert pixel colours at coordinate
So, that’s the theory, now for some questions;
- Does the screenposition returned by camera.getScreenPosition([x, y, z]) actually relate to GLSL screen positions
- How does one convert the above to a GLSL position
- Any basics on how the vertex and fragment shaders interact
- Any final tips?
Thank you in advance BlenderArtists