Search Issue Tracker
Fixed in 2021.3.26f1
Fixed in 2021.3.X, 2022.2.X, 2023.1.X, 2023.2.X, 2023.2.0a1
Votes
0
Found in
2020.3.44f1
2021.3.16f1
2022.2.2f1
2023.1.0a25
2023.2.0a1
Issue ID
UUM-22593
Regression
No
[Metal] Shader is broken when using SV_PrimitiveID
How to reproduce:
1. Open the attached project "Metal PrimitiveID Bug" and load Scene "ReproScene"
2. Observe the Scene
Expected result: The Shader of the Cube in the Scene appears as intended
Actual result: The Shader of the Cube is broken
Reproducible with: 2020.3.44f1, 2021.3.16f1, 2022.2.2f1, 2023.1.0a25
Reproduced on:
- MacOS (Intel) Editor
Notes:
- The issue does not reproduce when using OpenGLCore as the Graphics API
Comments (2)
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
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
flyer19
Mar 06, 2024 05:42
using unity 2023.2.11f1
flyer19
Mar 06, 2024 05:40
DS_Output DS( HS_ConstantOutput HSConstantData,
const OutputPatch<HS_ControlPointOutput, 3> Input,
float3 BarycentricCoords : SV_DomainLocation,uint idTriangle : SV_PrimitiveID )
{
DS_Output Output = (DS_Output)0;
float fU = BarycentricCoords.x;
float fV = BarycentricCoords.y;
float fW = BarycentricCoords.z;
float3 pos = Input[0].pos * fU + Input[1].pos * fV + Input[2].pos * fW;
float2 uv=Input[0].uv * fU + Input[1].uv * fV + Input[2].uv * fW;
Output.uv=uv+idTriangle;
Output.pos = UnityObjectToClipPos (float4(pos.xyz,1.0));
return Output;
}
using idTriangle still not work