예제 #1
0
        public void Apply(int pass)
        {
            var texture = ShaderPrograms.ColorfulTextShaderProgram.GradientRampTexture;

            if (texture == null || texture.IsStubTexture)
            {
                var warningText = "GradientMap texture doesnt exist at './Data/Fonts/GradientMap.png' If you want to use it, create it and dont forget cooking rule file to disable texture atlas for it.";
#if DEBUG
                throw new Lime.Exception(warningText);
#else
                Console.WriteLine(warningText);
#endif
            }
            PlatformRenderer.SetBlendState(blendState);
            PlatformRenderer.SetTextureLegacy(1, ShaderPrograms.ColorfulTextShaderProgram.GradientRampTexture);
            PlatformRenderer.SetShaderProgram(ShaderPrograms.ColorfulTextShaderProgram.GetInstance());
            PlatformRenderer.SetShaderParams(shaderParamsArray);
        }
예제 #2
0
 public void Apply(int pass)
 {
     PrepareShaderProgram();
     shaderParams.Set(shaderParamKeys.World, Renderer.World);
     shaderParams.Set(shaderParamKeys.WorldView, Renderer.WorldView);
     shaderParams.Set(shaderParamKeys.WorldViewProj, Renderer.WorldViewProjection);
     shaderParams.Set(shaderParamKeys.ColorFactor, Renderer.ColorFactor.ToVector4());
     shaderParams.Set(shaderParamKeys.DiffuseColor, DiffuseColor.ToVector4());
     shaderParams.Set(shaderParamKeys.FogColor, FogColor.ToVector4());
     shaderParams.Set(shaderParamKeys.FogStart, FogStart);
     shaderParams.Set(shaderParamKeys.FogEnd, FogEnd);
     shaderParams.Set(shaderParamKeys.FogDensity, FogDensity);
     if (skinEnabled)
     {
         shaderParams.Set(shaderParamKeys.Bones, boneTransforms, boneCount);
     }
     PlatformRenderer.SetBlendState(Blending.GetBlendState());
     PlatformRenderer.SetTextureLegacy(CommonMaterialProgram.DiffuseTextureStage, diffuseTexture);
     PlatformRenderer.SetShaderProgram(program);
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }