Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Help with own shadowmap alignment

Discussion in 'Shaders' started by topitsky, Sep 12, 2021.

  1. topitsky

    topitsky

    Joined:
    Jan 12, 2016
    Posts:
    100
    upload_2021-9-12_19-21-30.png

    I'm experimenting with this kind of shadowmapping where I have one shadowtex that has light positions mapped in colors. the 4 channels of the color are used to represent if there is light in that y position, so 0 is red, 1 is blue etc.

    I cant seem to manage having the map align perfectly when I use triplanar coordinates. Is there some magic math that I must have to account for some kind of distortion happening, or is this alignment impossible without proper uvs in the first place?

    upload_2021-9-12_19-26-55.png
     
  2. topitsky

    topitsky

    Joined:
    Jan 12, 2016
    Posts:
    100