浏览代码

Merge branch 'kgdev' into 'master'

fix lastClipRect and the canvas_filter shader.

See merge request upm-packages/ui-widgets/com.unity.uiwidgets!148
/main
Shenhua Gu 6 年前
当前提交
7e9102a9
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 4
      Runtime/Resources/UIWidgets_canvas.cginc
  2. 6
      Runtime/ui/painting/canvas_impl.cs

4
Runtime/Resources/UIWidgets_canvas.cginc


half4 color = half4(0, 0, 0, 0);
float2 coord = i.ftcoord - _mf_radius * _mf_imgInc;
int width = _mf_radius * 2 + 1;
int width = _mf_radius * 2.0 + 1; // use 2.0 to avoid "bitfieldInsert"
[unroll(25)]
for (int i = 0; i < width; i++) {
color += tex2D(_tex, coord) * _mf_kernel[i];
coord += _mf_imgInc;

6
Runtime/ui/painting/canvas_impl.cs


readonly List<RenderLayer> _layers = new List<RenderLayer>();
RenderLayer _currentLayer;
Rect _lastScissor;
public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool) {
D.assert(renderTexture);

}
void _tryAddScissor(RenderLayer layer, Rect scissor) {
if (scissor == layer.lastScissor) {
if (scissor == this._lastScissor) {
return;
}

layer.lastScissor = scissor;
this._lastScissor = scissor;
}
bool _applyClip(Rect queryBounds) {

public readonly ClipStack clipStack = new ClipStack();
public uint lastClipGenId;
public Rect lastClipBounds;
public Rect lastScissor;
public bool ignoreClip = true;
Vector4? _viewport;

正在加载...
取消
保存