Search Issue Tracker
Won't Fix
Votes
0
Found in
5.3.4p5
Issue ID
803610
Regression
No
[Shaders] SetFloat can not be set for arrays in shaders
Steps to reproduce:
1. open users attached project
2. play scene
Expected: sphere blue
Actual: sphere black
Reproduced: 5.4.0b21
Not reproducible: 5.3.5p1
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
- [OpenGLES][XR] Zooming in on the camera's URP opaque texture causes "double vision" on Quest in OpenGLES3
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
Duno
Aug 24, 2017 15:10
Can we have SetFloatArray in the future for compute shaders also ?
Aras
Sep 29, 2016 10:01
The workaround in Unity 5.3 and earlier is to use float4 arrays. The HLSL shader compiler internally turns arrays of floats into arrays of float4's anyway.
Since Unity 5.4, arrays in shaders are accessed differently - there are actual material.SetFloatArray etc. functions. This works as expected:
material.SetFloatArray("_myarray", new float[]{0.8f,0.5f,0.3f});