ara I don't know what operation had already be done before entering VertexOutputLWRP ForwardPassVertexSprite(VertexInput input)
I want to find out what's the intermediate step between c# Slot.SetColor() and VertexInput.color.
All source code is provided. Please have a look at MeshGenerator.cs
then. Anyway, you will find out that it's normal float values that are assigned there.
It's most likely in the vertex shader where you are losing precision, at some point in the line
output.vertexColor = calculateVertexColor(input.color);
So either you didn't change output.vertexColor
(which is VertexOutputLWRP.vertexColor
), input.color
(VertexInput.color
), or fixed4 calculateVertexColor(fixed4 color)
.
Note that VertexOutputLWRP
also uses fixed4
at the vertexColor
property.
EsotericSoftware/spine-runtimesblob/4.0/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl#L16
If you are still having troubles, you could simply replace the define
-section in Spine-Sprite-URP.shader to define both fixed and half as float:
#define fixed4 float4
#define fixed3 float3
#define fixed float
#define half4 float4
#define half3 float3
#define half float
ara Maybe the vertex inputs such as position (float4) and color (float4) are automatically converted to half4 data type during the shader compilation process?
No. You can always look at the generated output of the shader, (especially the pre-processed output) there you can see the resulting types after any preprocessor-defines have been inlined.
In general I would highly recommend opening the shader directories with Visual Studio Code and just searching through the files, then you should quickly find the relevant code sections.