Search Issue Tracker
By Design
Votes
0
Found in
5.6.4p3
Issue ID
1004733
Regression
No
Surface Shader bug: #pragma hardware_tier_variants generates corrupt UV's
Steps to reproduce:
1. Open attached project "WaterBug.zip"
2. Inspect "SimpleShader_Bug.shader"
3. Uncomment line 19 "#define UNITY_HARDWARE_TIER3 1"
4. Enter play mode and observe. (Might have to intensify the lights a bit depending on the version you open)
5. Checkerboard visible on the plane, moving along built in time value in the shader
6. Go back to "SimpleShader_Bug.shader"
7. Comment the line 19 and enter Play mode again
8. Observe only the red colour showing up, but the UV map is gone, no checkerboard, no animation
Expected: The animation and checkerboard should be visible with the line commented out because technically doing that is not correct behaviour. The line was only added to hardcode a shader variant into the shader to show working versus broken functionality.
Actual: The Edit->Graphics Emulation -> Shader Hardware Tiers are not correctly working, as the user suggested, possibly the UV map is being corrupted
Reproduced on: 5.6.5p2, 2017.1.3p1, 2017.2.2f1, 2017.3.1p2, 2018.1.0b9
Please note from the conversation below:
"As I demonstrated in the initial bug report, the reason this texture is
not displayed is because the the uv-values are not unpacked from the
"v2f_surf" input structure into the "surfIN.uv_MainTex" structure before
calling my surface shader.
So the uv-values passed to my surface shader are invalid:
surfIN.uv_MainTex.x is set to 1.0, and surfIN.uv_MainTex.y is never set so
it is undefined."
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment