Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Light Point of view

Discussion in 'Shaders' started by MaT227, Dec 29, 2015.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hey everyone,

    I am trying to calculate transmittance using lights, in other words, from light point of view.

    But I am facing some difficulties about accessing properties such as shadowmaps, shadow position, light far plane, etc. as it seems to be really different considering directional lights, point lights, spots, etc.

    I can access the _ShadowCoord or the _LightMatrix0, _LightShadowData, _ShadowMapTexture, etc.

    Edit: The question was edited.
     
    Last edited: Dec 29, 2015
  2. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    The question was a bit badly formulated so I edited it.
     
  3. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
    Yes you can access such shader uniform in your own custom shader.
    They are just common uniform.
    Read unity build-in *.cginc and use it as you need.
     
  4. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Thanks for your reply @StevenGerrard, do you know how can I retrieve the directional light depth ?