3D 对象的材质
当我尝试使用 WPF 的 3D 支持时,我想尝试 3d 对象材质类型的不同选项,因此首先我创建了一个简单的场景,只有一个三角形(渲染正常)
<Viewport3D>
<Viewport3D.Camera>
<PerspectiveCamera Position="-2,2,2" LookDirection="2,-2,-2" UpDirection="0,1,0" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="White" Direction="-1,-1,-1" />
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-1,0,0 0,1,0 1,0,0" TriangleIndices="0,2,1" />
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Yellow" />
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
: 时,不再渲染
<SpecularMaterial Brush="Yellow" Color="Yellow" SpecularPower="24" />
当我将 GeometryModel3D.Material 更改为另一种材质(例如或)
<EmissiveMaterial Brush="Yellow" ></EmissiveMaterial>
,这是为什么?我应该使用不同的灯光来使镜面或发射材质发挥作用吗?
As I was playing around with the WPF's 3D support, I wanted to try different options for the 3d objects material types, so at first I created a simple scene, with just a triangle (which is rendered ok):
<Viewport3D>
<Viewport3D.Camera>
<PerspectiveCamera Position="-2,2,2" LookDirection="2,-2,-2" UpDirection="0,1,0" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="White" Direction="-1,-1,-1" />
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-1,0,0 0,1,0 1,0,0" TriangleIndices="0,2,1" />
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Yellow" />
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
But it seems that the triangle is no longer rendered when I changed the GeometryModel3D.Material to another material like
<SpecularMaterial Brush="Yellow" Color="Yellow" SpecularPower="24" />
or
<EmissiveMaterial Brush="Yellow" ></EmissiveMaterial>
Why is that? should I be using different lights for the specular or emissive materials to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发射材料不能单独工作,需要与其他材料结合使用。举例来说:
Emissive material does not work by its own, use it in combination with other materials. As for example: