Search Issue Tracker
Fixed in 7.2.0
Votes
6
Found in [Package]
7.1.1
Issue ID
1185948
Regression
Yes
[URP] [Terrain] Shader exception is thrown on creating Terrain game object with URP Template.
Shader exception is thrown on creating Terrain game object with URP Template.
How to reproduce:
1. Create a new project with URP Template.
2. GameObject > 3D > Terrain.
OR
1. Create a new project using URP
2. In the Project view, navigate to Packages/Universal RP/Shaders/Terrain
3. Reimport the "TerrainLitBase" shader
Expected results: The shader successfully compiles
Actual results: The shader does not compile and throws an "unrecognized identifier 'Varyings'" error
Reproducible with:
URP 7.1.6, 7.1.5, 7.1.1 (209.3.0f3, 2019.3.0b4, 2020.1.0a5)
Not reproducible with:
URP 7.0.1 (2019.3.0b4, 2020.1.0a5),
LWRP 6.9.1 (2019.2.7f1)
Comments (3)
-
Randolin
Jan 07, 2020 06:05
I ran into this with 7.1.7 URP on Unity 2019.3.0f3 while setting up a new project with a 2D Renderer. The issue was with TerrainLitMetaPass.hlsl in this case.
I don't claim to even remotely understand the inner workings of the URP or shader code; however, I was able to resolve it (at least superficially) by adding in definitions for Varyings and Attributes. I used LitMetaPass, SimpleLitMetaPass and BakedLitMetaPass as a point of reference in the parent folder:
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
#ifdef _TANGENT_TO_WORLD
float4 tangentOS : TANGENT;
#endif
};struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};Once these were declared in the file above the methods that required those definitions, it no longer throws a console error and might even work.
Maybe this will help someone.
-
grasski
Dec 03, 2019 19:12
I have also this issue. Can not work with it, Unity everytime crash! :(
7.1.6 URP and Unity 2020.1.0a.14, also had in 2019.3.0f1
-
Ghosthowl
Dec 01, 2019 14:31
I am also having this issue with 7.1.6 URP - 2019.3.0f1. Currently I have no idea how to solve it.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
- Hovering on the three-dot menu also highlights the tab header near it when not all tabs fit the bar
Resolution Note (fix version 7.2.0):
Fixed in URP 7.2.0