Search Unity

Using LightProxyVolume in surface shader

Discussion in 'Shaders' started by Orangy-Tang, Feb 21, 2017.

  1. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    39
    I have a custom surface shader which I want to use on an object in combination with a LightProxyVolume. The scene is all set up correctly, and if I use a regular Standard shader the object uses the volume correctly. However on my custom surface shader it only appears black (the volume is the only source of light, so this kinda makes sense).

    How can I get a surface shader to support a proxy volume? The proxy volume docs give an example for a non-surface shader ( https://docs.unity3d.com/Manual/class-LightProbeProxyVolume.html#SampleShader ) but don't mention surface shaders at all, where it doesn't seem to provide a good place to call ShadeSHPerPixel.

    Has anyone combined these two?

    Thanks.
     
  2. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    39
    Over a year late, but I came back to this and finally figured it out. Adding #pragma target 3.5 fixed this issue. I don't know what the minimum for the target is, but leaving it on the default will get you a surface shader that doesn't support LPPV.