Пример #1
0
        public sealed override void SetupMaterial(MyEffectBase shader, MyRenderMeshMaterial material)
        {
            System.Diagnostics.Debug.Assert(material != null);

            shader.SetEmissivity(0);

            MyRender.CheckTextures(shader, material.NormalTexture, material.DrawTechnique == MyMeshDrawTechnique.HOLO);
        }
Пример #2
0
        public sealed override void SetupMaterial(MyEffectBase shader, MyRenderMeshMaterial material)
        {
            System.Diagnostics.Debug.Assert(material != null);

            shader.SetTextureDiffuse(material.DiffuseTexture);
            shader.SetTextureNormal(material.NormalTexture);

            shader.SetSpecularIntensity(material.SpecularIntensity);
            shader.SetSpecularPower(material.SpecularPower);

            shader.SetDiffuseUVAnim(material.DiffuseUVAnim);
            shader.SetEmissivityUVAnim(material.EmissiveUVAnim);

            shader.SetEmissivityOffset(material.EmissivityOffset);

            ((MyEffectModelsDNS)shader).EnableColorMaskHsv(material.DiffuseTexture != null ? material.EnableColorMask : false);
            ((MyEffectModelsDNS)shader).SetDitheringTexture((SharpDX.Direct3D9.Texture)MyTextureManager.GetTexture <MyTexture2D>(@"Textures\Models\Dither.png"));
            ((MyEffectModelsDNS)shader).SetHalfPixel(MyRenderCamera.Viewport.Width, MyRenderCamera.Viewport.Height);

            // TODO: Petrzilka - Get rid of this branching
            if (material.DrawTechnique == MyMeshDrawTechnique.HOLO)
            {
                shader.SetEmissivity(material.HoloEmissivity);
            }

            if (material.Emissivity.HasValue)
            {
                shader.SetEmissivity(material.Emissivity.Value);
            }
            else
            {
                shader.SetEmissivity(0);
            }

            MyRender.CheckTextures(shader, material.NormalTexture, material.DrawTechnique == MyMeshDrawTechnique.HOLO);
        }