Good Morning!
I need help creating an effect (similar to scattering) in the shadows.
Like this:
There is an outline in the shade with the color of the light a little stronger.
I tried to create a paracid effect by adding the color of the saturated light to the shadow fade area.
But it was asism:
float3 IncomingLight (Surface surface, Light light) {
float3 color = float3(1,1,1);
if (light.saturationRim > 0) {
if (light.attenuation < 0.8) {
if (light.attenuation > 0) {
float3 hsv = RGBtoHSV(light.color);//HSV
hsv.x = gmod(hsv.x + -0.02, 1.0);//Add HUE
hsv.yz *= float2(light.saturationRim, 1.4);//Add Saturation
float3 LightColor = saturate(HSVtoRGB(hsv));//RGB
color = lerp(float3(0, 0, 0), LightColor, light.attenuation) * light.attenuation;
}
}
}
return saturate(dot(surface.normal, light.direction) * light.attenuation) * light.color + color;
}
I tried again by multiplying the color:
float3 IncomingLight (Surface surface, Light light) {
float3 color = float3(1,1,1);
if (light.saturationRim > 0) {
if (light.attenuation < 0.8) {
if (light.attenuation > 0) {
float3 hsv = RGBtoHSV(light.color);//HSV
hsv.x = gmod(hsv.x + -0.02, 1.0);//Add HUE
hsv.yz *= float2(light.saturationRim, 1.4);//Add Saturation
float3 LightColor = saturate(HSVtoRGB(hsv));//RGB
color = lerp(float3(0, 0, 0), LightColor, light.attenuation) * light.attenuation;
}
}
}
return saturate(dot(surface.normal, light.direction) * light.attenuation) * light.color * color;
}
As you can see the ring is very strong and its edge should have a fade.
How can I create this effect in the right way?