11-22-2021, 01:33 PM
One DXEngine's material can be assigned to one WPF's material.
For your use case, you would need two WPF materials and two DXEngine materials and then change the Material from one WPF's material to another, for example:
For your use case, you would need two WPF materials and two DXEngine materials and then change the Material from one WPF's material to another, for example:
Code:
var pbrMaterial = new PhysicallyBasedMaterial() { /* ... */ };
var vertexColorMaterial = new VertexColorMaterial() { /* ... */ };
var wpfPbrMaterial = new DiffuseMaterial();
wpfPbrMaterial.SetUsedDXMaterial(pbrMaterial);
var wpfVertexColorMaterial = new DiffuseMaterial();
wpfVertexColorMaterial.SetUsedDXMaterial(vertexColorMaterial);
// Use PBR material
geometryModel3D.Material = wpfPbrMaterial;
// Change to VertexColorMaterial:
geometryModel3D.Material = wpfVertexColorMaterial;
Andrej Benedik

