Search Issue Tracker
Fixed
Votes
0
Found in
5.2.1f1
Issue ID
740219
Regression
No
[Shaders] hlsl2glsl resolves some function overloads differently from HLSL, mostly with mixed vector types
User wrote a custom shader for particles. I use distance() to measure a pixel's UV distance with the particle center. This works fine in editor, and on PC and webplayer builds. However, it does not work in WebGL (Firefox 41.0.2). Replacing the calculation with length() works.
Repro:
--Open the Main.unity scene and play it in the editor
--you should see the white particles
--Make a WebGL build
--play it in browser
--NOTICE that the particles are not rendering and no error or warning is thrown
The problem seems to be in shader code that does "distance(uv, float2(0.5,0.5))", with uv being a float4 - hlsl2glsl shader translator picks a float4 overload, whereas actual HLSL compiler picks a float2 overload. Changing code to "distance(uv.xy, float2(0.5,0.5))" fixes the issue.
Comments (1)
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
- TreeView drag and drop operation is not cancelled when a modal opens over it
- Remote Config window causes performance drop in Editor when multiple settings are added
- Property field override bar does not update transparency correctly when switching between valid and invalid GameObjects
- Project window selection is not updated when search term is changed
- Error when adding valid MonoBehaviour script to Prefab in Project window
shubhamswaraj2021
Aug 21, 2020 05:51
good one <a href="https://www.lyricsauto.com">lyricsauto</a>