- Home /
Question by
SkandYxyz · Sep 24, 2017 at 06:36 PM ·
lightspotlightpoint light
Attenuation of point and spotlight
Hi!
I need attenuation values in forward add pass, but this script always returns 1:
UNITY_LIGHT_ATTENUATION()
What can be the reason?
Best, Andre
Edit:
I looked in the autolight file and this is the code:
#ifdef POINT
uniform sampler2D _LightTexture0;
uniform unityShadowCoord4x4 _LightMatrix0;
#define UNITY_LIGHT_ATTENUATION(destName, input, worldPos) \
unityShadowCoord3 lightCoord = mul(_LightMatrix0, unityShadowCoord4(worldPos, 1)).xyz; \
fixed destName = (tex2D(_LightTexture0, dot(lightCoord, lightCoord).rr).UNITY_ATTEN_CHANNEL * SHADOW_ATTENUATION(input));
#endif
it seems, that SHADOW_ATTENUATION(input) is zero. But why... mabe because i pass 0 as input?
Comment
Your answer
Follow this Question
Related Questions
Why is the default pixel light count so low? 1 Answer
Is it possible to create a torus-/ring-shaped light? If so, how? 2 Answers
Light and lag problem 0 Answers
Problem with network flashlight 1 Answer
Point Light Shadow ? 1 Answer