[1354] The color change using MaterialPropertyBlock from Udonsharp does not seem to be working.
complete
みみー/Mimy
The color change using MaterialPropertyBlock from Udonsharp does not seem to be working.
In one pen gimmick, the color of the pen mesh changes along with the ink color of the pen, but only the pen mesh does not change color and everything is displayed white.
The Live Client player who was in the same instance seemed to see the pen mesh color change as normal.
Log In
StormRel
complete
This post was marked as
available in future release
TCL
Is this still an issue? If so, do you have a world with the issue?
みみー/Mimy
TCL: I have determined that the problem is being caused by the initialization of shader property ID.
The script in question was initializing them via Shader.PropertyToID() at the same time it was declaring the variable in the field.
Currently, the VRChat client is running on Unity2022. However, the VRCSDK is still running on Unity2019.
The shader property ID value in the case is initialized on the Unity2019 editor, but this value seems to be different in Unity2022.
By using VRCShader.PropertyToID() and reinitializing the variable in Start(), the color changing gimmick works again.
Based on the above, I believe that this problem will naturally be resolved when the VRCSDK supports the Unity2022 editor.
-----------------------------------------------------------
この問題がシェーダープロパティIDの初期化によって引き起こされていることを突き止めました。
問題のスクリプトでは、フィールドに変数を宣言すると同時にShader.PropertyToID()によって初期化を行っていました。
現在、VRChatのクライアントはUnity2022で動いています。しかしVRCSDKはまだUnity2019で動いています。
件のID値はUnity2019エディター上で初期化されますが、この値はUnity2022では異なる値になるようです。
VRCShader.PropertyToID()を使い、Start()内で変数を再初期化する事で、色替えギミックが再び動くようになりました。
以上の事から、VRCSDKがUnity2022エディターに対応する事で、この問題は自然と解決すると考えられます。
StormRel
tracked