Exemple #1
0
        public static void DrawConeForLight(MyEffectPointLight effect, MatrixD worldMatrix)
        {
            MatrixD worldViewProjMatrix;
            MatrixD.Multiply(ref worldMatrix, ref MyRenderCamera.ViewProjectionMatrixAtZero, out worldViewProjMatrix);

            Matrix worldViewProjMatrix2 = (Matrix)worldViewProjMatrix;
            effect.SetWorldViewProjMatrix(ref worldViewProjMatrix2);
            Matrix worldMatrix2 = (Matrix)worldMatrix;
            effect.SetWorldMatrix(ref worldMatrix2);

            effect.Begin();

            MyPerformanceCounter.PerCameraDrawWrite["Light draw calls"]++;
            ModelCone.Render();

            effect.End();
        }
Exemple #2
0
        public static void DrawHemisphereForLight(MyEffectPointLight effect, ref MatrixD worldMatrix, ref Vector3 diffuseColor, float alpha)
        {
            MatrixD worldViewProjMatrix;
            MatrixD.Multiply(ref worldMatrix, ref MyRenderCamera.ViewProjectionMatrixAtZero, out worldViewProjMatrix);

            Matrix worldViewProjMatrix2 = (Matrix)worldViewProjMatrix;
            Matrix worldMatrix2 = (Matrix)worldMatrix;
            effect.SetWorldViewProjMatrix(ref worldViewProjMatrix2);
            effect.SetWorldMatrix(ref worldMatrix2);

            effect.Begin();

            MyPerformanceCounter.PerCameraDrawWrite["Light draw calls"]++;
            ModelHemisphereLowRes.Render();

            effect.End();
        }