Initial commit: Minecraft 光追着色器包(从零实现的 path tracing)

This commit is contained in:
WpyQwq
2026-09-19 12:06:22 +08:00
commit 59e30822f8
314 changed files with 9259 additions and 0 deletions
@@ -0,0 +1,44 @@
// MinecraftPT — Dof_FS
// Depth of field with circle of confusion bokeh.
#include "/Lib/Settings.glsl"
#include "/Lib/Utilities.glsl"
#include "/Lib/IndividualFunctions/DOF.glsl"
uniform sampler2D colortex12;
layout(location = 0) out vec4 colorOut;
void main(){
vec2 texelCoord = gl_FragCoord.xy;
vec3 color = texelFetch(colortex12, ivec2(texelCoord), 0).rgb;
#ifdef DOF
if (DOF > 0){
float depth = texelFetch(depthtex0, ivec2(texelCoord), 0).r;
// Focal distance (from center depth or manual)
float focalDepth = CAMERA_FOCAL_POINT;
#ifdef CAMERA_FOCUS_MODE
if (CAMERA_FOCUS_MODE == 1){
vec2 center = screenSize * 0.5;
focalDepth = texelFetch(depthtex0, ivec2(center), 0).r;
}
#endif
float coc = GetCoC(depth, focalDepth);
#ifdef DISABLE_HAND_DOF
// Skip hand (close depth)
if (depth < 0.1) coc = 0.0;
#endif
if (coc > 0.5){
color = DofBlur(texelCoord, coc);
}
}
#endif
colorOut = vec4(color, 1.0);
}