예제 #1
0
 public override void ApplyModifier(GraphicShaderControl shaderControl)
 {
     shaderControl.SetFloat(_blurSigmaField, blurSigma);
     shaderControl.SetFloat(_blurSizeField, blurSize);
     shaderControl.SetFloat(_blurSamplesField, blurSamples);
     shaderControl.SetBool(_useMainTexField, useMainTexture);
 }
예제 #2
0
 public override void ApplyModifier(GraphicShaderControl shaderControl)
 {
     shaderControl.SetFloat(_borderSizeField, borderSize);
     shaderControl.SetFloat(_borderThicknessField, borderThickness);
     shaderControl.SetColor(_borderColorField, borderColor);
     shaderControl.SetBool(_renderBorderOnlyField, renderBorderOnly);
 }
예제 #3
0
 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);
 }
예제 #4
0
    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.SetInt(_srcBlendField, (int)srcBlend);
     shaderControl.SetInt(_dstBlendField, (int)dstBlend);
 }
예제 #6
0
 public override void ApplyModifier(GraphicShaderControl shaderControl)
 {
     Rect = shaderControl.GetComponent <RectTransform>().rect;
     shaderControl.SetFloat(_sizeXField, Rect.width);
     shaderControl.SetFloat(_sizeYField, Rect.height);
 }
예제 #7
0
 public abstract void ApplyModifier(GraphicShaderControl shaderControl);
예제 #8
0
 public override void ApplyModifier(GraphicShaderControl shaderControl)
 {
     shaderControl.SetBool(_applyDitherField, applyDither && GlobalAllowDither);
     shaderControl.SetFloat(_ditherStrengthField, 1f / ditherStrengthInverse);
     shaderControl.SetFloat(_ditherScaleField, ditherScale);
 }
예제 #9
0
 public override void ApplyModifier(GraphicShaderControl shaderControl)
 {
     shaderControl.SetTexture(_maskField, mask);
     shaderControl.SetFloat(_maskWeightField, maskWeight);
 }