コード例 #1
0
        public override void ApplyMaterial(Material material)
        {
            base.ApplyMaterial(material);

            this.SetUniform(MATERIAL_AMBIENTCOLOR, material.GetVector4f(Material.COLOR_AMBIENT));
            this.SetUniform(MATERIAL_DIFFUSECOLOR, material.GetVector4f(Material.COLOR_DIFFUSE));
            this.SetUniform(MATERIAL_SPECULARCOLOR, material.GetVector4f(Material.COLOR_SPECULAR));
            this.SetUniform(MATERIAL_SHININESS, material.GetFloat(Material.SHININESS));
            this.SetUniform(MATERIAL_ROUGHNESS, material.GetFloat(Material.ROUGHNESS));
            this.SetUniform(MATERIAL_SPECULARTECHNIQUE, material.GetInt(Material.TECHNIQUE_SPECULAR));
            this.SetUniform(MATERIAL_SPECULAREXPONENT, material.GetFloat(Material.SPECULAR_EXPONENT));
            this.SetUniform(MATERIAL_PERPIXELLIGHTING, material.GetInt(Material.TECHNIQUE_PER_PIXEL_LIGHTING));
        }
コード例 #2
0
ファイル: Shader.cs プロジェクト: ajmd17/apexengine-sharp
        public virtual void ApplyMaterial(Material material)
        {
            currentMaterial = material;

            RenderManager.Renderer.SetDepthTest(currentMaterial.GetBool(Material.MATERIAL_DEPTHTEST));
            RenderManager.Renderer.SetDepthMask(currentMaterial.GetBool(Material.MATERIAL_DEPTHMASK));

            if (currentMaterial.GetBool(Material.MATERIAL_CULLENABLED))
            {
                RenderManager.Renderer.SetCullFace(true);
                int i = currentMaterial.GetInt(Material.MATERIAL_FACETOCULL);
                if (i == 0)
                    RenderManager.Renderer.SetFaceToCull(Renderer.Face.Back);
                else if (i == 1)
                    RenderManager.Renderer.SetFaceToCull(Renderer.Face.Front);
            }
            else
                RenderManager.Renderer.SetCullFace(false);

            SetUniform(MATERIAL_ALPHADISCARD, currentMaterial.GetFloat(Material.MATERIAL_ALPHADISCARD));
        }