Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Lightweight SRP: Terrain material issue

Discussion in 'Graphics Experimental Previews' started by demonixis, Mar 20, 2018.

  1. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hello,

    I'm upgrading a project to the Lightweight SRP and I've a problem with my terrains, they're all pink. I changed the default material by a custom one Lightweight/Standard Terrain, but it doesn't fix the problem.

    Do you know what how to fix that?

    Thanks!
     
    IgorAherne and P_Jong like this.
  2. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Hi,

    Terrain is a WIP feature in LWRP. We are working to get it working asap.
     
    ROBYER1 likes this.
  3. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Thank you! Is there any tips to get it partially working? Because a new terrain works.
     
  4. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    Terrain engine renders in multiple passes. You just need to change the Lightweight Standard Terrain shader add support to Base (renders terrain in distance) and Additional Passes (in case you have more than 4 splats).

    It should be straightforward to do. For shading lighting in LWRP you can just call GetMainLight(posWS) or GetLight(lightIndex, posWS). That will fill for you a struct with everything needed to shade a light. You can use the code in github as reference if you have that loaded as a package: https://github.com/Unity-Technologies/ScriptableRenderPipeline
     
  5. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Thanks! I'll take a look.
     
  6. lmgiorni

    lmgiorni

    Joined:
    Mar 14, 2014
    Posts:
    7
    Is there a way to put a texture RGBA as to specify where each texture should be applied? The terrain material for lightweight renderer has no options nor parameters.

    I can paint but I would like to avoid painting the hole terrain as I had a map procedurally generated in an external app.

    Thanks in advance