浏览代码

Merge branch 'kgdev' into 'master'

fix filterMode.

See merge request upm-packages/ui-widgets/com.unity.uiwidgets!76
/main
Fan Zhang 6 年前
当前提交
e61d0b32
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 6
      Runtime/ui/painting/canvas_impl.cs
  2. 4
      Runtime/ui/painting/canvas_shader.cs

6
Runtime/ui/painting/canvas_impl.cs


width = textureWidth,
height = textureHeight,
layerBounds = maskBounds,
filterMode = FilterMode.Bilinear,
};
parentLayer.layers.Add(maskLayer);

width = textureWidth,
height = textureHeight,
layerBounds = maskLayer.layerBounds,
filterMode = FilterMode.Bilinear,
};
parentLayer.layers.Add(blurXLayer);

width = textureWidth,
height = textureHeight,
layerBounds = maskLayer.layerBounds,
filterMode = FilterMode.Bilinear,
};
parentLayer.layers.Add(blurYLayer);

desc.msaaSamples = QualitySettings.antiAliasing;
}
cmdBuf.GetTemporaryRT(subLayer.rtID, desc, FilterMode.Bilinear);
cmdBuf.GetTemporaryRT(subLayer.rtID, desc, subLayer.filterMode);
this._drawLayer(subLayer, cmdBuf);
}

public int rtID;
public int width;
public int height;
public FilterMode filterMode = FilterMode.Point;
public Rect layerBounds;
public Paint layerPaint;
public readonly List<object> draws = new List<object>();

4
Runtime/ui/painting/canvas_shader.cs


var mat = _texMat.getMaterial(paint.blendMode, layer.ignoreClip);
_getShaderPassAndProps(viewport, ctm, paint, 1.0f, out var pass, out var props);
image.texture.filterMode = paint.filterMode;
props.SetTexture("_tex", image.texture);
props.SetInt("_texMode", image.texture is RenderTexture ? 1 : 0); // pre alpha if RT else post alpha

MeshMesh mesh, PictureFlusher.RenderLayer renderLayer) {
Vector4 viewport = layer.viewport;
Matrix3 ctm = layer.states[layer.states.Count - 1].matrix;
var mat = _texMat.getMaterial(paint.blendMode, layer.ignoreClip);
_getShaderPassAndProps(viewport, ctm, paint, 1.0f, out var pass, out var props);

var mat = _texMat.getMaterial(paint.blendMode, layer.ignoreClip);
_getShaderPassAndProps(viewport, ctm, paint, 1.0f, out var pass, out var props);
tex.filterMode = paint.filterMode;
props.SetTexture("_tex", tex);
props.SetInt("_texMode", 2); // alpha only

正在加载...
取消
保存