public override void Initialize() { base.Initialize(); Mesh mesh = MeshBuilder.CreateAxis(Engine.GraphicsDevice); base.AddMesh(mesh); BasicMaterial material = new BasicMaterial(Engine); base.AddMaterial(material); RenderContext ctx = new RenderContext(Engine); ctx.Material = material; ctx.Mesh = mesh; base.AddRenderContext(ctx); BasicEffect eff = material.EffectInstance as BasicEffect; eff.VertexColorEnabled = true; }
public override void Initialize() { base.Initialize(); Mesh mesh = MeshBuilder.CreateQuad(Engine.GraphicsDevice); base.AddMesh(mesh); BasicMaterial material = new BasicMaterial(Engine); base.AddMaterial(material); RenderContext ctx = new RenderContext(Engine); ctx.Mesh = mesh; ctx.Material = material; base.AddRenderContext(ctx); material.DiffuseTextureName = "Textures\\grid"; material.DiffuseColor = new Vector3(0.0f, 1.0f, 0.0f); material.SpecularColor = new Vector3(1.0f, 1.0f, 1.0f); material.SpecularPower = 50; }
public Box(PipeEngine engine) : base(engine) { m_ctx = new RenderContext(engine); }
public virtual int AddRenderContext(RenderContext ctx) { render_contexts.Add(ctx); return render_contexts.Count - 1; }