Search Issue Tracker
By Design
Votes
0
Found in
2022.3.37f1
6000.0.11f1
Issue ID
UUM-76222
Regression
No
Shader vector material array doesn't get set on macOS and iOS devices
How to reproduce:
1. Open the “IN_79926” project
2. Build the project on the mobile device
3. In the Player press on one of the characters and double tap in the black spot (the character should start walking towards the pointed direction)
4. Observe the Player
Expected result: Shader vector calculated correctly and the area around the player is green
Actual result: Shader vector calculated incorrectly and the area around the player is dark
Reproducible with: 2022.3.37f1, 6000.0.11f1
Couldn’t test with: 2021.3.40f1 (errors in the Xcode)
Reproducible on:
macOS Sonoma 14.5 (editor and player)
VLNQA00297, iPhone 11 Pro
VLNQA00357, iPhone 12 Mini
VLNQA00536, iPad 8th Gen (Wifi)
Not reproducible with:
Windows 11 (editor) (user reported)
VLNQA00321, Xiaomi MI 9 (MI 9), Android 10, CPU: Snapdragon 855 SM8150, GPU: Adreno (TM) 640
VLNQA00120, Google Pixel 2 (Pixel 2), Android 8.1.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00363, Samsung Galaxy Z Fold2 5G (SM-F916B), Android 11, CPU: Snapdragon 865 SM8250, GPU: Adreno (TM) 650
Notes:
- Not reproducible on the Android player
- User mentioned it was not reproducible in the editor and Standalone player but I managed to reproduce it
-
thomas642daniel
Jul 19, 2024 10:18
Debugging with Xcode errors in Xcode with version 2021.3.40f1, try to resolve those errors first.
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
- Spot Light with 'Box' Shape stops working when it collides with Mesh
- Accepting Asset Store EULA endless loop in Package Manager window
- “InvalidOperationException: Sequence contains no matching element“ error when reenabling a custom Debug Draw Mode
- Prefab that contains a layout group is marked as changed by the Editor when opened
- Emission animation does not appear when the "Emission Map" parameter is set to black in a Lit material
Resolution Note:
Data in arrays in shaders is packed differently from what people normally expect. Each element is aligned to float4.
In your case, the point array is filled like this:
point0x, point0y, point1x, point1y, poin2x, point2y and so on.
But what the shader reads is:
point0x, point0y, point2x, point2y, point4x, point4y and so on.
The shader ends up reading data from a different location.
Declare both arrays as float4[512] and select the appropriate channels manually:
for (uint i = 0; i < _PointCount / 2; i++) {
cdist = min(cdist, distance(pa[i].xy*_Scale, uv));
cdist = min(cdist, distance(pa[i].zw*_Scale, uv));
}