Greetings ! Noob with Godot here, I wanted to have a shader that would do two things :
- map the color of the fragment to the closest color in my palette
- using the amount of light the fragment gets to determine what shading color I want
What I figured out so far :
- Since my game is in 3D I want a spatial shader
- I can get the original color of the fragment so mapping this to my palette is easy
What I am not sure about :
- How can I apply this to my whole screen not to a specific object ? Right now I do this by having a big mesh right in front of the camera and the shader applied to it as a material
- Can I do everything in the fragment function ?
What I dont know :
- How can I get the light information and apply it to get the proper shading ? I get that there is a light function that I could override but I am fine with the default light function. So how can I just use the result of the light function once it has been applied for every light on this fragment ?
The goal is to achieve something similar to what I do here with libGDX but I do all that in software