Hi!
I have written a custom vex surface shader (for clouds) and I discovered that somethng wrong happens in code:
…
illuminance(P, {0,1,0}, 3.14159)
{
if (receiveShadows)
{
shadow(Cl)
accColor += Cl;
// this code is evaluated
}
else
{
// … this code is not evaluated
}
}
I dont understeand why accColor changes - when I'm rendering from camera, which is near to the clouds, the accColor is very DARK, and has VERY VERY DARK SHADOWS, and when I'm rendering it form far, there are shadows and cloud is “normal”.
Additional this happens not very linear - there is some distance, before which everythiung is good, after which something is broken
I have no idea why this may happen
edit: I've discovered, that the very bright color was coused by some of my functions, which convert very dark pixels into very bright. After turn them off, my cloud is very dark when the camera is near the cloud and normal when the camera is in distance greater than a “magic” value
Help!