我有一个非常简单的场景(照常设置相机,灯光)。我想在模型上应用简单的图像材料。如果使用Sphere
之类的便利模型之一,则该对象将使用正确的材质进行渲染:
var model = modelNode.CreateComponent<Sphere>();
model.SetMaterial(Material.FromImage("Textures/small.jpg"));
如果我切换到static model(这是Blender的默认多维数据集),则没有任何渲染(或者可能渲染为不可见)。使用彩色材料,它可以正常工作,因此对于模型本身毫无疑问。
var model = modelNode.CreateComponent<StaticModel>();
model.Model = ResourceCache.GetModel("Models/Cube.mdl", false);
//model.SetMaterial(CoreAssets.Materials.DefaultGrey);
//model.SetMaterial(Material.FromColor(Color.Yellow));
model.SetMaterial(Material.FromImage("Textures/small.jpg"));
作为参考,其余场景为:
scene = new Scene();
octree = scene.CreateComponent<Octree>();
var cameraNode = scene.CreateChild();
cameraNode.Position = new Vector3(0, 0, -10);
cameraNode.SetDirection(new Vector3(0, 0, 0));
camera = cameraNode.CreateComponent<Camera>();
var lightNode = cameraNode.CreateChild();
lightNode.Position = new Vector3(5, 5, -5);
lightNode.SetDirection(new Vector3(0, 0, 0));
var light = lightNode.CreateComponent<Light>();
light.LightType = LightType.Directional;
light.Brightness = 1.5f;
light.CastShadows = true;
light.Color = Color.White;
light.Range = 10;
答案 0 :(得分:0)
嗯,模型没有导出所有必要的细节...