Light Attenuation + Texture Sample Misconception
Posted: Sat Oct 06, 2018 4:12 pm
I fear I need someone to straighten my misconception.
My goal is to let the U component of a Texture Sample depend on the Attenuation value.
See attached screenshot for a testcase.
I cannot make sense of the output here.
I was expecting to see the same colors as in the sampled texture:
Blue closest to the light, going to green, and lastly red.
This result is indeed showing, but it turns out that the R Component of the sample output is not 0, even if we are sampling from the Green or Blue pixels in the texture.
My expectation was that, using the Texture Sample node, any UV value should return the rgb value of a pixel in the image. No matter what value we would plug into the U component.
I tried all sorts of weird inputs, just for my own sanity, and always got pure R, G or B values, as the texture contains no pixels with other values.
Only when using the Attenuation node, I get a result as demonstrated in the picture.
Clearly I am missing something. I tried to find as much documentation on the Custom Lighting mode, output and the Light Attenuation node as possible, although i did not find more than the node information, and the mention of the Custom Lighting feature.
It would be a big help to have this output clarified. Any additional knowledge about the Custom Lighting mode is very much appreciated.
Using
Amplify Shader Editor 1.5.6
Unity 2018.1.1f1
Love Amplify Shader,
Concrats to the team.
Thanks in advance.
-Edited to add version information-
My goal is to let the U component of a Texture Sample depend on the Attenuation value.
See attached screenshot for a testcase.
I cannot make sense of the output here.
I was expecting to see the same colors as in the sampled texture:
Blue closest to the light, going to green, and lastly red.
This result is indeed showing, but it turns out that the R Component of the sample output is not 0, even if we are sampling from the Green or Blue pixels in the texture.
My expectation was that, using the Texture Sample node, any UV value should return the rgb value of a pixel in the image. No matter what value we would plug into the U component.
I tried all sorts of weird inputs, just for my own sanity, and always got pure R, G or B values, as the texture contains no pixels with other values.
Only when using the Attenuation node, I get a result as demonstrated in the picture.
Clearly I am missing something. I tried to find as much documentation on the Custom Lighting mode, output and the Light Attenuation node as possible, although i did not find more than the node information, and the mention of the Custom Lighting feature.
It would be a big help to have this output clarified. Any additional knowledge about the Custom Lighting mode is very much appreciated.
Using
Amplify Shader Editor 1.5.6
Unity 2018.1.1f1
Love Amplify Shader,
Concrats to the team.
Thanks in advance.
-Edited to add version information-