public override void ApplyModifier(GraphicShaderControl shaderControl) { shaderControl.SetColor(_color1Field, color1); shaderControl.SetColor(_color2Field, color2); shaderControl.SetFloat(_rampPowerField, power); shaderControl.SetFloat(_rampScaleField, scale); shaderControl.SetBool(_radialField, radial); shaderControl.SetBool(_invertField, invert); shaderControl.SetBool(_alphaRampField, applyAlpha); shaderControl.SetVector(_rampDirectionField, rampDirection.normalized); }
public override void ApplyModifier(GraphicShaderControl shaderControl) { shaderControl.SetFloat(_blurSigmaField, blurSigma); shaderControl.SetFloat(_blurSizeField, blurSize); shaderControl.SetFloat(_blurSamplesField, blurSamples); shaderControl.SetBool(_useMainTexField, useMainTexture); }
public override void ApplyModifier(GraphicShaderControl shaderControl) { shaderControl.SetFloat(_borderSizeField, borderSize); shaderControl.SetFloat(_borderThicknessField, borderThickness); shaderControl.SetColor(_borderColorField, borderColor); shaderControl.SetBool(_renderBorderOnlyField, renderBorderOnly); }
public override void ApplyModifier(GraphicShaderControl shaderControl) { float angle = Mathf.Deg2Rad * lineAngle; Vector2 lineDir = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)); // equation: a*x + b*y + c = 0, where b = -1 float a = (Math.Abs(lineDir.x) < 0.001f) ? 100000f: lineDir.y / lineDir.x; float c = 0.5f - 0.5f * a; float d = Mathf.Sqrt(a * a + c * c); // TODO: remove the sqrt? Vector3 lineDir2 = new Vector3(a, c, d); shaderControl.SetVector(_lineDirectionField, lineDir2); shaderControl.SetFloat(_lineSizeField, lineSize); shaderControl.SetFloat(_lineThicknessField, lineThickness); shaderControl.SetColor(_lineColorField, lineColor); shaderControl.SetBool(_applyRepeatField, applyRepeat); shaderControl.SetFloat(_repeatFrequencyField, repeatDistance + 1); }
public override void ApplyModifier(GraphicShaderControl shaderControl) { shaderControl.SetBool(_applyDitherField, applyDither && GlobalAllowDither); shaderControl.SetFloat(_ditherStrengthField, 1f / ditherStrengthInverse); shaderControl.SetFloat(_ditherScaleField, ditherScale); }