WIP: insert initialized tools at anchors with matching render order, enlarge mask controls and rebuild native pen editing; integration checks pending
这个提交包含在:
1 父节点
745aa1626e
当前提交
38adc259e0
20 个文件已更改
+405
-105
没有与搜索条件相匹配的文件
@@ -18,6 +18,12 @@ extern "C" half4 dy_gradeMasked(half4 sample, float2 uv, texture2d<half> source,
|
||||
texture3d<float> hslMixer, texture3d<float> whiteBalance,
|
||||
texture3d<float> colorGrading, constant DYUniforms& uniforms,
|
||||
constant float& sceneLevel,float w0,float w1,float w2,float w3,float w4,float w5,float w6,float w7,float w8,float w9,float w10,float w11);
|
||||
extern "C" half4 dy_gradeSegment(half4 sample, float2 uv, texture2d<half> source,
|
||||
texture3d<float> preLUT, texture3d<float> look1, texture3d<float> look2,
|
||||
texture3d<float> look3, texture3d<float> look4, texture3d<float> look5,
|
||||
texture3d<float> hslMixer, texture3d<float> whiteBalance,
|
||||
texture3d<float> colorGrading, constant DYUniforms& uniforms,
|
||||
constant float& sceneLevel,float w0,float w1,float w2,float w3,float w4,float w5,float w6,float w7,float w8,float w9,float w10,float w11,uint stageFirst,uint stageLast,float3 skinReference);
|
||||
|
||||
struct DYRaster {
|
||||
float4 position [[position]];
|
||||
@@ -181,6 +187,45 @@ fragment half4 dyMaskedFragment(DYRaster in [[stage_in]],
|
||||
return result;
|
||||
}
|
||||
|
||||
fragment half4 dySegmentFragment(DYRaster in [[stage_in]],
|
||||
texture2d<half> source [[texture(0)]],
|
||||
texture3d<float> preLUT [[texture(1)]],
|
||||
texture3d<float> look1 [[texture(2)]],
|
||||
texture3d<float> look2 [[texture(3)]],
|
||||
texture3d<float> look3 [[texture(4)]],
|
||||
texture3d<float> look4 [[texture(5)]],
|
||||
texture3d<float> look5 [[texture(6)]],
|
||||
texture3d<float> hslMixer [[texture(7)]],
|
||||
texture3d<float> whiteBalance [[texture(8)]],
|
||||
texture3d<float> colorGrading [[texture(9)]],
|
||||
constant DYUniforms& uniforms [[buffer(0)]],
|
||||
constant float& sceneLevel [[buffer(1)]],
|
||||
constant DYRenderOptions& options [[buffer(2)]],
|
||||
constant DYUniforms& colorUniforms [[buffer(3)]],
|
||||
device const float* spiderSamples [[buffer(4)]],
|
||||
constant int2& spiderSize [[buffer(5)]],
|
||||
device const DYToolMaskEntry* masks [[buffer(6)]],
|
||||
constant DYToolMaskHeader& maskHeader [[buffer(7)]],
|
||||
constant DYToolStageRange& stages [[buffer(8)]],
|
||||
texture2d<half> skinReference [[texture(10)]]) {
|
||||
constexpr sampler sampleFilter(coord::normalized, address::clamp_to_edge, filter::linear);
|
||||
half4 sample = source.sample(sampleFilter, in.uv);
|
||||
if (!(sample.a > half(0.0))) return half4(0.0h);
|
||||
float weights[12];float3 encoded=dyToolEncode(float3(sample.rgb));
|
||||
for(int i=0;i<12;i++)weights[i]=dyToolCoverage(in.uv,encoded,masks,maskHeader,i);
|
||||
half4 reference=skinReference.sample(sampleFilter,in.uv);
|
||||
float3 skinEncoded=dyToolEncode(reference.a>half(0)?float3(reference.rgb/reference.a):float3(0));
|
||||
half4 result = dy_gradeSegment(sample, in.uv, source, preLUT, look1, look2, look3,
|
||||
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded);
|
||||
if(stages.first<=9 && stages.last>=9 && options.blackWhiteMix>0.0f && options.blackWhiteMix<1.0f) {
|
||||
half4 color=dy_gradeSegment(sample,in.uv,source,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded);
|
||||
result.rgb=mix(color.rgb,result.rgb,half(options.blackWhiteMix));
|
||||
}
|
||||
result.a = sample.a;
|
||||
if (options.outputPremultiplied) result.rgb *= result.a;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Optional boundary conversion. Use this before both statistics and grading
|
||||
// when the host supplies premultiplied RGB; all neighborhood samples then see
|
||||
// the same straight RGB representation. Source and destination must differ.
|
||||
|
||||
在新工单中引用
屏蔽一个用户