Search Unity

Question Light Cookie Texture

Discussion in 'High Definition Render Pipeline' started by eloi-maduell, Nov 21, 2022.

  1. eloi-maduell

    eloi-maduell

    Joined:
    Dec 30, 2014
    Posts:
    6
    I have to work with a good amount of HDRP AreaLights (around 80) and I need a different Cookie Texture for each of them. I would like to access a render texture that has all of the 80 cookie textures and be able to adjust the light cookie texture coordinates for each light (instead of having to deal with 80 single textures).

    Is there any way via script in C# to control the light cookie texture coordinates ? I've been searching on the forum and internet and I didn't find any reference, so probably it's not possible, but anyone has a clear answer if that might be possible ?
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, no this isn't supported. We currently already copie cookie of each light inside an atlas internally - so there is an indirection. So using a scale and bias offset for cookie coordinate is supported in shader code but aim to be used with our interal atlas.
     
  3. eloi-maduell

    eloi-maduell

    Joined:
    Dec 30, 2014
    Posts:
    6
    Hi SebLagarde ! Thanks for your quick answer. Is there any way available to access the shader code that controls scale and bias offset of the internal cookie atlas ? Or is it "internal" meaning that there is no access for users or it's not workable as it implies a lot of "internal" stuff ?