World = unity_ObjectToWorld ?

View = UNITY_MATRIX_MV ?

Projection = UNITY_MATRIX_VP ?

I surmise the connection above,is it right?

And about the matrix multipliy,I find it is common in Unity shader to place the matrix before the value being transformed.

So should the order be :

Yours: float4 worldPosition = mul(input.Position, World);

I guess in Unity: float4 worldPosition = mul(unity_ObjectToWorld ,input.Position);

Yours : output.Normal = normalize(mul(input.Normal, World));

I guess in Unity : I don’t know.

Yours float4 viewPosition = mul(float4(vPos, worldPosition.w), View);

I guess in Unity: float4 viewPosition = mul(UNITY_MATRIX_MV ,float4(vPos, worldPosition.w));

Yours: output.Position = mul(viewPosition, Projection);

I guess in Unity: output.Position = mul(UNITY_MATRIX_VP ,viewPosition);

I know I didn’t did it right,because I result is wrong.Could you please correct my mistakes?

Thanks!

Check the shader disassembly to ensure that logic hasn’t been compiled out for some reason. And make sure the plant’s up vector is the y-axis, WindSpeed is a good value, and BendScale is appropriate for the size of the plant.

]]>