This is a simple fix for an issue we were having with the Diffuse Ramp option, when using clamped textures. When the lighting was zero, the texture would wrap around to the other side of the diffuse ramp, resulting in errors in the parts facing away from the light.
The obvious fix for this was to enable clamp in the texture mode, but that didn't work at all. It turned out the diffuse ramp in the shader was accidentally sampling the UV range from 1.0 .. 2.0.
This fixes the range and brings it back to 0.0 .. 1.0, so clamp textures can be used. (Top row in example is current shader, bottom row is with this fix applied).
This is a simple fix for an issue we were having with the Diffuse Ramp option, when using clamped textures. When the lighting was zero, the texture would wrap around to the other side of the diffuse ramp, resulting in errors in the parts facing away from the light.
The obvious fix for this was to enable clamp in the texture mode, but that didn't work at all. It turned out the diffuse ramp in the shader was accidentally sampling the UV range from 1.0 .. 2.0.
This fixes the range and brings it back to 0.0 .. 1.0, so clamp textures can be used. (Top row in example is current shader, bottom row is with this fix applied).
Thank you!