PageSourceSearch

https://raymarched-relic-field.vercel.app/assets/imageProcessingFunctions-Bf0nQcr9.js

js raymarched-relic-field.vercel.app collected 2026-10-03 07:37:42 UTC 4,830 bytes, 89 lines download raw bytes

1import{f as e}from"./math.scalar.functions-BWXNux-o.js";import{t}from"./shaderStore-D-XQlhUT.js";var n=e({imageProcessingFunctions:()=>a}),r=`imageProcessingFunctions`,i=`#if defined(COLORGRADING) && !defined(COLORGRADING3D)
2/** 
3* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL.
4* sampler3dSetting.x=textureOffset (0.5/textureSize).
5* sampler3dSetting.y=textureSize.
6*/
7#define inline
8vec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)
9{float sliceSize=2.0*sampler3dSetting.x; 
10#ifdef SAMPLER3DGREENDEPTH
11float sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;
12#else
13float sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;
14#endif
15float sliceInteger=floor(sliceContinuous);float sliceFraction=sliceContinuous-sliceInteger;
16#ifdef SAMPLER3DGREENDEPTH
17vec2 sliceUV=color.rb;
18#else
19vec2 sliceUV=color.rg;
20#endif
21sliceUV.x*=sliceSize;sliceUV.x+=sliceInteger*sliceSize;sliceUV=saturate(sliceUV);vec4 slice0Color=texture2D(colorTransform,sliceUV);sliceUV.x+=sliceSize;sliceUV=saturate(sliceUV);vec4 slice1Color=texture2D(colorTransform,sliceUV);vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);
22#ifdef SAMPLER3DBGRMAP
23color.rgb=result.rgb;
24#else
25color.rgb=result.bgr;
26#endif
27return color;}
28#endif
29#if TONEMAPPING==3
30const float PBRNeutralStartCompression=0.8-0.04;const float PBRNeutralDesaturation=0.15;vec3 PBRNeutralToneMapping( vec3 color ) {float x=min(color.r,min(color.g,color.b));float offset=x<0.08 ? x-6.25*x*x : 0.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if (peak<PBRNeutralStartCompression) return color;float d=1.-PBRNeutralStartCompression;float newPeak=1.-d*d/(peak+d-PBRNeutralStartCompression);color*=newPeak/peak;float g=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(color,newPeak*vec3(1,1,1),g);}
31#endif
32#if TONEMAPPING==2
33const mat3 ACESInputMat=mat3(
34vec3(0.59719,0.07600,0.02840),
35vec3(0.35458,0.90834,0.13383),
36vec3(0.04823,0.01566,0.83777)
37);const mat3 ACESOutputMat=mat3(
38vec3( 1.60475,-0.10208,-0.00327),
39vec3(-0.53108, 1.10813,-0.07276),
40vec3(-0.07367,-0.00605, 1.07602)
41);vec3 RRTAndODTFit(vec3 v)
42{vec3 a=v*(v+0.0245786)-0.000090537;vec3 b=v*(0.983729*v+0.4329510)+0.238081;return a/b;}
43vec3 ACESFitted(vec3 color)
44{color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=saturate(color);return color;}
45#endif
46#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
47vec4 applyImageProcessing(vec4 result) {
48#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
49#ifdef EXPOSURE
50result.rgb*=exposureLinear;
51#endif
52#ifdef VIGNETTE
53vec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;vec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);float vignetteTerm=dot(vignetteXY1,vignetteXY1);float vignette=pow(vignetteTerm,vignetteSettings2.w);vec3 vignetteColor=vignetteSettings2.rgb;
54#ifdef VIGNETTEBLENDMODEMULTIPLY
55vec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);result.rgb*=vignetteColorMultiplier;
56#endif
57#ifdef VIGNETTEBLENDMODEOPAQUE
58result.rgb=mix(vignetteColor,result.rgb,vignette);
59#endif
60#endif
61#if TONEMAPPING==3
62result.rgb=PBRNeutralToneMapping(result.rgb);
63#elif TONEMAPPING==2
64result.rgb=ACESFitted(result.rgb);
65#elif TONEMAPPING==1
66const float tonemappingCalibration=1.590579;result.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);
67#endif
68result.rgb=toGammaSpace(result.rgb);result.rgb=saturate(result.rgb);
69#ifdef CONTRAST
70vec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);if (contrast<1.0) {result.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);} else {result.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);}
71result.rgb=max(result.rgb,0.);
72#endif
73#ifdef COLORGRADING
74vec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;
75#ifdef COLORGRADING3D
76vec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;
77#else
78vec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;
79#endif
80result.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);
81#endif
82#ifdef COLORCURVES
83float luma=getLuminance(result.rgb);vec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));vec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;result.rgb*=colorCurve.rgb;result.rgb=mix(vec3(luma),result.rgb,colorCurve.a);
84#endif
85#ifdef DITHER
86float rand=getRand(gl_FragCoord.xy*vInverseScreenSize);float dither=mix(-ditherIntensity,ditherIntensity,rand);result.rgb=saturate(result.rgb+vec3(dither));
87#endif
88#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
89return result;}`;t.IncludesShadersStore[r]||(t.IncludesShadersStore[r]=i);var a={name:r,shader:i};export{n,a as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.