Search Unity

Custom light probe data

Discussion in 'Universal Render Pipeline' started by Orangy-Tang, Dec 17, 2019.

  1. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    39
    Is there any documentation around providing custom light probe data for a MeshRenderer when using the URP? This functionality exists as part of the Standard pipeline ( https://docs.unity3d.com/ScriptReference/Rendering.LightProbeUsage.CustomProvided.html ) but involves using MaterialPropertyBlocks. After reading about the new SRP Batcher, I can't see how this would work with the new CBUFFER way of doing things, and can't see how that would actually make it into the correct bit of the URP lit shader.

    Is there any examples of this out there?

    Thanks
     
  2. elijad

    elijad

    Joined:
    Mar 19, 2020
    Posts:
    47
    Sorry for necroing this thread, but I've just run into the same issue. There doesn't seem to be any official/unofficial explanation on how to do this. Anyone?
     
  3. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    39
    Sadly I didn't find a solution to this, so I'm still stuck on the Standard pipeline. :(
     
  4. elijad

    elijad

    Joined:
    Mar 19, 2020
    Posts:
    47
    What i've gathered from unity's srp batcher benchmark is that you can just set parameters on a material e.g. material.SetColor("_BaseColor", Color.black). This does create material instances but since these values are already in a cbuffer, this won't break SRP Batcher. The problem arises with light probes however as you can't just set built in values that way. So still waiting for a response from unity on whether custom light probes are supported at all by the srp batcher.
     
  5. elijad

    elijad

    Joined:
    Mar 19, 2020
    Posts:
    47
    I tested the above method with a custom variable name and it does indeed work. However, setting light probes on a mesh renderer to custom seems to automagically disable srp batching. So you can only make custom lightprobes work with srp batcher by creating a custom shader as of today. Unity's built in shaders won't work.
     
    God-at-play and AzurySimon like this.
  6. AzurySimon

    AzurySimon

    Joined:
    Jul 16, 2018
    Posts:
    38
    I stumbled across this thread while searching for information about custom lightprobes as well. According to the URP feature comparison table they are officially supported, but I can't find anything on how to do it properly. I managed to make it work using a MaterialPropertyBlock, but obviously you are not supposed to use them with URP, as this breaks batching. So what is the official way to use custom lightprobe data with URP?
     
  7. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    did anyone ever get an update about this?
     
  8. AzurySimon

    AzurySimon

    Joined:
    Jul 16, 2018
    Posts:
    38
  9. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Bumping this as well ! I actually would love to see more options and scripting access when working with SH. For example i couldn't figure out how to adjust individual light probes within a group (tried with this tool: https://github.com/kemalakay/lightprobes).
     
    AzurySimon likes this.