예제 #1
0
        private static void RenderSystem_Setup()
        {
            Axiom.Graphics.RenderSystem rs = Root.Instance.RenderSystem;

            var colorBlendMode = new LayerBlendModeEx();

            colorBlendMode.blendType = LayerBlendType.Color;
            colorBlendMode.source1   = LayerBlendSource.Texture;
            colorBlendMode.operation = LayerBlendOperationEx.Source1;

            var uvwAddressMode = new UVWAddressing(TextureAddressing.Clamp);

            rs.WorldMatrix      = Matrix4.Identity;
            rs.ViewMatrix       = Matrix4.Identity;
            rs.ProjectionMatrix = Matrix4.Identity;
            rs.SetTextureMatrix(0, Matrix4.Identity);
            rs.SetTextureCoordSet(0, 0);
            rs.SetTextureCoordCalculation(0, TexCoordCalcMethod.None);
            rs.SetTextureBlendMode(0, colorBlendMode);
            rs.SetTextureAddressingMode(0, uvwAddressMode);
            rs.DisableTextureUnitsFrom(1);
            rs.LightingEnabled = false;
            rs.SetFog(FogMode.None);
            rs.CullingMode = CullingMode.None;
            rs.SetDepthBufferParams(false, false);
            rs.SetColorBufferWriteEnabled(true, true, true, false);
            rs.ShadingType = ShadeOptions.Gouraud;
            rs.PolygonMode = PolygonMode.Solid;
            rs.UnbindGpuProgram(GpuProgramType.Fragment);
            rs.UnbindGpuProgram(GpuProgramType.Vertex);
            rs.SetSeparateSceneBlending(SceneBlendFactor.SourceAlpha, SceneBlendFactor.OneMinusSourceAlpha, SceneBlendFactor.One,
                                        SceneBlendFactor.One);
            rs.SetAlphaRejectSettings(CompareFunction.AlwaysPass, 0, true);
        }