Hi,
I am using Unity 3d / SpeedTree Shader in order to render some vegetation, and I wish to use a custom replacement shader to render the vegetation differently.
So far I can use #include "SpeedTree8Common.cginc" and SpeedTreeVert(v); on my vertex program to render the wind movement.
However, when I try to use MaterialPropertyBlock (on each material) to apply different features for my shader, the wind stops to work.
Here is the function I am currently using to set a new float property to the material
Code:
private void ApplyMyCustomProperty(Renderer renderer)
{
    MaterialPropertyBlock myPropertyBlock = [URL="http://www.google.com/search?q=new+msdn.microsoft.com"]new[/URL] MaterialPropertyBlock();
    renderer.GetPropertyBlock(myPropertyBlock);
    myPropertyBlock.SetFloat("_CustomProperty", 0.75f);
    renderer.SetPropertyBlock(myPropertyBlock, 0);
}

Does anyone know how can I still use the SpeedTree Properties from my material and add a new property?


Sincerely,
Thomas