3 ms·
> rem if instead y component is negative, make a checkerboard of pieces of sky I'd maybe phrase this a bit differently – in both cases it uses the v coordinate
by Sharlin 3y ago
> rem if instead y component is negative, make a checkerboard of pieces of sky
I'd maybe phrase this a bit differently – in both cases it uses the v coordinate to calculate the shade but whereas the sky is a simple gradient, the plane has a "ground fog" type effect that can be adjusted with those +.3 and +.2 magic constants.
- kragen 3y agoi was trying to figure out how the ground fog happens, and i still don't
- Sharlin 3y agoThe value of v corresponds to how far away the intersection point is. At the horizon v=0 so the color value is just constant 0.2. The closer to the camera, the more the checker value (0 or 1) contributes. The exact values are probably chosen experimentally, but note the important property that -v*(checker/2+0.3)+0.2 is always between 0 and 1. Note also that 1 means black and 0 white here, as ultimately the value is negated at line 70.