This code runs fine under Rhino 6, but under Rhino 7 SimulateMaterial is never called.
Has it been changed since Rhino6?
[Guid("172F5525-1431-3131-8D66-1B15ECE3E541")]
public class MyMaterial : RenderMaterial
{
public override string TypeName => "My Material";
public override string TypeDescription => "My Material";
public override void SimulateMaterial(ref Material simulation, bool isForDataOnly)
{
// code never reaches this ...
}
}
And after checking the assembly I see now a new function:
PhysicallyBasedMaterial SimulatedPhysicallyBasedMaterial(RenderTexture.TextureGeneration tg);
Is it possible to set the physically based simulation for my material too? (this one is not a virtual function)
Just call material.PhysicallyBased.etc to set the values. Renderers that support PBR can choose to do so. Otherwise they will use the base line material…which you set in the normal way.
SimulatedPhysicallyBasedMaterial.will create a PBR guess from the non-PBR simulation.