Hi,
I am generating a model at runtime and I need to render it.
I am not using GameStudio. I doing everything with code. (CodeOnlySample style)
The below is my code for my game. I am adding a model component to my scene and I am assuming that Xenko will take care of rendering my model. But I am getting blank screen.
Please assume that the model that I am generating has no flaws. Am I missing anything else here? (Like specifying lights, cameras etc…). I really need help here in fixing the issue.
Thanks in advance.
public class DummyGame : Game
{
private Model BuildModel()
{
var model = //// Some model building logic.
return model;
}
protected override async Task LoadContent()
{
await base.LoadContent();
var model = BuildModel();
var modelComponent = new ModelComponent
{
Model = model,
};
var scene = new Scene();
scene.Entities.Add(new Entity { modelComponent });
SceneSystem.SceneInstance = new SceneInstance(Services, scene);
}
}