WIP integrate eight print looks; pass 393 native checks, reference comparison pending
这个提交包含在:
1 父节点
7d895750cf
当前提交
ab7cb759e5
13 个文件已更改
+2199
-16
没有与搜索条件相匹配的文件
@@ -18,4 +18,4 @@
|
||||
|
||||
新增第六页“印片”,默认无,八项Kodak2383/2393/2302 BW、Fuji3510/3513/3519/3521、AgfaCP30;旧参数、1.5.0的1296字节前缀及颗粒时间位置保留。预设v6继续读旧版本,新参数缺省中性,独立层默认无。印片是逐像素变换,可写入静态Cube;空间、时间和蒙版限制继续保留。
|
||||
|
||||
当前为WIP检查点,渲染接入、图像对照与正式交付尚未完成,不能凭资源导入称为完成。
|
||||
1.6.0(35)渲染和模板已经编译。当前393项原生检查全部通过,含既有349项及八种印片资源/输出、强度/眼睛/总混合精确旁路、独立两层归档、蒙版和Cube格点对照。组件级原版图像对照仍在核对Core Image串联透明度语义;正式安装仍为1.5.0,未把开发编译副本作为可见版本运行。
|
||||
@@ -3572,6 +3572,53 @@
|
||||
"step": 0.01,
|
||||
"title": "暗角过渡"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"filmTab": 5,
|
||||
"key": "filmPrintLook",
|
||||
"kind": "popup",
|
||||
"max": 8,
|
||||
"min": 0,
|
||||
"notAnimatable": true,
|
||||
"offset": 1296,
|
||||
"options": [
|
||||
"无",
|
||||
"Kodak 2383",
|
||||
"Kodak 2393",
|
||||
"Kodak 2302 BW",
|
||||
"Fuji 3510",
|
||||
"Fuji 3513",
|
||||
"Fuji 3519",
|
||||
"Fuji 3521",
|
||||
"Agfa CP30"
|
||||
],
|
||||
"pid": 2324,
|
||||
"step": 0.01,
|
||||
"title": "印片外观",
|
||||
"values": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8
|
||||
]
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"filmTab": 5,
|
||||
"key": "filmPrintStrength",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1300,
|
||||
"pid": 2325,
|
||||
"step": 0.01,
|
||||
"title": "印片强度"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"key": "filmEnabled",
|
||||
@@ -3588,14 +3635,14 @@
|
||||
"template/tools/dump_model.mm": "04e04446aa351d774913bc25b06512fefe7969bdf4c6e471a91f1e9d6c4fc3b5",
|
||||
"大鱼调色/Plugin/DYCSTTypes.h": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696",
|
||||
"大鱼调色/Plugin/DYColorManagement.h": "b0a4cd1b8c45dbce90a7b4f30f72ebf95ecd382895e74e3bfeda0f7cdb185157",
|
||||
"大鱼调色/Plugin/DYFilmMath.h": "e41d44790c6bb42db7c68520d442b39c381b4db4056d40a44426e21f62e9bf6b",
|
||||
"大鱼调色/Plugin/DYFilmMath.h": "945b7036c6aa6d27941a3bf96c4d70dec65a14b1747fba618e650738fa7108f0",
|
||||
"大鱼调色/Plugin/DYFilmTypes.h": "c35a43b5b93988e8517e5db8f281da0dfd1e02f5b0e7bfb62e7345cec444a36d",
|
||||
"大鱼调色/Plugin/DYModel.h": "80e88add97deeac7a9dc47d12f68b0245905786297de2e6553b3da15c729da6e",
|
||||
"大鱼调色/Plugin/DYModel.mm": "48d0e8a36f41001c63e0f95faa99f8dd910b0227d7b93ff2a90006673c3e3c36",
|
||||
"大鱼调色/Plugin/DYModel.mm": "b992f2bfff754eccc3ed9f591bc6a8f80ccdd3f6108d2720d6dd6fe34d1556dd",
|
||||
"大鱼调色/Plugin/DYSpiderState.h": "0c80747e41e8fc97762e301b011bd08c18865a825eaafde086ed79ace37b22f9",
|
||||
"大鱼调色/Plugin/DYToolState.h": "28088ec819307a60f2e52334fd807a514c3ff8a550bc0efbe7069b68a6242320",
|
||||
"大鱼调色/Plugin/DYToolState.mm": "6502e412532f2be2589188c1b99579ae59ab279d814805e38b0c8042e921a5bd",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "8c494532d534b65622039605073b554bafd92ec0efe1e0d207d822b59862a1cb",
|
||||
"大鱼调色/Plugin/DYToolState.mm": "f0a0f09863de52837ed962a72f2ea6098b8a5a0f43f285f9a21aebcd62c89c8d",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "207d36b5b53ab084fa8eb3813ccbbeb5193178e3468a37e9dc692ab196ffbb6a",
|
||||
"大鱼调色/Plugin/MaskCore/DYMask.h": "5b9aa44390d4a1fca1baf5e34cb9eefc8483c939a65cc2a0412b7b41fc85bc16",
|
||||
"大鱼调色/Plugin/MaskCore/DYMaskOperator.h": "43fa701ad574f38ce0ab4f4d3900bb034edaaa1adc09821d2f4443ee2b687ba2",
|
||||
"大鱼调色/Plugin/SpiderCore/DYColorMath.h": "bdd6278e17ff4208ad94a8b0e834c817c0a3475f205dd79898e8fd88e84a19c9",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"passed": true,
|
||||
"sha256": "7476fb5a3cfad5f4dafb7a887dcc787b9cbcba6ad64df3b4939b336444cf8bfc",
|
||||
"sha256": "44dbfef7b809352ccdb476da5cbe6c6ba9f1fe7a4d9ea53c6eaf7b5ddb798ad8",
|
||||
"version": "5.13",
|
||||
"displayversion": "5.6.7",
|
||||
"filterCount": 1,
|
||||
"nativeFloatParameters": 276,
|
||||
"nativeFloatParameters": 278,
|
||||
"customParameters": 3,
|
||||
"publications": [
|
||||
{
|
||||
|
||||
@@ -581,6 +581,8 @@
|
||||
<parameter name="暗角强度" id="2318" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="暗角半径" id="2319" flags="12889161760" default="50" value="50" />
|
||||
<parameter name="暗角过渡" id="2320" flags="12889161760" default="0.5" value="0.5" />
|
||||
<parameter name="印片外观" id="2324" flags="12889161776" default="0" value="0" />
|
||||
<parameter name="印片强度" id="2325" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="胶片模拟" id="2292" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="混合" id="10001" flags="12884901888" default="1" value="1" />
|
||||
<parameter name="翻转" id="10002" flags="12889161760" default="0" value="0" />
|
||||
|
||||
文件差异过大,未显示。
加载差异
@@ -241,7 +241,7 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
run.record(@"spider-single-drag-spoke-following-and-pin",dragged.x[0]>initialMesh.x[0]&&dragged.x[1]>initialMesh.x[1]&&dragged.x[3]>initialMesh.x[3]&&dragged.x[4]==initialMesh.x[4]&&dragged.x[5]==initialMesh.x[5]&&dragged.pins[2]);
|
||||
run.record(@"spider-drag-one-host-undo-group",uiHost->_undoStarts==starts+1&&uiHost->_undoEnds==ends+1&&!uiHost->_undoActive);
|
||||
error=nil;NSData *spiderArchive=[NSKeyedArchiver archivedDataWithRootObject:spiderSaved requiringSecureCoding:YES error:&error];DYAssetState *decodedSpider=[NSKeyedUnarchiver unarchivedObjectOfClass:DYAssetState.class fromData:spiderArchive error:&error];run.record(@"spider-archive-retains-mesh-pins-and-lut-paths",decodedSpider&&[decodedSpider isEqual:spiderSaved],@{@"error":reason(error)});
|
||||
NSDictionary *snapshot=[inspector performSelector:@selector(presetSnapshot)];NSData *presetJSON=[NSJSONSerialization dataWithJSONObject:snapshot options:0 error:&error];NSDictionary *decodedPreset=[NSJSONSerialization JSONObjectWithData:presetJSON options:0 error:&error];run.record(@"complete-version-five-preset-includes-mesh",[decodedPreset[@"version"]isEqual:@5]&&[DYSpiderFromJSON(decodedPreset[@"spider"])isEqual:spiderSaved.spiderMesh]);
|
||||
NSDictionary *snapshot=[inspector performSelector:@selector(presetSnapshot)];NSData *presetJSON=[NSJSONSerialization dataWithJSONObject:snapshot options:0 error:&error];NSDictionary *decodedPreset=[NSJSONSerialization JSONObjectWithData:presetJSON options:0 error:&error];run.record(@"complete-version-six-preset-includes-mesh",[decodedPreset[@"version"]isEqual:@6]&&[DYSpiderFromJSON(decodedPreset[@"spider"])isEqual:spiderSaved.spiderMesh]);
|
||||
NSDictionary *portable=DYSpiderJSON(spiderSaved.spiderMesh,spiderSaved.spiderLinked);NSData *decodedPortable=DYSpiderFromJSON(portable);run.record(@"spider-json-preset-exact-roundtrip",[decodedPortable isEqual:spiderSaved.spiderMesh]);
|
||||
NSMutableDictionary *badJSON=[[portable mutableCopy]autorelease];badJSON[@"hues"]=@7;run.record(@"spider-json-rejects-unsupported-topology",!DYSpiderFromJSON(badJSON));auto corrupt=dragged;corrupt.x[0]=NAN;run.record(@"spider-archive-rejects-nonfinite-coordinates",!DYSpiderMeshIsValid([NSData dataWithBytes:&corrupt length:sizeof(corrupt)]));
|
||||
[disc changeHueCount:12 saturationCount:8];spiderSaved=DYReadAssets(uiHost,kCMTimeZero);auto dense=DYSpiderMesh(spiderSaved.spiderMesh);run.record(@"spider-independent-resolution-and-resample",dense.hues==12&&dense.rings==7&&fabs(dy::meshDelta(dense,0,.6).x)>0);
|
||||
|
||||
@@ -39,5 +39,40 @@
|
||||
BOOL rejected=![renderer exportLUT:cube uniforms:masked paths:@{} spider:nil tools:empty.document error:&error];run.record(@"grain-rejected-by-static-cube",rejected&&error!=nil);
|
||||
masked.film.grainEnabled=0;masked.film.subtractiveEnabled=1;masked.film.gammaAll=1.1;error=nil;run.record(@"pure-subtractive-cube-supported",[renderer exportLUT:cube uniforms:masked paths:@{} spider:nil tools:empty.document error:&error],@{@"error":reason(error)});
|
||||
masked=matrix;masked.mixerMix=1;error=nil;run.record(@"channel-mixer-cube-supported",[renderer exportLUT:cube uniforms:masked paths:@{} spider:nil tools:empty.document error:&error],@{@"error":reason(error)});
|
||||
// Exercise the shipped print resources through the complete production path.
|
||||
// The separate installed-reference oracle checks interpolation and color math.
|
||||
NSArray *printNames=@[@"kodak_2383",@"kodak_2393",@"kodak_2302_bw",@"fuji_3510",@"fuji_3513",@"fuji_3519",@"fuji_3521",@"agfa_cp30"];
|
||||
std::vector<Pixels> printFrames;BOOL printFramesDistinct=YES;
|
||||
DYUniforms printValue=neutral;printValue.film.enabled=1;printValue.filmPrint.y=1;
|
||||
for(NSUInteger index=0;index<printNames.count;index++){
|
||||
NSString *resource=[[NSBundle bundleForClass:renderer.class]pathForResource:printNames[index] ofType:@"dylut" inDirectory:@"PrintLooks"];std::vector<float> table;NSUInteger side=0;error=nil;
|
||||
BOOL resourceOK=resource&&DYLUTReadCube(resource,table,side,&error)&&side==65&&table.size()==65*65*65*4;
|
||||
run.record([NSString stringWithFormat:@"print-%lu-shipped-65cube",(unsigned long)index+1],resourceOK,@{@"error":reason(error),@"side":@(side)});
|
||||
printValue.filmPrint.x=index+1;Pixels printed=filmRender(printValue,nil,[NSString stringWithFormat:@"print-%lu-production-render",(unsigned long)index+1]);Difference change=difference(before,printed);BOOL sameAlpha=YES;
|
||||
for(size_t pixel=0;pixel<printed.size()/4;pixel++)sameAlpha&=printed[pixel*4+3]==before[pixel*4+3];
|
||||
run.record([NSString stringWithFormat:@"print-%lu-active-finite-preserves-alpha",(unsigned long)index+1],change.different>20&&change.nonfinite==0&&sameAlpha,measure(change));
|
||||
for(const Pixels& previous:printFrames)printFramesDistinct&=difference(previous,printed).different>20;printFrames.push_back(printed);
|
||||
}
|
||||
run.record(@"all-eight-print-looks-have-distinct-production-output",printFramesDistinct);
|
||||
printValue.filmPrint.y=0;bypass=filmRender(printValue,nil,@"print-zero-strength-render");run.record(@"print-zero-strength-exact-old-frame",difference(before,bypass).maximum==0);
|
||||
printValue.filmPrint.y=1;printValue.film.mix=0;bypass=filmRender(printValue,nil,@"print-zero-film-mix-render");run.record(@"print-zero-film-mix-exact-old-frame",difference(before,bypass).maximum==0);
|
||||
printValue.film.mix=1;printValue.film.enabled=0;bypass=filmRender(printValue,nil,@"print-eye-off-render");run.record(@"print-eye-off-exact-old-frame",difference(before,bypass).maximum==0);printValue.film.enabled=1;
|
||||
DYUniforms freshPrint=DYToolUniforms(DYNewTool(@"film"));run.record(@"new-film-layer-print-default-is-none",freshPrint.filmPrint.x==0&&freshPrint.filmPrint.y==1&&DYToolIsNeutral(DYNewTool(@"film")));
|
||||
NSMutableDictionary *printDoc=DYMutablePlist(empty.document),*printLayer=(id)DYInsertTool(printDoc,@"film",@"base:film");printLayer[@"values"][@"filmPrintLook"]=@2;
|
||||
run.record(@"print-only-independent-layer-is-active",DYValidToolDocument(printDoc)&&!DYToolIsNeutral(printLayer)&&DYFilmPrintActive(DYToolUniforms(printLayer)));
|
||||
Pixels printLayerFrame=filmRender(neutral,printDoc,@"print-only-independent-layer-render");run.record(@"print-only-independent-layer-affects-frame",difference(before,printLayerFrame).different>20);
|
||||
NSMutableDictionary *secondPrintLayer=(id)DYInsertTool(printDoc,@"film",printLayer[@"id"]);secondPrintLayer[@"values"][@"filmPrintLook"]=@8;secondPrintLayer[@"values"][@"filmPrintStrength"]=@.4;
|
||||
DYToolDocument *printSaved=[[[DYToolDocument alloc]init]autorelease];printSaved.document=printDoc;error=nil;NSData *printArchive=[NSKeyedArchiver archivedDataWithRootObject:printSaved requiringSecureCoding:YES error:&error];DYToolDocument *printRestored=[NSKeyedUnarchiver unarchivedObjectOfClass:DYToolDocument.class fromData:printArchive error:&error];
|
||||
DYUniforms firstRestored=DYToolUniforms(DYToolWithID(printRestored.document,printLayer[@"id"])),secondRestored=DYToolUniforms(DYToolWithID(printRestored.document,secondPrintLayer[@"id"]));
|
||||
run.record(@"two-print-layers-archive-independent-choices-and-strength",[printSaved isEqual:printRestored]&&firstRestored.filmPrint.x==2&&firstRestored.filmPrint.y==1&&secondRestored.filmPrint.x==8&&secondRestored.filmPrint.y==.4f,@{@"error":reason(error)});
|
||||
Pixels twoPrintLayers=filmRender(neutral,printRestored.document,@"two-print-layers-production-render");run.record(@"second-print-layer-is-rendered-independently",difference(printLayerFrame,twoPrintLayers).different>20);
|
||||
Pixels printZeroMask=filmRender(printValue,baseMask,@"print-zero-mask-render");run.record(@"print-zero-mask-exact-source",difference(before,printZeroMask).maximum==0);
|
||||
printValue.filmPrint.x=1;error=nil;BOOL printExported=[renderer exportLUT:cube uniforms:printValue paths:@{} spider:nil tools:empty.document error:&error];run.record(@"print-only-static-cube-supported",printExported,@{@"error":reason(error)});
|
||||
std::vector<float> printCubeValues;NSUInteger printCubeSide=0;error=nil;BOOL printCubeParsed=printExported&&DYLUTReadCube(cube.path,printCubeValues,printCubeSide,&error)&&printCubeSide==33;
|
||||
Pixels printCubeInput(input.size());float printCodes[3]={.5f,.25f,.75f};for(size_t pixel=0;pixel<printCubeInput.size()/4;pixel++){for(int channel=0;channel<3;channel++){float code=printCodes[channel];printCubeInput[pixel*4+channel]=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);}printCubeInput[pixel*4+3]=1;}
|
||||
uploadFilm(printCubeInput);Pixels printCubeRendered=filmRender(printValue,nil,@"print-cube-production-lattice-point");BOOL printCubeMatches=printCubeParsed&&printCubeValues.size()==33*33*33*4;
|
||||
for(int channel=0;channel<3&&printCubeMatches;channel++){float code=printCubeValues[((24*33+8)*33+16)*4+channel],linear=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);printCubeMatches&=fabs(linear-(float)printCubeRendered[channel])<.0005;}
|
||||
run.record(@"print-static-cube-matches-production-lattice-point",printCubeMatches,@{@"side":@(printCubeSide),@"error":reason(error)});
|
||||
printValue.film.grainEnabled=1;printValue.film.grainAmount=.5;error=nil;run.record(@"print-with-grain-still-rejected-by-static-cube",![renderer exportLUT:cube uniforms:printValue paths:@{} spider:nil tools:empty.document error:&error]&&error!=nil);
|
||||
uploadFilm(input);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -11,6 +11,14 @@ inline float3 dyFilmPositive(float3 c){for(int i=0;i<3;i++)if(c[i]<0)c[i]=0;retu
|
||||
inline bool DYChannelMixerActive(DYUniforms u){return u.mixerSectionEnabled>.5f&&u.mixerMix>0&&(u.mixerRed.x!=1||u.mixerRed.y!=0||u.mixerRed.z!=0||u.mixerGreen.x!=0||u.mixerGreen.y!=1||u.mixerGreen.z!=0||u.mixerBlue.x!=0||u.mixerBlue.y!=0||u.mixerBlue.z!=1);}
|
||||
inline bool DYFilmPrintActive(DYUniforms u){return u.film.enabled>.5f&&u.film.mix>0&&u.filmPrint.x>=1&&u.filmPrint.x<=8&&u.filmPrint.y>0;}
|
||||
inline bool DYFilmToolActive(DYUniforms u){return DYFilmActive(u.film)||DYFilmPrintActive(u);}
|
||||
// AP1/D60 conversion verified against the local reference's color-space filter.
|
||||
// The print tables operate on ACEScct code values, not display RGB.
|
||||
inline float3 dyPrintToAP1(float3 c){return {c.x*.6130974293f+c.y*.3395231366f+c.z*.0473794527f,c.x*.0701937228f+c.y*.9163538814f+c.z*.0134523986f,c.x*.0206155926f+c.y*.1095697731f+c.z*.8698146343f};}
|
||||
inline float3 dyPrintFromAP1(float3 c){return {c.x*1.7050509453f-c.y*.6217921376f-c.z*.0832588747f,-c.x*.1302564144f+c.y*1.1408047676f-c.z*.0105483187f,-c.x*.0240033567f-c.y*.1289689690f+c.z*1.1529723406f};}
|
||||
inline float dyPrintCCTEncode(float c){return c<=.0078125f?10.5402377416545f*c+.0729055341958355f:(log2(c)+9.72f)/17.52f;}
|
||||
inline float dyPrintCCTDecode(float c){return c<=.155251141552511f?(c-.0729055341958355f)/10.5402377416545f:exp2(c*17.52f-9.72f);}
|
||||
inline float3 dyPrintEncode(float3 c){c=dyPrintToAP1(c);return {dyPrintCCTEncode(c.x),dyPrintCCTEncode(c.y),dyPrintCCTEncode(c.z)};}
|
||||
inline float3 dyPrintDecode(float3 c){return dyPrintFromAP1(float3{dyPrintCCTDecode(c.x),dyPrintCCTDecode(c.y),dyPrintCCTDecode(c.z)});}
|
||||
inline float3 dyFilmMixer(float3 c,DYUniforms u){
|
||||
float3 r={c.x*u.mixerRed.x+c.y*u.mixerRed.y+c.z*u.mixerRed.z,c.x*u.mixerGreen.x+c.y*u.mixerGreen.y+c.z*u.mixerGreen.z,c.x*u.mixerBlue.x+c.y*u.mixerBlue.y+c.z*u.mixerBlue.z};
|
||||
if(u.mixerPreserveLuma>.5f){r=dyFilmPositive(r);float ratio=dyFilmLuma(c)/dyFilmLuma(r);if(!isfinite(ratio))ratio=1;r*=ratio;}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// All work uses the renderer instance's lock and frozen state. No vendor code
|
||||
// or vendor runtime is loaded by the product.
|
||||
- (BOOL)renderFilmTool:(NSString*)type source:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)u masks:(NSArray*)masks entry:(NSMutableDictionary*)entry error:(NSError**)error {
|
||||
BOOL mixer=[type isEqual:@"mixer"],active=mixer?DYChannelMixerActive(u):DYFilmActive(u.film);
|
||||
BOOL mixer=[type isEqual:@"mixer"],active=mixer?DYChannelMixerActive(u):DYFilmToolActive(u);
|
||||
if(!active)return [self copyTile:source to:destination entry:entry error:error];
|
||||
id<MTLDevice>d=entry[@"device"];id<MTLTexture>before=[source metalTextureForDevice:d];
|
||||
if(!before)return fail(error,@"胶片输入纹理不可用");
|
||||
@@ -49,6 +49,14 @@
|
||||
id<MTLTexture>aux=texture(2);if(!aux)return fail(error,@"无法分配暗角缓冲区");CIImage *ci=image(current);if(!ci)return fail(error,@"暗角输入不可用");
|
||||
ci=[ci imageByApplyingFilter:@"CIVignetteEffect" withInputParameters:@{kCIInputCenterKey:[CIVector vectorWithX:before.width*.5 Y:before.height*.5],kCIInputIntensityKey:@(u.film.vignetteIntensity),kCIInputRadiusKey:@(u.film.vignetteRadius/100.f*MAX(before.width,before.height)),@"inputFalloff":@(u.film.vignetteFalloff)}];[context render:ci toMTLTexture:aux commandBuffer:commands bounds:bounds colorSpace:nil];if(!point(5,aux))return fail(error,@"暗角处理失败");
|
||||
}
|
||||
if(DYFilmPrintActive(u)){
|
||||
NSArray *names=@[@"",@"kodak_2383",@"kodak_2393",@"kodak_2302_bw",@"fuji_3510",@"fuji_3513",@"fuji_3519",@"fuji_3521",@"agfa_cp30"];
|
||||
NSString *path=[[NSBundle bundleForClass:self.class]pathForResource:names[(int)u.filmPrint.x] ofType:@"dylut" inDirectory:@"PrintLooks"];
|
||||
if(!path)return fail(error,@"印片外观资源缺失,请重新安装正式版。");id<MTLTexture>cube=[self lut:path entry:entry error:error];if(!cube)return NO;
|
||||
if(cube.width!=65||cube.height!=65||cube.depth!=65)return fail(error,@"印片外观尺寸不正确,请重新安装正式版。");
|
||||
id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配印片缓冲区");
|
||||
encode(@"dyFilmPrint",current,cube,out,&u,sizeof(u));current=out;
|
||||
}
|
||||
if(u.film.mix<1){id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配胶片混合缓冲区");encode(@"dyFilmMix",before,current,out,&u.film.mix,4);current=out;}
|
||||
}
|
||||
// Finish the effect before the module's existing mask blend. Source and
|
||||
|
||||
@@ -103,7 +103,7 @@ static void bypassIdleSkin(DYUniforms *u){
|
||||
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
|
||||
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
|
||||
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
|
||||
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyColorManagement",@"dyToolBlend",@"dyToolSkin",@"dyFilmPoint",@"dyFilmNoise",@"dyFilmSparseBlur",@"dyFilmBloomEdges",@"dyFilmMix"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
|
||||
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyColorManagement",@"dyToolBlend",@"dyToolSkin",@"dyFilmPoint",@"dyFilmNoise",@"dyFilmSparseBlur",@"dyFilmBloomEdges",@"dyFilmMix",@"dyFilmPrint"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
|
||||
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
|
||||
// Preparing before the first frame may use registry 0. Reuse those pipelines
|
||||
// when the host subsequently supplies that device's actual registry ID.
|
||||
@@ -194,7 +194,7 @@ static void bypassIdleSkin(DYUniforms *u){
|
||||
}}}
|
||||
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{return [self exportLUT:url uniforms:u paths:paths spider:nil error:err];}
|
||||
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider error:(NSError**)err{@synchronized(self){
|
||||
if(DYFilmActive(u.film)&&DYFilmSpatialActive(u.film))return fail(err,@"胶片空间和颗粒处理不能保存到静态 Cube,请保存完整预设。");
|
||||
if(DYFilmToolActive(u)&&DYFilmSpatialActive(u.film))return fail(err,@"胶片空间和颗粒处理不能保存到静态 Cube,请保存完整预设。");
|
||||
NSMutableDictionary *e=[self device:0 error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];const NSUInteger n=33,count=n*n*n,width=n*n,height=n;
|
||||
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
|
||||
id<MTLTexture>input=[d newTextureWithDescriptor:desc],output=[d newTextureWithDescriptor:desc];if(!input||!output){[input release];[output release];return fail(err,@"无法分配 LUT 色格");}
|
||||
|
||||
+3
-3
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.5.0</string>
|
||||
<string>1.6.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>34</string>
|
||||
<string>35</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
@@ -71,7 +71,7 @@
|
||||
<key>uuid</key>
|
||||
<string>1C17B73B-F229-4C09-A434-EAF6DFF5F22A</string>
|
||||
<key>version</key>
|
||||
<string>1.5.0</string>
|
||||
<string>1.6.0</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>className</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.5.0</string>
|
||||
<string>1.6.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>34</string>
|
||||
<string>35</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户