static Renderer() { projectionParamKey = GlobalShaderParams.GetParamKey <Matrix44>("matProjection"); colorFactorParamKey = GlobalShaderParams.GetParamKey <Vector4>("colorFactor"); PlatformRenderer.RenderTargetChanged += OnRenderTargetChanged; ColorFactor = Color4.White; }
public DistortionMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; amountKey = shaderParams.GetParamKey <Vector4>("uAmount"); }
public BloomMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; brightThresholdKey = shaderParams.GetParamKey <float>("brightThreshold"); inversedGammaCorrectionKey = shaderParams.GetParamKey <Vector3>("inversedGammaCorrection"); }
public AlphaIntensityMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; radiusKey = shaderParams.GetParamKey <float>("radius"); brightnessKey = shaderParams.GetParamKey <float>("brightness"); colorKey = shaderParams.GetParamKey <Vector4>("glowColor"); }
public DissolveMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; brightnessKey = shaderParams.GetParamKey <float>("brightness"); rangeKey = shaderParams.GetParamKey <Vector2>("range"); colorKey = shaderParams.GetParamKey <Vector4>("glowColor"); }
public FXAAMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; texelStepKey = shaderParams.GetParamKey <Vector2>("uTexelStep"); amountKey = shaderParams.GetParamKey <Vector4>("uAmount"); }
public NoiseMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; brightThresholdKey = shaderParams.GetParamKey <float>("brightThreshold"); darkThresholdKey = shaderParams.GetParamKey <float>("darkThreshold"); softLightKey = shaderParams.GetParamKey <float>("softLight"); }
public SharpenMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; stepKey = shaderParams.GetParamKey <Vector2>("step"); sharpnessKey = shaderParams.GetParamKey <Vector3>("uSharpness"); }
public TwistMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; angleKey = shaderParams.GetParamKey <float>("angle"); uv0Key = shaderParams.GetParamKey <Vector2>("uv0"); uv1Key = shaderParams.GetParamKey <Vector2>("uv1"); }
public BlurMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; stepKey = shaderParams.GetParamKey <Vector2>("step"); alphaCorrectionKey = shaderParams.GetParamKey <float>("inversedAlphaCorrection"); }
public ColorCorrectionMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; hslKey = shaderParams.GetParamKey <Vector3>("inHsl"); brightnessKey = shaderParams.GetParamKey <float>("brightness"); contrastKey = shaderParams.GetParamKey <float>("contrast"); }
private ShaderParam<T> GetParameter<T>(ShaderParamKey<T> key, int capacity) { var p = Items[key.Index] as ShaderParam<T>; if (p == null || p.Data.Length < capacity) { p = new ShaderParam<T>(capacity) { Name = key.Name }; Items[key.Index] = p; } return p; }
public void Set<T>(ShaderParamKey<T> key, T value) { var p = GetParameter(key, 1); p.Data[0] = value; p.Count = 1; unchecked { p.Version++; } }
public void Set<T>(ShaderParamKey<T> key, T[] value, int count) { var p = GetParameter(key, count); Array.Copy(value, p.Data, count); p.Count = count; unchecked { p.Version++; } }
public WaveMaterial() { shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; phaseKey = shaderParams.GetParamKey <Vector2>("phase"); frequencyKey = shaderParams.GetParamKey <Vector2>("frequency"); pivotKey = shaderParams.GetParamKey <Vector2>("pivot"); amplitudeKey = shaderParams.GetParamKey <Vector2>("amplitude"); uv0Key = shaderParams.GetParamKey <Vector2>("UV0"); uv1Key = shaderParams.GetParamKey <Vector2>("UV1"); }
public VignetteMaterial(Blending blending) { Blending = blending; shaderParams = new ShaderParams(); shaderParamsArray = new[] { Renderer.GlobalShaderParams, shaderParams }; radiusKey = shaderParams.GetParamKey <float>("radius"); softnessKey = shaderParams.GetParamKey <float>("softness"); uv1Key = shaderParams.GetParamKey <Vector2>("uv1"); uvOffsetKey = shaderParams.GetParamKey <Vector2>("uvOffset"); colorKey = shaderParams.GetParamKey <Vector4>("vignetteColor"); }
public ShaderParamKeys(ShaderParams parameters) { WorldViewProj = parameters.GetParamKey <Matrix44>("u_WorldViewProj"); WorldView = parameters.GetParamKey <Matrix44>("u_WorldView"); World = parameters.GetParamKey <Matrix44>("u_World"); ColorFactor = parameters.GetParamKey <Vector4>("u_ColorFactor"); DiffuseColor = parameters.GetParamKey <Vector4>("u_DiffuseColor"); LightColor = parameters.GetParamKey <Vector4>("u_LightColor"); LightDirection = parameters.GetParamKey <Vector3>("u_LightDirection"); LightIntensity = parameters.GetParamKey <float>("u_LightIntensity"); LightStrength = parameters.GetParamKey <float>("u_LightStrength"); LightAmbient = parameters.GetParamKey <float>("u_AmbientLight"); LightWorldViewProj = parameters.GetParamKey <Matrix44>("u_LightWorldViewProjection"); ShadowColor = parameters.GetParamKey <Vector4>("u_ShadowColor"); Bones = parameters.GetParamKey <Matrix44>("u_Bones"); FogColor = parameters.GetParamKey <Vector4>("u_FogColor"); FogStart = parameters.GetParamKey <float>("u_FogStart"); FogEnd = parameters.GetParamKey <float>("u_FogEnd"); FogDensity = parameters.GetParamKey <float>("u_FogDensity"); }