Announcement

Collapse
No announcement yet.

SDK: LightPosition or Distance in eval()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDK: LightPosition or Distance in eval()

    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

  • #2
    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
    I only act like I know everything, Rogers.

    Comment


    • #3
      Originally posted by vlado View Post
      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

      Comment


      • #4
        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
        I only act like I know everything, Rogers.

        Comment

        Working...
        X