Exemplo n.º 1
0
 public void Apply(int pass)
 {
     shaderParams.Set(amountKey, new Vector4(ChromaticAberration * Red, ChromaticAberration * Green, ChromaticAberration * Blue, BarrelPincushion));
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(DistortionShaderProgram.GetInstance(Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 2
0
 private ColorfulTextMaterial(Blending blending, int styleIndex)
 {
     colorIndex   = ShaderPrograms.ColorfulTextShaderProgram.StyleIndexToColorIndex(styleIndex);
     blendState   = blending.GetBlendState();
     shaderParams = new ShaderParams();
     shaderParams.Set(shaderParams.GetParamKey <float>("colorIndex"), colorIndex);
     shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams };
 }
Exemplo n.º 3
0
 public void Apply(int pass)
 {
     shaderParams.Set(stepKey, Step);
     shaderParams.Set(sharpnessKey, new Vector3(Strength, Strength * 0.25f, Limit));
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(SharpenShaderProgram.GetInstance(Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 4
0
 public void Apply(int pass)
 {
     shaderParams.Set(texelStepKey, TexelStep);
     shaderParams.Set(amountKey, new Vector4(LumaTreshold, 0.25f / MulReduce, 1f / MinReduce, MaxSpan));
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(FXAAShaderProgram.GetInstance(Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 5
0
 public void Apply(int pass)
 {
     shaderParams.Set(stepKey, Dir * Radius * Step);
     shaderParams.Set(alphaCorrectionKey, 1f / AlphaCorrection);
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(BlurShaderProgram.GetInstance(BlurShaderId, Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 6
0
 public void Apply(int pass)
 {
     shaderParams.Set(hslKey, HSL);
     shaderParams.Set(brightnessKey, Brightness);
     shaderParams.Set(contrastKey, Contrast);
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(ColorCorrectionShaderProgram.GetInstance(RequiredBrightnessContrastProcess, RequiredHSLProcess, Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 7
0
 public void Apply(int pass)
 {
     shaderParams.Set(dilateKey, 0.5f - Dilate * 0.01f);
     shaderParams.Set(softnessKey, Mathf.Max(Softness * 0.01f, 0.001f));
     shaderParams.Set(colorKey, Color.ToVector4());
     PlatformRenderer.SetBlendState(Blending.GetBlendState());
     PlatformRenderer.SetShaderProgram(SDFShadowShaderProgram.GetInstance());
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 8
0
 public void Apply(int pass)
 {
     shaderParams.Set(radiusKey, Radius);
     shaderParams.Set(softnessKey, Softness);
     shaderParams.Set(uv1Key, UV1);
     shaderParams.Set(uvOffsetKey, UVOffset);
     shaderParams.Set(colorKey, Color.ToVector4());
     PlatformRenderer.SetBlendState(Blending.GetBlendState());
     PlatformRenderer.SetShaderProgram(VignetteShaderProgram.GetInstance());
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 9
0
 public void Apply(int pass)
 {
     shaderParams.Set(phaseKey, Phase * Mathf.TwoPi);
     shaderParams.Set(frequencyKey, Frequency);
     shaderParams.Set(pivotKey, Pivot);
     shaderParams.Set(amplitudeKey, Amplitude);
     shaderParams.Set(uv0Key, UV0);
     shaderParams.Set(uv1Key, UV1);
     PlatformRenderer.SetBlendState(Blending.GetBlendState());
     PlatformRenderer.SetShaderProgram(WaveShaderProgram.GetInstance(Type, IsClamped));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Exemplo n.º 10
0
 public void Apply(int pass)
 {
     if (PassCount == 2 && pass == 0)
     {
         PlatformRenderer.SetBlendState(Blending.Alpha.GetBlendState(PremulAlpha));
     }
     else
     {
         PlatformRenderer.SetBlendState(Blending.GetBlendState(PremulAlpha));
     }
     PlatformRenderer.SetShaderParams(shaderParamsArray);
     PlatformRenderer.SetShaderProgram(ShaderProgram);
 }
Exemplo n.º 11
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);
 }