Prepare 1.5.0 build34 film and mixer delivery; verify 349 native and 184 reference cases
这个提交包含在:
1 父节点
f575c01893
当前提交
eeeee102cd
14 个文件已更改
+3600
-361
没有与搜索条件相匹配的文件
@@ -40,3 +40,8 @@ Cube只允许可静态表示的颜色数学;空间效果、颗粒和蒙版必
|
||||
|
||||
|
||||
独立原版对照38项现已全部通过:四组通道保持选项、12组减色、3种晕光半径、3种辉光阈值、4种PCG种子与12组颗粒。最大线性RGB绝对差0.0001328(通道双保持),低于预先记录的0.00015浮点容差;其余各项有各自阈值。辉光普通区域采用可分离预滤,最外一圈直接求原25点邻域,保留原版clamp边界,避免把裁切中间图的边界当作原图边界。见 `verification/FilmMixerReference.json`。这只覆盖声明的有限组件和参数,不代表原版整条CMS、全部素材或全部印片外观等价。
|
||||
|
||||
|
||||
正式构建准备:1.5.0(34),349项原生检查通过;独立原版对照在64×48、63×47、1×17、17×1四种尺寸共184项全部通过,含零矩阵/灰矩阵退化分支。上下纹理方向的颗粒固定全帧坐标验证通过;元数据旧前缀、原有跟踪/钢笔检查仍包含在原生回归中。静态3D Cube允许通道矩阵和纯减色,拒绝活跃的晕光/辉光/颗粒/暗角。FCP夹具只有三个独立合成项目,FCPXML1.12严格DTD与素材检查通过,不把内部FxPlug ID冒充模板发布参数路径;通过正式检视器设置验收参数。
|
||||
|
||||
兼容边界:新模块关闭/零混合以及旧工程缺省走原融合链;活跃减色沿用原SubSat对0…1的限幅。晕光/辉光保留邻域alpha权重,所有新处理保留入口alpha,非正alpha旁路;颗粒全帧种子不依赖Core Image内部切块顺序。原厂八种印片外观是ACES输出的另外一组资源,本轮五组胶片处理未使用这些资源,也不以相机F-Log名称冒充印片外观。
|
||||
@@ -3324,7 +3324,7 @@
|
||||
"key": "filmValueMode",
|
||||
"kind": "float",
|
||||
"max": 6,
|
||||
"min": 6,
|
||||
"min": 1,
|
||||
"offset": 1204,
|
||||
"pid": 2301,
|
||||
"step": 0.01,
|
||||
@@ -3591,7 +3591,7 @@
|
||||
"大鱼调色/Plugin/DYFilmMath.h": "e41d44790c6bb42db7c68520d442b39c381b4db4056d40a44426e21f62e9bf6b",
|
||||
"大鱼调色/Plugin/DYFilmTypes.h": "c35a43b5b93988e8517e5db8f281da0dfd1e02f5b0e7bfb62e7345cec444a36d",
|
||||
"大鱼调色/Plugin/DYModel.h": "80e88add97deeac7a9dc47d12f68b0245905786297de2e6553b3da15c729da6e",
|
||||
"大鱼调色/Plugin/DYModel.mm": "f430633aeb2e2680c3db83caf06ddd1b16e84173ecd4fb4d4b66afb5362ad4ea",
|
||||
"大鱼调色/Plugin/DYModel.mm": "48d0e8a36f41001c63e0f95faa99f8dd910b0227d7b93ff2a90006673c3e3c36",
|
||||
"大鱼调色/Plugin/DYSpiderState.h": "0c80747e41e8fc97762e301b011bd08c18865a825eaafde086ed79ace37b22f9",
|
||||
"大鱼调色/Plugin/DYToolState.h": "28088ec819307a60f2e52334fd807a514c3ff8a550bc0efbe7069b68a6242320",
|
||||
"大鱼调色/Plugin/DYToolState.mm": "6502e412532f2be2589188c1b99579ae59ab279d814805e38b0c8042e921a5bd",
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Isolated synthetic FCP acceptance; never edits a library or user media."""
|
||||
from pathlib import Path
|
||||
import json,uuid,xml.etree.ElementTree as E
|
||||
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
qa=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa')
|
||||
model=json.loads((root/'template/sources/RegisteredParameters.json').read_text())
|
||||
by_key={p['key']:p for p in model['parameters']}
|
||||
movie=qa/'大鱼调色_蒙版合成运动.mov'
|
||||
chart=qa/'大鱼调色验收图.png'
|
||||
assert movie.is_file() and chart.is_file()
|
||||
xml=E.Element('fcpxml',version='1.12');resources=E.SubElement(xml,'resources')
|
||||
E.SubElement(resources,'format',id='f1',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
|
||||
E.SubElement(resources,'format',id='f2',width='1920',height='1080',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
|
||||
E.SubElement(resources,'format',id='f3',width='1920',height='1080',name='FFVideoFormatRateUndefined')
|
||||
for ident,path,fmt,duration in [('a1',movie,'f1','4s'),('a2',chart,'f3','0s')]:
|
||||
asset=E.SubElement(resources,'asset',id=ident,name=path.stem,start='0s',duration=duration,format=fmt,hasVideo='1',videoSources='1')
|
||||
E.SubElement(asset,'media-rep',kind='original-media',src=path.resolve().as_uri())
|
||||
template=Path('/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef')
|
||||
E.SubElement(resources,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri())
|
||||
event=E.SubElement(E.SubElement(xml,'library'),'event',name='大鱼调色_1.5_胶片与通道验收',uid=str(uuid.uuid4()).upper())
|
||||
settings=[('大鱼调色_1.5_胶片与混合器','a1','f1',dict(mixer01=.2,filmSubtractive=1,filmGammaCyan=1.2,filmHalation=1,filmScatter=5,filmBloom=1,filmSensitivity=25,filmDiffusion=5,filmIntensity=25,filmGrain=1,filmGrainAmount=.25,filmGrainHold=2,filmVignette=1,filmVignetteIntensity=.5,filmVignetteRadius=30)),('大鱼调色_1.5_初始化与叠层','a1','f1',{}),('大鱼调色_1.5_颗粒时间验收','a2','f2',dict(filmGrain=1,filmGrainAmount=.65,filmGrainHold=2))]
|
||||
for name,asset,fmt,values in settings:
|
||||
project=E.SubElement(event,'project',name=name,uid=str(uuid.uuid4()).upper())
|
||||
sequence=E.SubElement(project,'sequence',format=fmt,duration='4s',tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k')
|
||||
spine=E.SubElement(sequence,'spine');clip=E.SubElement(spine,'video' if asset=='a2' else 'asset-clip',ref=asset,name=name,offset='0s',start='0s',duration='4s')
|
||||
effect=E.SubElement(clip,'filter-video',ref='fx',name='大鱼调色',enabled='1')
|
||||
# Hidden FxPlug IDs are not invented as Motion/FCPXML parameter paths.
|
||||
# Apply the intended settings through the formal native inspector in host QA.
|
||||
E.indent(xml);output=qa/'film-mixer-1.5.fcpxml'
|
||||
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'+E.tostring(xml,encoding='unicode')+'\n')
|
||||
print(output)
|
||||
@@ -12,7 +12,7 @@ using Floats=std::vector<float>;
|
||||
static id<MTLDevice> gpu;
|
||||
static id<MTLCommandQueue> queue;
|
||||
static CIContext *context;
|
||||
static const unsigned W=64,H=48;
|
||||
static unsigned W=64,H=48;
|
||||
static void require(bool p,NSString *m){if(!p)@throw [NSException exceptionWithName:@"FilmReference" reason:m userInfo:nil];}
|
||||
static float encode(float v){return v<=.0031308f?v*12.92f:1.055f*powf(fmaxf(0,v),1/2.4f)-.055f;}
|
||||
static float decode(float v){return v<=.04045f?v/12.92f:powf(fmaxf(0,(v+.055f)/1.055f),2.4f);}
|
||||
@@ -26,18 +26,22 @@ static void dispatch(id<MTLComputeCommandEncoder> e){[e dispatchThreads:MTLSizeM
|
||||
static Floats point(id<MTLLibrary> library,id<MTLTexture> src,id<MTLTexture> aux,DYUniforms u,int operation){id<MTLTexture>out=texture();id<MTLCommandBuffer>c=[queue commandBuffer];id<MTLComputeCommandEncoder>e=[c computeCommandEncoder];[e setComputePipelineState:pipeline(library,@"dyFilmPoint")];[e setTexture:src atIndex:0];[e setTexture:aux?:src atIndex:1];[e setTexture:out atIndex:2];[e setBytes:&u length:sizeof(u) atIndex:0];struct {int operation;float radius;unsigned frame,reserved;}p={operation,0,u.filmFrameKey,0};[e setBytes:&p length:sizeof(p) atIndex:1];dispatch(e);finish(c);return read(out);}
|
||||
static NSDictionary *difference(const Floats&a,const Floats&b){double maximum=0,sum=0;unsigned count=0,nonfinite=0,different=0;for(size_t i=0;i<a.size();i++){if(i%4==3)continue;if(a[(i/4)*4+3]<=0)continue;double d=fabs(a[i]-b[i]);if(!std::isfinite(d))nonfinite++;else{maximum=fmax(maximum,d);sum+=d*d;count++;if(d>1e-5)different++;}}return @{@"maximum":@(maximum),@"rms":@(sqrt(sum/fmax(1,count))),@"nonfinite":@(nonfinite),@"different":@(different)};}
|
||||
int main(int argc,const char **argv){@autoreleasepool{@try{
|
||||
require(argc==2,@"Usage: verify_film_reference /absolute/path/default.metallib");gpu=MTLCreateSystemDefaultDevice();queue=[gpu newCommandQueue];context=[CIContext contextWithMTLDevice:gpu options:@{kCIContextWorkingColorSpace:NSNull.null,kCIContextOutputColorSpace:NSNull.null}];NSError *error=nil;
|
||||
require(argc==2||argc==4,@"Usage: verify_film_reference /absolute/path/default.metallib [width height]");if(argc==4){W=atoi(argv[2]);H=atoi(argv[3]);require(W>0&&H>0&&W<=4096&&H<=4096,@"bounded reference dimensions");}gpu=MTLCreateSystemDefaultDevice();queue=[gpu newCommandQueue];context=[CIContext contextWithMTLDevice:gpu options:@{kCIContextWorkingColorSpace:NSNull.null,kCIContextOutputColorSpace:NSNull.null}];NSError *error=nil;
|
||||
id<MTLLibrary> dayu=[gpu newLibraryWithURL:[NSURL fileURLWithPath:@(argv[1])] error:&error];require(dayu!=nil,error.description);
|
||||
NSString *framework=@"/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/Frameworks/RenderingEngine.framework/Versions/A";
|
||||
require(dlopen([[framework stringByAppendingPathComponent:@"RenderingEngine"]fileSystemRepresentation],RTLD_NOW|RTLD_LOCAL)!=nullptr,@"load installed reference framework");
|
||||
id<MTLLibrary> original=[gpu newLibraryWithURL:[NSURL fileURLWithPath:[framework stringByAppendingPathComponent:@"Resources/metal_kernels.metallib"]] error:&error];require(original!=nil,error.description);
|
||||
Floats linear(W*H*4),encoded(linear.size());for(unsigned y=0;y<H;y++)for(unsigned x=0;x<W;x++){unsigned i=(y*W+x)*4;float a=(x%11==0)?0:(x%3==0?.25f:1);for(int k=0;k<3;k++){float c=float((x*17+y*23+k*71)%257)/256;if(x%17==0)c=k==0?1.3f:k==1?-.02f:c;linear[i+k]=float((__fp16)(decode(c)*a));encoded[i+k]=encode(a>0?linear[i+k]/a:0)*a;}linear[i+3]=encoded[i+3]=a;}
|
||||
Floats linear(W*H*4),encoded(linear.size());for(unsigned y=0;y<H;y++)for(unsigned x=0;x<W;x++){unsigned i=(y*W+x)*4;float a=(x%11==0&&W>1)?0:(x%3==0?.25f:1);for(int k=0;k<3;k++){float c=float((x*17+y*23+k*71)%257)/256;if(x%17==0)c=k==0?1.3f:k==1?-.02f:c;linear[i+k]=float((__fp16)(decode(c)*a));encoded[i+k]=encode(a>0?linear[i+k]/a:0)*a;}linear[i+3]=encoded[i+3]=a;}
|
||||
id<MTLTexture>source=texture(linear),codes=texture(encoded);Floats probe=render(image(source));require([difference(linear,probe)[@"maximum"]doubleValue]==0,@"CI bitmap orientation control");id<MTLTexture>roundtrip=texture();id<MTLCommandBuffer>roundtripCommands=[queue commandBuffer];[context render:image(source) toMTLTexture:roundtrip commandBuffer:roundtripCommands bounds:CGRectMake(0,0,W,H) colorSpace:nil];finish(roundtripCommands);require([difference(linear,read(roundtrip))[@"maximum"]doubleValue]==0,@"CI texture orientation control");NSMutableArray *rows=[NSMutableArray array];bool passed=true;
|
||||
auto check=[&](NSString*name,const Floats&a,const Floats&b,double tolerance){NSDictionary *d=difference(a,b);BOOL ok=[d[@"nonfinite"]intValue]==0&&[d[@"maximum"]doubleValue]<tolerance;NSMutableDictionary *r=[d mutableCopy];r[@"name"]=name;r[@"pass"]=@(ok);r[@"tolerance"]=@(tolerance);[rows addObject:r];passed&=ok;};
|
||||
DYUniforms u={};u.mixerMix=1;u.mixerRed=(DYFloat4){.75,.3,-.05,0};u.mixerGreen=(DYFloat4){.15,.85,0,0};u.mixerBlue=(DYFloat4){.05,-.1,1.05,0};u.film.gammaAll=u.film.gammaCyan=u.film.gammaMagenta=u.film.gammaYellow=1;u.film.valueMode=6;
|
||||
for(int options=0;options<4;options++){
|
||||
for(int matrixCase=0;matrixCase<3;matrixCase++){
|
||||
if(matrixCase==1)u.mixerRed=u.mixerGreen=u.mixerBlue=(DYFloat4){0,0,0,0};
|
||||
if(matrixCase==2)u.mixerRed=u.mixerGreen=u.mixerBlue=(DYFloat4){1.f/3,1.f/3,1.f/3,0};
|
||||
for(int options=0;options<4;options++){
|
||||
u.mixerPreserveLuma=options&1;u.mixerPreserveSaturation=(options>>1)&1;CIFilter *f=[[NSClassFromString(@"FTChannelMixerFilter")alloc]init];[f setDefaults];[f setValue:image(codes) forKey:kCIInputImageKey];[f setValue:[CIVector vectorWithX:u.mixerRed.x Y:u.mixerRed.y Z:u.mixerRed.z]forKey:@"inputRVector"];[f setValue:[CIVector vectorWithX:u.mixerGreen.x Y:u.mixerGreen.y Z:u.mixerGreen.z]forKey:@"inputGVector"];[f setValue:[CIVector vectorWithX:u.mixerBlue.x Y:u.mixerBlue.y Z:u.mixerBlue.z]forKey:@"inputBVector"];[f setValue:@(u.mixerPreserveLuma>0) forKey:@"inputPreserveLuma"];[f setValue:@(u.mixerPreserveSaturation>0)forKey:@"inputPreserveSaturation"];
|
||||
Floats expected=render(f.outputImage);for(size_t i=0;i<expected.size()/4;i++)for(int k=0;k<3;k++){float a=expected[i*4+3];expected[i*4+k]=a>0?decode(expected[i*4+k]/a)*a:0;}check([NSString stringWithFormat:@"original-mixer-options-%d",options],expected,point(dayu,source,nil,u,0),.00015);
|
||||
Floats expected=render(f.outputImage);for(size_t i=0;i<expected.size()/4;i++)for(int k=0;k<3;k++){float a=expected[i*4+3];expected[i*4+k]=a>0?decode(expected[i*4+k]/a)*a:0;}check([NSString stringWithFormat:@"original-mixer-case-%d-options-%d",matrixCase,options],expected,point(dayu,source,nil,u,0),.00015);
|
||||
}
|
||||
}
|
||||
for(int mode=1;mode<=2;mode++)for(float density:{-.4f,0.f,.65f})for(float gamma:{.75f,1.3f}){
|
||||
u.film.densityMode=mode;u.film.density=density;u.film.gammaAll=gamma;u.film.gammaCyan=1.2;u.film.gammaMagenta=.9;u.film.gammaYellow=1.1;CIFilter *f=[[NSClassFromString(@"FTFilmSaturationFilter")alloc]init];[f setDefaults];[f setValue:image(codes)forKey:kCIInputImageKey];[f setValue:@(gamma)forKey:@"gammaAll"];[f setValue:@1.2 forKey:@"gammaCyan"];[f setValue:@.9 forKey:@"gammaMagenta"];[f setValue:@1.1 forKey:@"gammaYellow"];[f setValue:@(density)forKey:@"density"];[f setValue:@(mode)forKey:@"densitySwitch"];
|
||||
@@ -56,9 +60,9 @@ int main(int argc,const char **argv){@autoreleasepool{@try{
|
||||
Floats actual=read(edges),expected=render(filter.outputImage);unsigned inside=0,border=0;for(unsigned y=0;y<H;y++)for(unsigned x=0;x<W;x++)if(expected[(y*W+x)*4+3]>0&&fabs(actual[(y*W+x)*4]-expected[(y*W+x)*4])>.01){if(x>=8&&x<W-8&&y>=8&&y<H-8)inside++;else border++;}fprintf(stderr,"bloom %.0f mismatches interior=%u border=%u\n",sensitivity,inside,border);check([NSString stringWithFormat:@"original-bloom-edge-sensitivity-%.0f",sensitivity],expected,actual,.00001);
|
||||
}
|
||||
for(unsigned seed:{0u,1u,7919u,0xffffffffu}){
|
||||
auto noise=[&](id<MTLLibrary>lib,NSString *name){id<MTLTexture>out=texture();id<MTLCommandBuffer>c=[queue commandBuffer];id<MTLComputeCommandEncoder>e=[c computeCommandEncoder];[e setComputePipelineState:pipeline(lib,name)];[e setTexture:out atIndex:0];[e setBytes:&seed length:4 atIndex:0];dispatch(e);finish(c);return out;};
|
||||
auto noise=[&](id<MTLLibrary>lib,NSString *name){id<MTLTexture>out=texture();id<MTLCommandBuffer>c=[queue commandBuffer];id<MTLComputeCommandEncoder>e=[c computeCommandEncoder];[e setComputePipelineState:pipeline(lib,name)];[e setTexture:out atIndex:0];[e setBytes:&seed length:4 atIndex:0];if([name isEqual:@"dyFilmNoise"]){unsigned bottom=0;[e setBytes:&bottom length:4 atIndex:1];}dispatch(e);finish(c);return out;};
|
||||
id<MTLTexture>ref=noise(original,@"BoxMullerPCG"),ours=noise(dayu,@"dyFilmNoise");check([NSString stringWithFormat:@"original-pcg-box-muller-%u",seed],read(ref),read(ours),.00002);
|
||||
for(float color:{0.f,.35f,1.f}){u.film.grainAmount=.5;u.film.grainSize=1;u.film.grainResponse=.4;u.film.grainColor=color;float corr=1-2*color,other=1-corr,norm=sqrtf(corr*corr+other*other);float params[9]={.4f,.6f,corr/norm,other/norm,corr/norm,other/norm,.025f,.025f,.025f};id<MTLTexture>referenceOutput=texture();id<MTLCommandBuffer>commands=[queue commandBuffer];id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:pipeline(original,@"GrainFilter")];[encoder setTexture:codes atIndex:0];[encoder setTexture:ref atIndex:1];[encoder setTexture:referenceOutput atIndex:2];[encoder setBytes:params length:sizeof(params) atIndex:0];dispatch(encoder);finish(commands);Floats expected=read(referenceOutput);for(size_t i=0;i<expected.size()/4;i++)for(int k=0;k<3;k++){float a=expected[i*4+3];expected[i*4+k]=a>0?decode(expected[i*4+k]/a)*a:0;}check([NSString stringWithFormat:@"original-grain-%u-%.2f",seed,color],expected,point(dayu,source,ours,u,4),.0002);}
|
||||
}
|
||||
NSDictionary *result=@{@"pass":@(passed),@"checks":@(rows.count),@"gpu":gpu.name,@"referenceVersion":@"ColorFinale 2.16.2 (625)",@"scope":@"Independent installed-reference CI/Metal output versus authored production Metal point kernels; source grayscale/color/HDR/negative and fractional-alpha vectors; reference frame seed is explicit.",@"results":rows};NSData *json=[NSJSONSerialization dataWithJSONObject:result options:NSJSONWritingPrettyPrinted|NSJSONWritingSortedKeys error:nil];fwrite(json.bytes,1,json.length,stdout);puts("");return passed?0:1;
|
||||
NSDictionary *result=@{@"pass":@(passed),@"checks":@(rows.count),@"width":@(W),@"height":@(H),@"gpu":gpu.name,@"referenceVersion":@"ColorFinale 2.16.2 (625)",@"scope":@"Independent installed-reference CI/Metal output versus authored production Metal point kernels; source grayscale/color/HDR/negative and fractional-alpha vectors; reference frame seed is explicit.",@"results":rows};NSData *json=[NSJSONSerialization dataWithJSONObject:result options:NSJSONWritingPrettyPrinted|NSJSONWritingSortedKeys error:nil];fwrite(json.bytes,1,json.length,stdout);puts("");return passed?0:1;
|
||||
}@catch(NSException *e){fprintf(stderr,"%s\n",e.reason.UTF8String);return 2;}}}
|
||||
@@ -1,13 +1,31 @@
|
||||
{
|
||||
"status": "development-checkpoint",
|
||||
"status": "ready-for-formal-delivery",
|
||||
"baseline": "1.4.3 (33)",
|
||||
"nativePass": true,
|
||||
"checks": 346,
|
||||
"checks": 349,
|
||||
"referenceComparison": {
|
||||
"pass": true,
|
||||
"checks": 38,
|
||||
"maxLinearRGBError": 0.0001327991485595703,
|
||||
"scope": "Independent installed-reference CI/Metal output versus authored production Metal point kernels; source grayscale/color/HDR/negative and fractional-alpha vectors; reference frame seed is explicit."
|
||||
"passed": true,
|
||||
"checks": 184,
|
||||
"dimensions": [
|
||||
[
|
||||
64,
|
||||
48
|
||||
],
|
||||
[
|
||||
63,
|
||||
47
|
||||
],
|
||||
[
|
||||
1,
|
||||
17
|
||||
],
|
||||
[
|
||||
17,
|
||||
1
|
||||
]
|
||||
]
|
||||
},
|
||||
"formalInstallUnchanged": true
|
||||
"formalInstallUnchanged": true,
|
||||
"targetVersion": "1.5.0",
|
||||
"targetBuild": "34"
|
||||
}
|
||||
文件差异过大,未显示。
加载差异
+1691
-336
文件差异过大,未显示。
加载差异
@@ -22,6 +22,8 @@
|
||||
value.film.mix=0;bypass=filmRender(value,nil,[NSString stringWithFormat:@"film-stage-%d-zero-mix",stage]);run.record([NSString stringWithFormat:@"film-stage-%d-zero-is-exact",stage],difference(before,bypass).maximum==0);
|
||||
value.film.mix=1;value.film.enabled=0;bypass=filmRender(value,nil,[NSString stringWithFormat:@"film-stage-%d-eye-off",stage]);run.record([NSString stringWithFormat:@"film-stage-%d-eye-preserves-old-frame",stage],difference(before,bypass).maximum==0);
|
||||
}
|
||||
DYUniforms originGrain=neutral;originGrain.film.enabled=1;originGrain.film.grainEnabled=1;originGrain.film.grainAmount=.7;originGrain.filmFrameKey=31;
|
||||
Pixels topGrain=filmRender(originGrain,nil,@"grain-top-origin-render"),bottomInput(input.size());for(NSUInteger y=0;y<height;y++)memcpy(bottomInput.data()+y*width*4,input.data()+(height-1-y)*width*4,width*8);uploadFilm(bottomInput);[source setDiagnosticImageOrigin:kFxImageOrigin_BOTTOM_LEFT];Pixels bottomGrain=filmRender(originGrain,nil,@"grain-bottom-origin-render");run.record(@"grain-canonical-coordinates-survive-texture-origin",difference(topGrain,bottomGrain).maximum==0,measure(difference(topGrain,bottomGrain)));[source setDiagnosticImageOrigin:kFxImageOrigin_TOP_LEFT];uploadFilm(input);
|
||||
CMTime duration=CMTimeMake(1001,30000),origin=CMTimeMake(17,3);BOOL rational=YES;
|
||||
for(int i=-12;i<=12;i++){CMTime t=CMTimeAdd(origin,CMTimeMultiply(duration,i));rational&=DYFilmFrameIndex(t,duration,origin)==i;for(int hold=1;hold<=5;hold++)rational&=DYFilmFrameKey(i,hold,0)==(uint32_t)(int64_t)floor(double(i)/hold);}
|
||||
rational&=DYFilmFrameIndex(CMTimeMake(-1,1000000),duration,kCMTimeZero)==-1;
|
||||
|
||||
@@ -14,8 +14,8 @@ kernel void dyFilmPoint(texture2d<float,access::read> source [[texture(0)]],text
|
||||
float amount=pass.operation==0?uniforms.mixerMix:1;
|
||||
pixel.rgb=dyLimit((c*(1-amount)+result*amount)*pixel.a);output.write(pixel,pos);
|
||||
}
|
||||
kernel void dyFilmNoise(texture2d<float,access::write> output [[texture(0)]],constant uint& seed [[buffer(0)]],uint2 pos [[thread_position_in_grid]]){
|
||||
if(pos.x>=output.get_width()||pos.y>=output.get_height())return;output.write(float4(dyFilmNormal(pos.x,pos.y,seed),1),pos);
|
||||
kernel void dyFilmNoise(texture2d<float,access::write> output [[texture(0)]],constant uint& seed [[buffer(0)]],constant uint& bottomOrigin [[buffer(1)]],uint2 pos [[thread_position_in_grid]]){
|
||||
if(pos.x>=output.get_width()||pos.y>=output.get_height())return;uint y=bottomOrigin?output.get_height()-1-pos.y:pos.y;output.write(float4(dyFilmNormal(pos.x,y,seed),1),pos);
|
||||
}
|
||||
// Separable form of the reference's sparse 5x5 prefilter: same 25 weighted
|
||||
// samples, followed by its 3x3 vector Sobel norm. Only two 5-tap passes.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
if(DYFilmGrainActive(u.film)){
|
||||
id<MTLTexture>noise=texture(2);if(!noise)return fail(error,@"无法分配颗粒缓冲区");
|
||||
id<MTLComputeCommandEncoder>ce=[commands computeCommandEncoder];[ce setComputePipelineState:entry[@"dyFilmNoise"]];[ce setTexture:noise atIndex:0];[ce setBytes:&u.filmFrameKey length:4 atIndex:0];[ce dispatchThreads:MTLSizeMake(noise.width,noise.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
|
||||
id<MTLComputeCommandEncoder>ce=[commands computeCommandEncoder];[ce setComputePipelineState:entry[@"dyFilmNoise"]];[ce setTexture:noise atIndex:0];[ce setBytes:&u.filmFrameKey length:4 atIndex:0];unsigned bottom=source.imageOrigin==kFxImageOrigin_BOTTOM_LEFT;[ce setBytes:&bottom length:4 atIndex:1];[ce dispatchThreads:MTLSizeMake(noise.width,noise.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
|
||||
if(u.film.grainSize>1){id<MTLTexture>smooth=texture(3);if(!smooth)return fail(error,@"无法分配颗粒扩散缓冲区");
|
||||
// Reference radius=2. Recover the same sigma search without frame state.
|
||||
double sigma=1,step=1;for(int iteration=0;iteration<20000;iteration++){double density=exp(-4/(sigma*sigma))/(sigma*sigma*6.283185307179586);if(.02/5<density){if(step<=.02)break;sigma-=step;step*=.1;}sigma+=step;if(sigma>1000){sigma=1;break;}}
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
FE(subtractiveEnabled,@"filmSubtractive",@"启用减色",0);
|
||||
FR(gammaAll,@"filmGammaAll",@"整体减色",.25,4,1,0);FR(gammaCyan,@"filmGammaCyan",@"青色减色",.25,4,1,0);FR(gammaMagenta,@"filmGammaMagenta",@"洋红减色",.25,4,1,0);FR(gammaYellow,@"filmGammaYellow",@"黄色减色",.25,4,1,0);FR(density,@"filmDensity",@"密度",-1,1,0,0);
|
||||
NSMutableDictionary *density=FR(densityMode,@"filmDensityMode",@"密度模式",1,2,2,0);density[@"kind"]=@"popup";density[@"values"]=@[@2,@1];density[@"options"]=@[@"模式 1 · 最大值",@"模式 2 · 平均值"];
|
||||
row(@"filmValueMode",@"胶片亮度模型",offsetof(DYUniforms,film)+offsetof(DYFilmSettings,valueMode),6,6,6,@"float");
|
||||
row(@"filmValueMode",@"胶片亮度模型",offsetof(DYUniforms,film)+offsetof(DYFilmSettings,valueMode),1,6,6,@"float");
|
||||
FE(halationEnabled,@"filmHalation",@"启用晕光",1);FR(scatter,@"filmScatter",@"散射半径",0,100,5,1);FR(dyeTransmission,@"filmTransmission",@"染料透射",0,100,0,1);FR(boost,@"filmBoost",@"晕光增强",0,5,1,1);
|
||||
FE(bloomEnabled,@"filmBloom",@"启用辉光",2);FR(sensitivity,@"filmSensitivity",@"辉光灵敏度",0,100,50,2);FR(diffusion,@"filmDiffusion",@"辉光扩散",0,100,30,2);FR(intensity,@"filmIntensity",@"辉光强度",0,100,50,2);
|
||||
FE(grainEnabled,@"filmGrain",@"启用颗粒",3);FR(grainAmount,@"filmGrainAmount",@"颗粒数量",0,1,0,3);FR(grainSize,@"filmGrainSize",@"颗粒大小",1,20,1,3);FR(grainResponse,@"filmGrainResponse",@"胶片响应",-1,1,0,3);FR(grainColor,@"filmGrainColor",@"颜色变化",0,1,0,3);
|
||||
|
||||
@@ -194,6 +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,请保存完整预设。");
|
||||
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.4.3</string>
|
||||
<string>1.5.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>33</string>
|
||||
<string>34</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.4.3</string>
|
||||
<string>1.5.0</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>className</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.3</string>
|
||||
<string>1.5.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>33</string>
|
||||
<string>34</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户