Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4.10f1
2020.2
Issue ID
1279452
Regression
No
Meshes are not rendered in Game View when replacing certain shaders with Camera.SetReplacementShader and an empty replacementTag
How to reproduce:
1. Open user-submitted project (RenderWithShader.zip)
2. Open the SampleScene
3. Enter Play Mode
4. Click each of the buttons to see the varying results for Camera.SetReplacementShader
Expected result: both cubes are rendered in all 3 scenarios
Actual result: only one cube is rendered(depending on scenario)
Reproducible with: 2018.4.27f1, 2019.4.11f1, 2020.1.6f1, 2020.2.0b3
Notes:
The 3 buttons in Game View cause the following results:
1) Cube is using [Particles/Standard Unlit] shader. SetReplacementShader([Standard], null) is called. Cube is no longer being rendered in Game View(but it appears in Frame Debugger under LoopRenderJob)
2) Cube is using [Particles/Standard Unlit] shader. SetReplacementShader([Unlit/Color], null) is called. Cube is no longer being rendered in Game View and does NOT appear under RenderLoopJob in Frame Debugger.
3) Cube is using [Standard] shader. SetReplacementShader([Particles/Standard Unlit], null) is called. Cube is no longer being rendered in Game View(but it appears in Frame Debugger under LoopRenderJob
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
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Different text alignment in the column header in Entities "System" window
- Objects with Universal Render Pipeline/Particles/Lit shader are always lit up when changing their Rendering Layer Mask
Resolution Note (2021.1.X):
Cases 1 and 3 are rendered properly if the Camera clear flags are not set to Skybox. This is due to objects being rendered with a different render queue after setting the replacement shader (Opaque vs Transparent).
In case 2 the original material (Particles/Standard Unlit) explicitly disables rendering pass "Always", which is the only pass available in the replacement shader.