Hi again,
how can I find out the distance of my sampled fragment to the light in the eval() function?
Since the “direction” is normalized I can’t use this ![]()
Aya
Hi again,
how can I find out the distance of my sampled fragment to the light in the eval() function?
Since the “direction” is normalized I can’t use this ![]()
Aya
It is, unfortunately, not possible to do this (a physically plausible BRDF should not depend on this distance); can you tell me why do you need to know this distance - perhaps there might be another way to obtain it?
Best regards,
Vlado
Ohh… the reason why we want this is, because we want something like - i don’t know the english word for it - light that looses some of it’s power over the distance, but it should loose more red color then blue color etc (like it is in reality, the red light is absorbed faster then the blue). So, normally you would write a LightShader for this, but we want to be able to use any light we want ![]()
I see; you might be able to do this kind of attenuation with a volume shader instead, which can check for shadow rays and compute the attenuation accordingly.
Best regards,
Vlado