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.
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.
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
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.