Godot Version
4.2 - 4.3.beta1
Question
I’m trying to achieve a simple light posterization as a test.
I did look at the advanced_postprocessing tutorial, but it doesn’t go into any details of how to make use of the light function so I tried to figure it out on my own by looking at examples on godotshaders.
I noticed is that almost all shaders are set on the mesh which is what I’m trying to avoid. I want a post processor to cover everything possible in the view.
If anyone could point me in the right direction, I would greatly appreciate it.
My test scene
What it looks like with the quad mesh on
My post process light function
void light() {
float dot_nl = clamp(dot(NORMAL, LIGHT), 0.0, 1.0);
float nl_att = dot_nl * ATTENUATION;
float light;
if (nl_att < 0.5) {
light = 0.1; // with 0.0 the weird light doesn't exist
}
else if (nl_att < 0.75) {
light = 0.5;
}
else {
light = 1.0;
}
DIFFUSE_LIGHT += light * LIGHT_COLOR;
}


