Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Luna5ama/alpha-piscium/llms.txt

Use this file to discover all available pages before exploring further.

Alpha Piscium’s rendering pipeline is organized as a sequence of discrete GPU stages that execute every frame. It begins with one-time and per-frame initialization, proceeds through geometry and shadow rendering, and then runs an extensive chain of 85 compute shader dispatches — the composite passes — to produce the final image. Each stage builds on data from the previous one, with the composite chain handling everything from global illumination and atmospheric scattering to tone mapping and anti-aliasing.
Every numbered composite pass (e.g. composite15.csh) corresponds to exactly one compute shader dispatch. Some passes are conditionally enabled or disabled at runtime based on user settings — for example, water caustics passes are skipped entirely when caustics are turned off.

Stage Overview

1
Setup Passes — setup1.csh through setup6.csh
2
The setup passes run once when the shader pack is first loaded. They are responsible for initializing all persistent GPU state that remains valid for the lifetime of the session.
3
Tasks performed across these six compute dispatches include:
4
  • Clearing and initializing all framebuffer textures to known states (formats include RGBA8, RGBA16F, RGBA32UI, RGB10A2, and R32F)
  • Initializing the global data buffer (InitGlobalData.comp.glsl) with constants such as color space transforms, precomputed LUT parameters, and frame counters
  • Preparing lookup table (LUT) textures used throughout the pipeline
  • 5
    Because these passes only run on load, they add no per-frame cost during gameplay.
    6
    7
    Begin Passes — begin1.csh through begin6.csh
    8
    The begin passes execute at the start of every frame, before any geometry is rendered. They update all per-frame CPU-driven and temporally-evolving GPU data.
    9
    Key work performed:
    10
  • begin1 / begin1_a / begin1_b — Render the atmosphere look-up tables: transmittance, sky view, and multi-scattering LUTs that feed the atmospheric scattering system. Sub-passes _a and _b handle slice-by-slice updates.
  • begin2 / begin2_a / begin2_b / begin2_c — Update the cloud ambient LUT for the cumulus cloud layer, integrating sky irradiance for cloud self-shadowing.
  • begin3 / begin3_a — Update the global data buffer (UpdateGlobalData.comp.glsl) with per-frame values: camera position, sun/moon direction, time-of-day, TAA jitter, and previous-frame matrices.
  • begin4 / begin4_a — Clear per-frame screen-space buffers and reset the environment probe accumulation target.
  • begin5 — Clear and prepare the RTWSM importance map buffer (ClearRTWSM) so it is ready to receive importance data during geometry rendering.
  • begin6 (Voxy only, conditionally enabled) — Perform any Voxy-specific per-frame initialization for distant terrain integration.
  • 11
    12
    Shadow Pass — shadow.vsh/gsh/fsh + shadowcomp1.csh
    13
    The shadow pass renders scene geometry from the sun’s point of view into the shadow map, which is subsequently sampled during the composite stage using RTWSM-warped coordinates and PCSS filtering.
    14
    Five geometry programs participate:
    15
    ProgramDescriptionshadow.vsh/gsh/fshSolid terrain geometryshadow_block.vsh/gsh/fshBlock entities (chests, signs, etc.)shadow_cutout.vsh/gsh/fshCutout geometry (leaves, grass, fences)shadow_water.vsh/gsh/fshWater surface for refraction datashadow_entities.vsh/gsh/fshEntities (mobs, players, dropped items)
    16
    After the geometry passes, shadowcomp1.csh runs a compute post-process to derive water surface normals from the shadow-space water geometry. These normals are later used when computing water caustics and subsurface light transmission.
    17
    The shadow map resolution is configurable (default 2048×2048, up to 4096×4096) and the shadow render distance extends up to 32 chunks.
    18
    19
    GBuffer Passes — gbuffers_*
    20
    The G-buffer passes render the visible scene from the camera’s perspective and write material and geometric data into multiple render targets for deferred shading during the composite stage.
    21

    Terrain

    gbuffers_terrain_solid, gbuffers_terrain_cutout, gbuffers_terrain — solid and cutout terrain blocks with PBR material data.

    Water

    gbuffers_water, gbuffers_hand_water — water surface geometry with animated normals and transparency data.

    Entities & Blocks

    gbuffers_entities, gbuffers_block, gbuffers_armor_glint, gbuffers_beaconbeam — entities, block entities, and special effects.

    Particles & Weather

    gbuffers_particles, gbuffers_particles_translucent, gbuffers_weather — particles and weather (rain/snow) overlays.

    Hands

    gbuffers_hand — the player’s held item and arms, rendered separately with a modified depth range.

    Sky & Misc

    gbuffers_skybasic, gbuffers_skytextured, gbuffers_clouds, gbuffers_basic, gbuffers_textured, gbuffers_textured_lit, gbuffers_spidereyes — sky dome and miscellaneous lit geometry.
    22
    When Distant Horizons or Voxy is active, additional passes render the extended terrain:
    23
  • dh_terrain.vsh/fsh — Distant Horizons terrain geometry
  • dh_water.vsh/fsh — Distant Horizons water
  • dh_shadow.vsh/gsh/fsh — Distant Horizons shadow geometry
  • voxy_opaque.glsl / voxy_translucent.glsl — Voxy LOD geometry for opaque and translucent surfaces
  • 24
    25
    Composite Passes — composite1.csh through composite85.csh
    26
    The composite stage is the heart of Alpha Piscium’s rendering. All 85 passes are compute shaders, enabling flexible memory access patterns and efficient workgroup tiling. The passes are ordered so that later passes can consume the outputs of earlier ones.
    27

    Voxy Merge (composite1)

    When Voxy support is enabled (composite1 is conditionally active), the Voxy LOD colour and depth data are merged into the main screen-space buffers (VoxyMerge.glsl). This blends distant Voxy geometry seamlessly with the vanilla render.
    28

    HiZ Generation (composite2)

    HiZGen builds a hierarchical Z (depth) pyramid from the current G-buffer depth. Each level stores the minimum depth in a 2×2 footprint, enabling efficient ray-marching in the screen-space GI tracing passes.
    29

    GI Denoiser Edge Classification & Dilation (composite3–4)

    GIDenoiserEdgeClassification and GIDenoiserEdgeDilation build an edge mask from the G-buffer that prevents the spatial denoiser blur from crossing geometric discontinuities such as object silhouettes and depth transitions.
    30

    GI Denoiser Reproject (composite5)

    GIDenoiserReproject reprojects the previous denoised GI frame using current-frame motion vectors and accumulates temporal history per pixel.
    31

    Environment Probe Update — Reproject & Dilate (composite6–7)

    EnvProbeUpdate1ReprojectScatter reprojects the previous frame’s environment probe and scatters new sky radiance. EnvProbeUpdate2ReprojectDilate (pass 1) dilates valid probe texels to fill gaps from reprojection.
    32

    Shadow Sample Setup (composite8)

    ShadowSampleSetup precomputes per-pixel shadow UVs and blocker distances in RTWSM-warped shadow space, preparing data for the shadow sampling passes later in the pipeline.
    33

    Screen Pixel Size Evaluation (composite9)

    EvaluateScreenPixelSize computes per-pixel screen-space footprint information used later for adaptive sampling decisions in the GI and shadow systems.
    34

    Water Caustics (composite10–12)

    Enabled only when SETTING_WATER_CAUSTICS is defined. Three passes implement a photon-tracing approach:
    1. composite10CausticsPhotonTrace: traces photons from the sun through the animated water surface.
    2. composite11CausticsRemap: remaps photon landing positions into screen space.
    3. composite12CausticsFilter: filters the photon splat buffer to produce smooth caustic patterns.
    35

    Volumetric Clouds (composite13–14)

    Enabled when SETTING_CLOUDS_CU is defined. RenderVolumetric (composite13) renders the cumulus cloud layer using the Nubis technique, with physically-based in-scattering and self-shadowing. Accum (composite14) accumulates and upscales the cloud render.
    36

    Shadow Sampling — SSS (composite15)

    ShadowSampleSSS applies PCSS filtering and subsurface scattering shadow transmission (conditionally enabled for high SST step counts).
    37

    Sky Composite (composite16)

    SkyComposite blends the rendered sky (using the precomputed sky-view LUT from the begin passes) into pixels not covered by opaque geometry, and handles the sun disc and moon.
    38

    Shadow Sampling — Main (composite17)

    ShadowSample applies PCSS percentage-closer filtering across the computed penumbra radius to produce soft, contact-hardening shadows.
    39

    Environment Probe Update — Dilate Pass 2 (composite18)

    A second dilation pass (EnvProbeUpdate2ReprojectDilate, pass 2) continues filling probe gaps before the gather step.
    40

    Direct Lighting (composite19)

    DirectLighting evaluates direct sun/moon/sky illumination for every G-buffer pixel, incorporating the shadow visibility computed in the RTWSM/PCSS passes, the atmospheric transmittance from the sky LUTs, and PBR specular/diffuse BRDFs.
    41

    Environment Probe Update — Gather & Project (composite20–21)

    EnvProbeUpdate3ReprojectGather gathers irradiance into the environment probe. EnvProbeUpdate4ProjectCurrent projects the result for use this frame, providing a temporally-stable sky irradiance fallback for pixels with insufficient GI screen-space history.
    42

    DoF Auto-Focus (composite22)

    Conditionally active when DoF is enabled and manual focus is off. DOFFocus reads the depth at the screen centre and feeds an exponentially smoothed focal distance to the DoF pass later in the pipeline.
    43

    ReSTIR GI — Initial Sample (composite23–25)

    The first stage of ReSTIR SSGI:
    • composite23GIReSTIRInitalSampleRayGenTrace: generates candidate ray directions and traces them using the HiZ pyramid.
    • composite24GIReSTIRInitalSampleRaySort: sorts rays for improved GPU coherence.
    • composite25GIReSTIRInitalSampleRayFinishTrace: completes ray tracing after the sort.
    44

    ReSTIR GI — Temporal Reuse & Decorrelate (composite26–27)

    GIReSTIRTemporalReuse (composite26) reprojects the previous frame’s reservoirs onto the current frame and merges them with the new initial samples, up to the configured temporal reuse limit. GIReSTIRDuplicationMapDecorrelate (composite27) reduces structured noise via duplication-map decorrelation.
    45

    ReSTIR GI — Spatial Reuse (composite28–35)

    Eight spatial reuse passes (composite28composite35), each running GIReSTIRPairedSpatialReuse, gather samples from neighbouring pixels. The number of active passes is controlled by SETTING_GI_SPATIAL_REUSE_COUNT.
    46

    ReSTIR GI — Shading & Ray Sort (composite36–38)

    GIReSTIRPairedSpatialShade (composite36) evaluates the final weighted GI contribution from the merged reservoir and writes the indirect irradiance buffer. GIReSTIRSpatialReuseRaySort (composite37) and GIReSTIRSpatialReuseTrace (composite38) perform an additional ray sort and trace pass for spatial reuse quality.
    47

    GI Denoising — ReBLUR (composite39–44)

    The ReBLUR denoiser cleans the noisy raw ReSTIR output across several passes:
    • Accumulate (GIDenoiserAccum, composite39) — blends current and history with adaptive weighting.
    • Anti-Firefly (GIDenoiserAntiFireFly, composite40, optional) — suppresses bright outlier samples via RCRS.
    • GI Mip (GIDenoiserGIMip, composite41) — builds auxiliary mip data for the spatial filter.
    • History Fix (GIDenoiserHistoryFix, composite42) — repairs disoccluded regions that lack valid temporal history.
    • Blur (GIDenoiserBlur, composite43) and Post-Blur (GIDenoiserPostBlur, composite44) — apply the main and secondary spatial blur passes (optional).
    48

    Volumetrics Depth Layers (composite46)

    VolumetricsDepthLayers computes the depth layering needed for local volumetric fog and atmospheric in-scattering integration.
    49

    Atmospheric Scattering — Epipolar (composite47–48)

    Volumetric light scattering through the atmosphere using epipolar sampling:
    • composite47EpipolarScatteringAir: integrates in-scattering along air segments emanating from the sun’s screen-space position.
    • composite48EpipolarScatteringWater: integrates in-scattering through water volumes.
    50

    Translucent Compositing (composite49–51)

    Three passes composite the translucent geometry layer (water, glass, stained glass) over the opaque scene:
    • TranslucentBackComposite (composite49) — blends back-face translucent contributions.
    • TranslucentSST (composite50) — applies screen-space tracing for refraction beneath translucent surfaces.
    • TranslucentComposite (composite51) — blends front-face translucent contributions with absorption-based tinting.
    51

    RTWSM Importance Map Collapse (composite52)

    IMapCollapse collapses the RTWSM importance map built during geometry rendering, preparing the warp function for the next frame’s shadow pass.
    52

    Volumetrics Local Composite Break Fix (composite53)

    VolumetricLocalCompositeBreakFix (optional, SETTING_DEPTH_BREAK_CORRECTION) corrects depth-break artifacts at geometry edges in the volumetric local composite.
    53

    Depth of Field — Prepare (composite54)

    Active when SETTING_DOF is defined. DOFPrepare tiles the depth buffer and classifies pixels as in-focus or bokeh candidates for the physically-based circle-of-confusion blur using the focal distance from the auto-focus pass (composite22) or a user-set manual value.
    54

    TAA — Prepare & Resolve (composite55–56)

    Temporal Anti-Aliasing runs in two compute passes:
    1. TAAPrepare (TAAPrepare.comp.glsl, composite55) — computes motion vectors and prepares neighbourhood colour clamping bounds.
    2. TAAResolve (TAAResolve.comp.glsl, composite56) — reprojects the previous accumulated frame, blends with the current frame using adaptive clamping, and outputs the resolved TAA result.
    55

    FXAA & RCAS Sharpening (composite57–58)

    FXAA (FXAA.comp.glsl, composite57) smooths any remaining sub-pixel aliasing. Robust Contrast Adaptive Sharpening (RCAS.comp.glsl, composite58) then recovers fine detail softened by TAA.
    56

    Bloom (composite59–77)

    A multi-pass bloom chain progressively downsamples (composite59–68, passes 1–10) and then upsamples (composite69–77, passes 10–2) the bright regions of the scene to produce a soft glow.
    57

    Post Composite (composite78)

    PostComposite assembles bloom, Purkinje effect, and exposure into the final tone-mapped image, applying the AgX-inspired display render transform for colour management.
    58

    Exposure — Mip & Gather (composite79–80)

    ExposureMip (composite79) builds a luminance mip chain and ExposureGather (composite80) computes the final auto-exposure value with a configurable adaptation curve.
    59

    Overlay Composite (composite81)

    OverlayComposite applies Minecraft’s overlay effects (damage flash, night-vision tint, darkness vignette, etc.) over the full composited scene.
    60

    RTWSM Warp Finalization (composite82–84)

    Three passes finalize the RTWSM warp for the next frame’s shadow pass: IMapBlur (composite82) blurs the importance map, GetWarp (composite83) derives the 1D warp function, and Write2DWarp (composite84) bakes it into a 2D lookup texture.
    61

    Final Global Data Update (composite85)

    FinalGlobalDataUpdate writes end-of-frame values (such as the updated exposure and TAA history pointers) into the global data buffer for use next frame.
    62
    63
    Final Pass — final.vsh / final.fsh
    64
    The final pass is a simple full-screen triangle that copies the composited, tone-mapped, and sharpened result from the last framebuffer texture to the display. It also handles any necessary colour-space conversion and applies the user’s colour management settings.

    Pass Dependency Graph

    The table below summarises which major systems feed which downstream passes:
    Upstream StageConsumed By
    Begin atmosphere LUTsShadow sampling, direct lighting, sky composite
    RTWSM importance map (begin5)Shadow geometry warp (shadow pass)
    Shadow map (shadow pass)Shadow sample setup & sampling (composite8, 15, 17)
    G-buffer depth/normals/albedoHiZ generation, ReSTIR GI, direct lighting, DoF
    HiZ pyramid (composite2)ReSTIR GI ray tracing (composite23–38)
    GI denoiser reproject (composite5)GI accumulate (composite39)
    ReSTIR irradiance (composite36)ReBLUR denoiser (composite39–44)
    Denoised GI (composite39–44)Direct lighting composite (composite19)
    Direct + indirect lightingTranslucent composite, sky composite
    Full composited imageTAA (composite55–56), DoF (composite54), bloom (composite59–77)
    TAA outputFXAA/RCAS (composite57–58), bloom, post composite
    Use the in-game performance profiles (Low → Insane) to scale the most expensive passes — spatial reuse count, shadow map resolution, bloom passes, and denoiser spatial filter — to match your hardware.

    Build docs developers (and LLMs) love