Search Issue Tracker
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.
- Prefab's Transform Position and Rotation are always highlighted even after Applying changes
- [Regression] Clicking Collab window tab while it's open reopens it instead of closing
- LWRP shadow pass doesnt support alpha clip
- [iOS 12] Xcode reports ~4 times higher memory usage on iOS 12 compared to iOS 11
- [iOS] [XR] Device with iOS 8 and iOS 9 hangs when using XRSettings.LoadDeviceByName()