/// <summary> /// Render the entity as seen normally, in 3D. /// </summary> /// <param name="context">The render context.</param> public override void RenderStandard(RenderContext context) { foreach (EnableCap ec in DisabledCaps) { GL.Disable(ec); } if (DiffuseTexture != null) { GL.ActiveTexture(TextureUnit.Texture0); DiffuseTexture.Bind(); } context.Engine.Rendering.SetColor(Color, context.Engine.MainView); Matrix4d mat = Matrix4d.Scale(Scale.ToOpenTK3D()) * Matrix4d.CreateFromQuaternion(RenderOrientation.ToOpenTKDoubles()) * Matrix4d.CreateTranslation(RenderAt.ToOpenTK3D()); context.Engine.MainView.SetMatrix(ShaderLocations.Common.WORLD, mat); EntityModel.Draw(); foreach (EnableCap ec in DisabledCaps) { GL.Enable(ec); } }
/// <summary> /// Render the entity as seen normally, in 3D. /// </summary> /// <param name="context">The render context.</param> public override void RenderStandard(RenderContext context) { if (DiffuseTexture != null) { GL.ActiveTexture(TextureUnit.Texture0); DiffuseTexture.Bind(); } context.Engine.Rendering.SetColor(Color4F.White, context.Engine.MainView); Matrix4d mat = Matrix4d.Scale(Scale.ToOpenTK3D()) * Matrix4d.CreateFromQuaternion(RenderOrientation.ToOpenTKDoubles()) * Matrix4d.CreateTranslation(RenderAt.ToOpenTK3D()); context.Engine.MainView.SetMatrix(ShaderLocations.Common.WORLD, mat); Rend.Render(context, true); }