08-12-2025, 11:42 AM
Hi. Really impressed with what I'm seeing with this.
I'm trying to apply lighting to my view. It has one point light in it. A sphere node with a specular material will reflect the light correctly.
How do I do this with a standard mesh? If I create a cube, with all the texture normals facing the correct way, the colour of the mesh is uniform no matter which direction I view it from. The light has no effect on the texture colour. There is no ambient light in my view. What am I missing?
StandardMesh? standardMesh = new StandardMesh(ArrayPositionNormalTextureVertex, ArrayVertexInts, name: "StandardMesh");
var specularMaterial = new StandardMaterial(Colors.Silver)
{
SpecularPower = 16,
SpecularColor = Colors.Silver
};
MeshModelNode? roofMeshModelNode = new MeshModelNode(standardMesh, specularMaterial, name: "SampleMeshModel");
roofMeshModelNode.BackMaterial = specularMaterial;
sharpEngineSceneView.Scene.RootNode.Add(roofMeshModelNode);
I'm trying to apply lighting to my view. It has one point light in it. A sphere node with a specular material will reflect the light correctly.
How do I do this with a standard mesh? If I create a cube, with all the texture normals facing the correct way, the colour of the mesh is uniform no matter which direction I view it from. The light has no effect on the texture colour. There is no ambient light in my view. What am I missing?
StandardMesh? standardMesh = new StandardMesh(ArrayPositionNormalTextureVertex, ArrayVertexInts, name: "StandardMesh");
var specularMaterial = new StandardMaterial(Colors.Silver)
{
SpecularPower = 16,
SpecularColor = Colors.Silver
};
MeshModelNode? roofMeshModelNode = new MeshModelNode(standardMesh, specularMaterial, name: "SampleMeshModel");
roofMeshModelNode.BackMaterial = specularMaterial;
sharpEngineSceneView.Scene.RootNode.Add(roofMeshModelNode);

