Case 1221827 URP -Terrain LightProbes for Speedtree7/8 shaders bake black

Reported at (Case 1221827) [URP][Terrain][Speedtree]Terrain LightProbes for Speedtree7/8 shaders bake black

When importing Speedtree shaders into URP, we noticed that once the light mode was set to baked only on the directional light in our scene, the speedtree shaders bake out completely black from Terrain Light probes. Prior to baking (with all baked lighting cleared), the trees just have a dark side where they are in shadow but this is very dark and looks ugly nomatter what we do with Shadow intensity on the directional light.
When we took the tree materials and changed them to the default URP/Lit shader, they look just fine with terrain light probes.

My assumption here is that in URP only, the light probes on the terrain bake out completely black for Speedtree shaders as this does not happen with the built-in renderer, see the videos below. I am happy to share this example scene (both the URP and built-in renderer version) as we are not pleased our trees do not look right in URP now.

UniversalRP version:

Built-In version

3 Likes

Reproduction steps here @wyatttt

Steps:

  • Make a new Unity 2020.1.0a23 (or a24) project for Android Platform using 3D Template in Unity Hub

  • Build Settings - Set texture compression to ASTC

  • Player settings - Set scripting backend to IL2CPP

  • From the Asset Store, import these example speedtrees (or copy the exact same assets from the repro project with this case as the Speedtree files are unmodified) Free SpeedTrees Package | 3D SpeedTree | Unity Asset Store

  • Make a new scene, leave everything as default

  • Set Directional Light to ‘Baked Only’

  • Create a terrain, leave default settings but set width 50 and height to 50 under terrain settings, Lightmapping settings - Scale in lightmap to ‘1’ (so we can see if any shadows bake clearly)

  • Lighting - Lightmapping Settings - Lightmapper - set to GPU (preview)

  • Drag and drop Broadleaf mobile or any other speedtree into the scene

  • Set the tree to 0,0,0 position in the world and tick it as static, tick ‘set children static’ also when asked

  • Drag the tree gameobject back into the project window to make it a prefab

  • Under Terrain - Paint Trees, click ‘Edit tree’ and add tree, drag the prefab tree we have just made into the tree edit dialogue

  • Now paint some of the trees on terrain

  • Bake the scene lighting in the Lighting window, verify the trees cast shadows and are lit perfectly using built-in 3d renderer with the Terrain light probes (you can see under Terrain-Terrain Settings - Tree & Detail Objects - Bake Light Probes For Trees is ticked by default for this.

  • –Importing of URP–

  • Window-Package Manager- All Packages - Universal RP - Install

  • Right click in project window - Create - Rendering- Universal Render Pipeline - Pipeline Asset (Forward Renderer)

  • Edit - Project Settings - Graphics - drag the newly created Pipeline asset into the Render Pipeline Asset field at the top of the window

  • On the Terrain, Terrain Settings - Basic Terrain - Material, add the TerrainLit material from Packages - Universal RP\Runtime\Materials (This seems to be a workflow issue with switching to URP)

  • Select the original speedtree asset you used in the project window (Broadleaf mobile) - Materials - Generate (or regenerate materials)

  • Now see the trees that looked fine (then turned pink due to the render pipeline change) are now black, something is obviously off here!

  • Lighting Window - Clear Baked Data (this is in the arrow dropdown which is part of the Generate Lighting button)

  • Now the trees look fine again!

  • Generate lighting again to verify that the terrain tree light probes go black again, you can at this point make a Unity cube marked as static into a prefab and paint a few as ‘Trees’ on the terrain and bake the lighting to see that the probes on the cubes look just fine but not the URP Speedtrees.

–Speedtree 8 warping effect repro

  • Player settings - Set scripting backend to IL2CPP

  • From the Asset Store, import these example speedtrees (or copy the exact same assets from the repro project with this case as the Speedtree files are unmodified) Free SpeedTrees Package | 3D SpeedTree | Unity Asset Store

  • Make a new scene, leave everything as default

  • Set Directional Light to ‘Baked Only’

  • Create a terrain, leave default settings but set width and height to 50 under terrain settings, Lightmapping settings - Scale in lightmap to ‘1’ (so we can see if any shadows bake clearly)

  • Lighting - Lightmapping Settings - Lightmapper - set to GPU (preview)

  • Drag and drop Broadleaf mobile or any other speedtree into the scene

  • Set the tree to 0,0,0 position in the world and tick it as static, tick ‘set children static’ also when asked

  • Set both the material shaders on the speedtree and the LOD models under the speedtree from Nature/Speedtree to Nature/Speedtree8

  • Zoom the camera back/forth to see the warping effect

  • Import URP same as above and make a Pipeline Asset

  • Regenerate the Speedtree materials

  • Set both the material shaders on the speedtree and the LOD models under the speedtree from UniversalRP/Nature/Speedtree to UniversalRP/Nature/Speedtree8

  • Zoom the camera back/forth to see the warping effect

There is an official logged issue for this here, obviously not high enough priority unless it gets some votes. Please vote for it here:

Is this Android only?

Nope, any platform but my reproduction case was for Android

According to this recent video, URP terrain trees do not support light probes (unclear if terrains support them at all):

Seems like a big oversight - at the very least, a “global” light probe should be supported, or a reflection probe (like the skybox). URP terrain trees are pretty ugly without any emulation of bounce-light whatsoever.