WIP integrate eight print looks; pass 393 native checks, reference comparison pending
这个提交包含在:
1 父节点
7d895750cf
当前提交
ab7cb759e5
13 个文件已更改
+2199
-16
没有与搜索条件相匹配的文件
@@ -41,3 +41,22 @@ kernel void dyFilmBloomEdges(texture2d<float,access::sample> blurred [[texture(0
|
||||
kernel void dyFilmMix(texture2d<float,access::read> before [[texture(0)]],texture2d<float,access::read> after [[texture(1)]],texture2d<float,access::write> output [[texture(2)]],constant float& amount [[buffer(0)]],uint2 pos [[thread_position_in_grid]]){
|
||||
if(pos.x>=output.get_width()||pos.y>=output.get_height())return;float4 a=before.read(pos),b=after.read(pos);output.write(float4(dyLimit(mix(a.rgb,b.rgb,amount)),a.a),pos);
|
||||
}
|
||||
// Six tetrahedra, matching the reference LMT's integer texel fetches.
|
||||
inline float3 dyPrintTetra(texture3d<float,access::read> cube,float3 c){
|
||||
float n=float(cube.get_width()-1);float3 scaled=clamp(c,0.f,1.f)*n;uint3 p=uint3(clamp(floor(scaled),0.f,n-1));float3 f=scaled-float3(p);
|
||||
float3 a=cube.read(p).rgb,h=cube.read(p+uint3(1)).rgb;
|
||||
float3 r=cube.read(p+uint3(1,0,0)).rgb,g=cube.read(p+uint3(0,1,0)).rgb,b=cube.read(p+uint3(0,0,1)).rgb;
|
||||
float3 rg=cube.read(p+uint3(1,1,0)).rgb,rb=cube.read(p+uint3(1,0,1)).rgb,gb=cube.read(p+uint3(0,1,1)).rgb;
|
||||
if(f.x>f.y){if(f.y>f.z)return a*(1-f.x)+r*(f.x-f.y)+rg*(f.y-f.z)+h*f.z;
|
||||
if(f.x>f.z)return a*(1-f.x)+r*(f.x-f.z)+rb*(f.z-f.y)+h*f.y;
|
||||
return a*(1-f.z)+b*(f.z-f.x)+rb*(f.x-f.y)+h*f.y;
|
||||
}
|
||||
if(f.z>f.y)return a*(1-f.z)+b*(f.z-f.y)+gb*(f.y-f.x)+h*f.x;
|
||||
if(f.z>f.x)return a*(1-f.y)+g*(f.y-f.z)+gb*(f.z-f.x)+h*f.x;
|
||||
return a*(1-f.y)+g*(f.y-f.x)+rg*(f.x-f.z)+h*f.z;
|
||||
}
|
||||
kernel void dyFilmPrint(texture2d<float,access::read> source [[texture(0)]],texture3d<float,access::read> cube [[texture(1)]],texture2d<float,access::write> output [[texture(2)]],constant DYUniforms& u [[buffer(0)]],uint2 p [[thread_position_in_grid]]){
|
||||
if(p.x>=output.get_width()||p.y>=output.get_height())return;float4 value=source.read(p);
|
||||
if(value.a>0&&u.filmPrint.y>0){float3 c=value.rgb/value.a;float3 printed=dyPrintDecode(dyPrintTetra(cube,dyPrintEncode(c)));value.rgb=mix(c,printed,u.filmPrint.y)*value.a;}
|
||||
output.write(value,p);
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户