public override void PostRender(Scene s, Matrix4 VP) { if (game.GameStats.CastFilling > 0 && game.GameStats.CurrentCast != null && game.GameStats.CastMetal > -1) { UpdateCastMatrix(); Matrix4 fillModelspace = Matrix4.CreateScale(1, 1, game.GameStats.CastFilling * game.GameStats.CurrentCast.FillHeight) * fillMatrix * Modelspace; ISimpleShader shader; if (game.GameStats.CastingTemprature > 25) { shader = LiquidShader.Instance; shader.Bind(); LiquidShader.Instance.UseTexture(); LiquidShader.Instance.AutoPan(); LiquidShader.Instance.SetEmission(Util.DefaultEmission); } else { shader = BasicShader.Instance; shader.Bind(); } shader.SetModelspaceMatrix(fillModelspace); shader.SetMVP(fillModelspace * VP); shader.SetColor(KnownMetal.GetColor(game.GameStats.CastMetal)); fill.Draw(); } if (game.TooltipHelper.GetOwner() == this) { game.TooltipHelper.RenderNormalDialog(Input.OrthoMouseX, Input.OrthoMouseY, Util.White60); } }
public override void PostRender(Scene s, Matrix4 VP) { ColorShader.Instance.Bind(); ColorShader.Instance.SetMVP(Modelspace * VP); coalColor.X = coalColor.Y = coalColor.Z = 1.3f + (float)Math.Sin(Time.CurrentTime() * 2) / 6; ColorShader.Instance.SetColor(coalColor); Coal.Draw(); }
public override void Render(Scene s, Matrix4 VP, INormalShader shader) { base.Render(s, VP, shader); shader.SetModelspaceMatrix(doorModelspace); shader.SetMVP(doorModelspace * VP); door.Draw(); }
public override void Render(Scene s, Matrix4 VP, INormalShader shader) { shader.SetModelspaceMatrix(Modelspace); shader.SetMVP(Modelspace * VP); hatchHole.Draw(); shader.SetModelspaceMatrix(hatchTransform * Modelspace); shader.SetMVP(hatchTransform * Modelspace * VP); hatch.Draw(); }
public override void Render(Scene s, Matrix4 VP, INormalShader shader) { shader.SetModelspaceMatrix(Modelspace); shader.SetMVP(Modelspace * VP); box.Draw(); shader.SetModelspaceMatrix(lidModelMatrix); shader.SetMVP(lidModelMatrix * VP); lid.Draw(); }
public override void Render(Scene s, Matrix4 VP, INormalShader shader) { shader.SetModelspaceMatrix(bellowModelspace); shader.SetMVP(bellowModelspace * VP); bellow.Draw(); shader.SetModelspaceMatrix(Modelspace); shader.SetMVP(Modelspace * VP); rig.Draw(); }
public static void DrawColoredMesh(Mesh mesh, Matrix4 matrix, Vector4 color, float x, float y, float width, float height) { BasicShader.Instance.Bind(); BasicShader.Instance.SetMVP(matrix * Matrix4.CreateScale(width / orthoWidth, height / orthoHeight, 0.9f) * Matrix4.CreateTranslation((width + 2 * x) / orthoWidth - 1, (height + 2 * y) / orthoHeight - 1, 0)); BasicShader.Instance.SetModelspaceMatrix(DefaultModelspace); BasicShader.Instance.SetColor(color); mesh.Draw(); }
public override void PostRender(Scene s, Matrix4 VP) { if (game.GameStats.FoundryAlloy.Amount >= 0.01f) { Matrix4 m = Matrix4.CreateScale(1, 1, game.GameStats.FoundryAlloy.Amount) * liquidTransform * Modelspace; ISimpleShader shader; if (game.GameStats.FoundryTemprature > game.GameStats.FoundryAlloy.GetMeltingPoint()) { shader = LiquidShader.Instance; shader.Bind(); LiquidShader.Instance.UseTexture(); LiquidShader.Instance.AutoPan(); LiquidShader.Instance.SetEmission(Util.DefaultEmission); } else { shader = BasicShader.Instance; shader.Bind(); } shader.SetModelspaceMatrix(m); shader.SetMVP(m * VP); shader.SetColor(game.GameStats.FoundryAlloy.GetColor()); molten.Draw(); } if (game.GameStats.CastFilling > 0 & game.GameStats.CastFilling <1 & game.GameStats.CastMetal> -1) { LiquidShader shader = LiquidShader.Instance; shader.Bind(); shader.SetModelspaceMatrix(Modelspace); shader.SetMVP(Modelspace * VP); shader.SetColor(KnownMetal.GetColor(game.GameStats.CastMetal)); shader.UseTexture(); shader.AutoPan(); shader.SetEmission(Util.DefaultEmission); fall.Draw(); } if (game.TooltipHelper.GetOwner() == this) { game.TooltipHelper.RenderNormalDialog(Input.OrthoMouseX, Input.OrthoMouseY, Util.White60); } }
public void RenderView(Matrix4 VP, Scene s) { blade.RenderBlade(VP, Pos.X, Pos.Y - (diamond < 0?-0.6f:blade.Type.Points[diamond] * blade.Type.MeshScale), height, Util.PI / 2, heat, GetEyePos()); BasicShader shader = BasicShader.Instance; shader.Bind(); Matrix4 modelspace = Matrix4.CreateTranslation(0, 1, 0) * Matrix4.CreateRotationX(-hammerMove) * Matrix4.CreateTranslation(0, 2.5f + hammerY * hammerMove / 4, 0) * Matrix4.CreateRotationX(0.9f - hammerMove) * Matrix4.CreateRotationZ(0.7f + hammerX * hammerMove / 4) * Matrix4.CreateTranslation(1.9f, -2.4f, height + 1) * Modelspace; shader.SetMVP(modelspace * VP); shader.SetModelspaceMatrix(modelspace); shader.ResetColor(); hammer.Draw(); OrthoRenderEngine.DrawExtendedColoredTexturedBox(TextureCollection.DialogBG, Util.White, 50, 50, 250, 250); OrthoRenderEngine.DrawColoredMesh(table.Mesh, projection, Util.White, 50, 50, 250, 250); OrthoRenderEngine.DrawColoredMesh(table.Coal, projection, Util.White, 50, 50, 250, 250); }
public override void Draw(Scene s) { Mesh.Draw(); }
public static void DrawColorOnEntireScreen(Vector4 color) { ColorShader.Instance.Bind(); ColorShader.Instance.SetMVP(allScreen * orthoMatrix); ColorShader.Instance.SetColor(color); Flat.Draw(); }