Updating Materials after Initialized
#2
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:
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
  


Messages In This Thread
Updating Materials after Initialized - by siik - 11-22-2021, 11:41 AM
RE: Updating Materials after Initialized - by abenedik - 11-22-2021, 01:33 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)