Esempio n. 1
0
        public void RenderBlade(Matrix4 VP, float x, float y, float z, float zRot, float[] heat, Vector3 eyePos)
        {
            Matrix4     modelspace = Type.MeshScaleMatrix * Matrix4.CreateRotationZ(zRot) * Matrix4.CreateTranslation(x, y, z);
            BladeShader Instance   = BladeShader.Instance;

            Instance.Bind();
            Instance.SetModelspaceMatrix(modelspace);
            Instance.SetMVP(modelspace * VP);
            Instance.SetColor(KnownMetal.GetColor(Metal));
            UpdateHeatMap(heat);
            Instance.SetMaps(sharpnessMap, heatMap);
            Instance.SetEyePos(eyePos);
            Type.Mesh.Draw();

            BasicShader Instance0 = BasicShader.Instance;

            Instance0.Bind();
            for (int i = 0; i < Type.Points.Length; i++)
            {
                Matrix4 diamondModelspace = Matrix4.CreateTranslation(Type.Points [i], -0.15f + (float)Math.Sin(Time.CurrentTime() * 4 + Type.Points [i] * Util.PI) * 0.03f, 0) * modelspace;
                Instance0.SetModelspaceMatrix(diamondModelspace);
                Instance0.SetMVP(diamondModelspace * VP);
                Instance0.SetColor(Sharpness[i] < 0.95f?diamondColor * (1 - Sharpness[i]) + sharperDiamondColor * Sharpness[i]:sharpDiamondColor);
                MeshCollection.Diamond.Draw();
            }
        }
Esempio n. 2
0
        public override void RenderItem(float x, float y, float width, float height)
        {
            BladeShader Instance = BladeShader.Instance;

            Instance.Bind();
            Instance.SetMVP(OrthoRenderEngine.GetMVPForMesh(Type.CenteredScaledMeshMatirx * ItemMatrix, x + 4, y + 4, width - 8, height - 8));
            Instance.SetModelspaceMatrix(OrthoRenderEngine.DefaultModelspace);
            Instance.SetColor(KnownMetal.GetColor(Metal));
            Instance.SetMaps(sharpnessMap);
            Type.Mesh.Draw();
        }