WIP: implement module artwork, adaptive inspector, ordered CMS and local mosaic; host validation pending
这个提交包含在:
1 父节点
3452f2344f
当前提交
4b73db8a17
57 个文件已更改
+631
-38
没有与搜索条件相匹配的文件
@@ -396,3 +396,28 @@ kernel void dyCloneStamps(texture2d<float,access::read> input [[texture(0)]],
|
||||
}
|
||||
output.write(color,gid);
|
||||
}
|
||||
|
||||
// Block-centre sampling is stable in image coordinates and never feeds back.
|
||||
kernel void dyLocalMosaic(texture2d<float,access::read> input [[texture(0)]],texture2d<float,access::write> output [[texture(1)]],device const DYToolMaskEntry* masks [[buffer(0)]],constant DYToolMaskHeader& h [[buffer(1)]],constant uint& block [[buffer(2)]],uint2 p [[thread_position_in_grid]]) {
|
||||
uint2 size=uint2(output.get_width(),output.get_height());if(any(p>=size))return;
|
||||
float4 original=input.read(p);float2 uv=(float2(p)+.5f)/float2(size);float3 code=dyToolEncode(original.a>0?original.rgb/original.a:float3(0));float coverage=0;
|
||||
if(h.section==-102){float x=h.offsetX+uv.x*h.scaleX,y=h.offsetY+uv.y*h.scaleY;for(uint i=0;i<h.count;i++)if(masks[i].section==-102)coverage=max(coverage,dyToolMask(x,y,code,masks[i].mask));}
|
||||
else if(h.count)coverage=dyToolCoverage(uv,code,masks,h,h.section);
|
||||
if(coverage<=0){output.write(original,p);return;}
|
||||
uint2 q=min((p/block)*block+block/2,size-1);float4 sample=input.read(q);
|
||||
// Preserve the pixel's original alpha and prevent transparent samples turning
|
||||
// into arbitrary RGB on an otherwise opaque face.
|
||||
float3 rgb=sample.a>0?sample.rgb/sample.a*original.a:original.rgb;
|
||||
output.write(float4(mix(original.rgb,rgb,coverage),original.a),p);
|
||||
}
|
||||
|
||||
// Extend bounded creative operators by their boundary delta. The float32
|
||||
// residual carries negative / above-one values around the historical bounded
|
||||
// kernels. Neutral tools skip this adapter entirely. This is a declared code
|
||||
// domain extension, not a tone map and not an intermediate output transform.
|
||||
kernel void dyUnifiedBridgeIn(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],uint2 p [[thread_position_in_grid]]){
|
||||
if(any(p>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(p);if(c.a>0)c.rgb=dyToolDecode(clamp(c.rgb/c.a,0.f,1.f))*c.a;b.write(c,p);
|
||||
}
|
||||
kernel void dyUnifiedBridgeOut(texture2d<float,access::read> raw [[texture(0)]],texture2d<float,access::read> changed [[texture(1)]],texture2d<float,access::write> out [[texture(2)]],uint2 p [[thread_position_in_grid]]){
|
||||
if(any(p>=uint2(out.get_width(),out.get_height())))return;float4 a=raw.read(p),b=changed.read(p);if(a.a>0&&b.a>0){float3 c=a.rgb/a.a;float3 delta=dyToolEncode(b.rgb/b.a)-clamp(c,0.f,1.f);a.rgb=(c+delta)*a.a;}out.write(a,p);
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户