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.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Add comment