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.
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
- ResolveUsePasses now extracts passes from all subshaders including fallbacks, in contrast to documented behaviour
- [UIBuilder] Changes aren't detected on types implementing IList
- [HDRP] Text is rendered with artefacts when using STP and resolution scale is set a float value
- [Settings Search] Search results not always matching search term correctly
- Crash on memcpy when opening a project that loads TSS files
shubhamswaraj2021
Aug 21, 2020 05:51
good one <a href="https://www.lyricsauto.com">lyricsauto</a>