DANIR ULTIMATE SHADER 1.0.14
=========================

Target
------
Minecraft Java Edition 1.21.11
Fabric Loader
Iris 1.10.7
Sodium 0.8.7
Default performance target: RTX 4060 Ti, 1080p, stable 120 FPS where the
world, render distance, resource packs and other mods permit it.

IMPORTANT HONEST TEST STATUS
----------------------------
The complete source was expanded, syntax-checked and stage-linked with
glslangValidator in the default, LOW and CINEMATIC-style configurations.
All debug branches were also compiled. It was not possible to launch Minecraft
in the build environment, so this implementation is logically and statically
checked but still needs testing inside Minecraft with Iris 1.10.7.

Version 1.0.1 fixes NVIDIA compilation errors caused by RGBA16F/RGBA8 format
directives being exposed as GLSL identifiers. They are now block-commented in
the Iris-supported form and the validator no longer injects format-name stubs.

Version 1.0.2 removes legacy ftransform() calls from every vertex path. Iris
otherwise expands that helper through gl_Vertex while also binding its internal
iris_Position input, which can make the NVIDIA linker report an attribute
location collision, most visibly in the LINES program.

Version 1.0.3 is the visual-correction build based on real in-game screenshots.
It raises readable blue moonlight, replaces stretched stars with small round
points, adds surface detail to the Sun and Moon, reshapes clouds to remove the
white horizon band, and gives the End a dedicated deep-purple cosmic pipeline.
Explicit dimension.properties mappings work around the Minecraft 1.21.11 Iris
dimension-selection issue.

Version 1.0.4 fixes the water/transparency defects visible in the next in-game
screenshots. Water now rejects fragments behind closer opaque geometry, measures
depth along the camera ray, uses stronger depth absorption, and composes Fresnel
reflection without making foreground blocks or held items look ghost-like. The
cloud layer is thicker and uses rounded, vertically varying cumulus towers with
soft cauliflower erosion, brighter tops and self-shadowed bases.

Version 1.0.5 disabled the beacon-beam pass during the first investigation of
the blown-out white wedge and replaced the sky-only cloud slab with depth-aware
volumetric ray marching. Clouds now use true 3D density, warped coverage,
high-frequency erosion, front-to-back absorption and internal lighting. They
render both below and above the camera and can correctly appear in front of
distant terrain.

Version 1.0.6 separates the Overworld day and night skies. Volumetric clouds
fade away after sunset and skip their ray march during full night, then return
smoothly at dawn. The unobstructed night sky gains a procedural Milky Way with
a broad stellar band, dark dust lane, warm galactic core, blue/violet nebulosity
and denser colour-varied star clusters.

Version 1.0.7 filters the animated diagonal stripe and translucent planes of
Minecraft's world border. Iris routes that geometry through gbuffers_textured,
where the old opaque deferred path made it solid and massively overbright. The
shader identifies only MC_RENDER_STAGE_WORLD_BORDER and discards it; ordinary
particles remain intact. A later screenshot proved the separate vertical white
column still required another fix.

Version 1.0.8 removed the suspected beacon and old screen-space God-ray paths,
then added the successful animated End-portal material. A later screenshot
proved that the Sun-aligned white column had a different source.

Version 1.0.9 fixes that source directly. Terrain fog had sampled the complete
HDR sky after flattening every view direction toward the horizon. Near sunrise
or sunset, every terrain pixel sharing the Sun's azimuth therefore sampled the
small HDR Sun disc, stretching it into a screen-tall white blade. Fog now uses a
separate bounded atmosphere-only colour with no Sun, Moon or stars. The normal
sky keeps its detailed celestial bodies, and the working End portal is unchanged.

Version 1.0.10 fixes the crushed, over-coloured blocks and the apparently split
first-person arm visible in the next screenshots. Linear cave/night ambient and
a luminance-preserving contrast curve retain dark texture detail instead of
clipping it to black; deep-shadow chroma control keeps isolated blue/green texels
from becoming neon. Opaque hand pixels now carry a dedicated G-buffer mask, skip
world-shadow sampling and receive a stable dimension-aware fill light. The
translucent-hand path receives the same visibility floor. The Sun-fog beam fix,
volumetric clouds, night sky and animated End portal remain unchanged.

Version 1.0.11 FINAL balances the over-bright 1.0.10 night and restores vanilla-
style visibility inside powdered snow. Moon direct light, night ambient, cave
fill and the Milky Way are reduced without restoring clipped black shadows. Iris
reports powdered snow through isEyeInWater value 3; that previously unhandled
medium now applies an immediate pale blue-grey veil to the hand and nearby blocks
and reaches effectively opaque fog within two blocks. The vanilla frost border,
fixed hand shading, removed Sun-fog blade, clouds and End portal are preserved.

Version 1.0.12 fixes the remaining water and Milky-Way screenshots. Default
surface opacity rises from about 24% to 58%, depth absorption is faster and deep
water approaches 95% opacity, so a whole lake bed is no longer immediately
visible. Water now reflects only bounded atmosphere: the full HDR Sun, Moon,
stars and galaxy cannot be copied onto its surface. A single capped Sun glint is
broken into small moving highlights by crossing ripple normals. The Milky Way is
rebuilt as a narrower tilted great-circle arc with fine stellar grain, a thin
continuous dust lane, a restrained warm core and no giant purple cloud holes.

Version 1.0.13 restores the exact wider blue-violet Milky Way from 1.0.11 at
the user's request, including its original orientation, mottled structure,
broken dust and clustered stars. The solid first-person hand pass now disables
alpha blending and forces accepted base-layer pixels opaque. This prevents a
custom skin's partial PNG alpha from mixing the already rendered landscape into
the arm, while the separate translucent held-object pass remains available.

Version 1.0.14 removes the artificial first-person brightness floor from both
opaque and translucent hand programs. Iris renders the hand and every held
block/item through these same programs, so the old floor made grass, dirt,
tools and other objects glow inside a sealed dark room. Hand and held-object
brightness now follows their actual sky/block light, while the v1.0.13 opaque
alpha fix still prevents the landscape from showing through the arm.

Installation
------------
1. Keep DanirUltimateShader_v1.0.14.zip as a ZIP; do not unpack it unless
   you want to edit the source.
2. Press Win+R, enter %appdata%\.minecraft\shaderpacks and press Enter.
3. Copy the ZIP into shaderpacks.
4. Start Fabric 1.21.11 with Iris 1.10.7 and Sodium 0.8.7.
5. Open Options > Video Settings > Shader Packs.
6. Select DanirUltimateShader_v1.0.14.zip. Remove or deselect older copies
   with browser suffixes such as (8), (9) or (10) so Iris cannot load an earlier
   build by mistake.
7. Start with the HIGH preset. If the frame rate is below 120, choose MEDIUM.
8. Iris shader reload shortcut is normally R; use the Shader Packs screen if
   another mod has changed that key.

Rendering architecture
----------------------
1. G-buffer geometry programs preserve Minecraft textures, biome tint, vertex
   colour, alpha and light coordinates. The incompatible translucent world
   border is filtered by Iris render stage before it can corrupt opaque depth or
   HDR colour. Scene colour is stored in a linear HDR RGBA16F buffer. Normals and
   material/light data use compact RGBA8 buffers.
2. deferred.fsh reconstructs player-space position from depth, applies readable
   linear ambient, sun/moon diffuse light, warm block light, held light, wet
   specular highlights, emissive materials and soft shadow-map filtering. A
   dedicated first-person mask prevents the hand from inheriting world shadows.
3. gbuffers_water runs after deferred lighting. It keeps transparent rendering
   separate, rejects water hidden behind opaque geometry, adds multi-frequency
   waves, ray-depth absorption, premultiplied Fresnel sky reflection, sun glints
   and underwater-aware opacity.
4. composite.fsh renders the procedural sky where depth is empty, ray-marches
   clouds against scene depth so they can cover distant terrain, then adds
   dimension fog from a bounded atmosphere-only colour and a sky-only Sun halo.
   HDR celestial discs are never reused as terrain fog.
5. composite1-3 implement half-resolution bright-pass and separable bloom.
6. final.fsh combines bloom, applies one exposure/colour-grade/tone-map pass,
   uses a non-clipping luminance contrast curve, then performs one linear-to-sRGB
   conversion.

Coordinate spaces
-----------------
Texture space: atlas UV and lightmap UV in all G-buffer passes.
View space: interpolated vertex positions and reconstructed depth positions.
Player space: world-aligned positions relative to the camera; normals, lighting,
water waves and shadow transforms use this space.
Shadow space: player position -> shadow view -> shadow clip -> distorted shadow UV.
Screen space: depth, bounded Sun halo, bloom and final colour processing.

Dimension handling
------------------
The three vanilla dimensions are explicitly mapped in dimension.properties and
each receives a compile-time dimension ID. This avoids the Minecraft 1.21.11
Iris bug that can choose Overworld shaders for the End after Mojang's dimension
skybox changes:
- Overworld: detailed Sun/Moon, daytime volumetric clouds, round stars and a
  cloud-free procedural Milky Way at night.
- Nether: crimson volcanic haze, no Sun, Moon or Overworld clouds.
- End: deep-purple void, violet nebulae and coloured stars, with no Overworld
  atmosphere or clouds.
The root pipeline keeps a cloud-height and Iris-uniform fallback for unmapped
or modded dimensions.

Presets and expected cost
-------------------------
LOW: 1024 shadow map, 4 PCF taps, no custom clouds, no Sun glow, no bloom,
fast water. Cheapest profile.
MEDIUM: 1536 shadows, fast 6-step volume clouds, safe Sun glow and
half-resolution bloom.
HIGH: 2048 shadows, 9 PCF taps, 12-step volumetric clouds, balanced water,
safe Sun glow and half-resolution bloom. Default RTX 4060 Ti target.
ULTRA: 3072 shadows, 16 PCF taps, 20-step clouds and high water.
CINEMATIC: 4096 shadows, 25 PCF taps, maximum clouds and stronger bloom.
Intended for screenshots; it is not a 120 FPS preset.

The largest costs are shadow distance/resolution, PCF sample count and cloud
marching. Bloom is cheaper because both blur buffers are half resolution. The
old God-ray depth-sampling loop no longer exists; its option controls only the
bounded sky glow.

First in-game test checklist
----------------------------
Overworld day: block textures, biome grass, leaves/cutouts, hand and entities.
Sunrise/sunset: warm horizon, long soft shadows, rays between trees.
Night: cloud-free readable blue darkness, Milky Way, round stars, moonlight and
warm torches.
Water: no chunk-edge gaps, reasonable opacity, reflections only at grazing
angles, stable slow waves, correct water behind glass.
Weather: cooler scene, denser fog, darker clouds, wet highlights, visible torches.
Nether: no blue sky, sun, moon or white Overworld clouds; lava must bloom.
End: purple cosmic background and fog; no Overworld clouds.
Special: stained glass, ice, leaves, particles, armour glint, animated End
portal/gateway surface, Nether portal, player hand and block-breaking overlay.
Beacon beams and the world-border wall are intentionally hidden.

Debug views
-----------
Shader Pack Settings > Debug Views:
1 normals, 2 depth, 3 raw shadow map, 4 lit HDR scene, 5 block light,
6 sky light, 7 water mask, 8 bloom, 9 fog amount. Leave at 0 for normal play.

Troubleshooting
---------------
WHITE SCREEN
- Select LOW, set Bloom off, Exposure 1.0, Debug View 0, then reload shaders.
- If LOW works, re-enable Bloom and Safe Sun Glow separately.

BLACK SCREEN OR INVISIBLE TERRAIN
- Confirm the ZIP contains shaders/ directly at its root.
- Confirm exact Fabric/Iris/Sodium versions above.
- Open latest.log and search for "Shader compilation failed" or "Invalid program".
- In Iris debug mode, inspect .minecraft/patched_shaders for the patched file.

MISSING TEXTURES / BROKEN CUTOUTS
- Disable resource packs, especially packs that change render layers or use a
  custom PBR format, then reload.
- Check leaves, grass and flowers with Debug View 1 and 5/6.

SHADOW ACNE OR DETACHED SHADOWS
- Lower Shadow Distance before increasing resolution.
- Try SHADOW_QUALITY 1 to distinguish filter problems from map projection.
- Very low sun angles are the hardest case for a single distorted shadow map.

FLICKERING SHADOWS
- Reduce Shadow Distance to 96 or 128.
- Avoid combining this pack with mods that alter camera projection or shadow
  matrices until tested independently.

WATER IS WRONG
- Set Water Quality 1, disable Water Waves, then reload.
- Disable resource packs and translucency-altering mods.
- Water uses sky-based reflection, not screen-space ray tracing; objects outside
  the screen are intentionally represented by atmosphere fallback.

BLOOM IS TOO STRONG
- Raise Bloom Threshold or lower Bloom Intensity. Bloom never feeds itself and
  is clamped by final tone mapping.

NETHER/END HAS THE WRONG ATMOSPHERE
- Confirm hasSkylight/hasCeiling is not being changed by a dimension mod.
- Test the same dimension without dimension-overhaul mods.

LOW FPS
- Select MEDIUM or LOW.
- First reduce Shadow Distance, then Shadow Resolution and Cloud Quality.
- Reduce Minecraft render distance and entity distance.
- Do not use CINEMATIC for normal gameplay.

HAND OR ENTITIES LOOK WRONG
- Disable custom entity models/resource packs for one test.
- Set Debug View 5 and 6 to check received block/sky light.

Logs and useful files
---------------------
Minecraft log: .minecraft\logs\latest.log
Iris patched shader output in debug mode: .minecraft\patched_shaders\
Settings source: shaders/lib/settings.glsl
Menu layout: shaders/shaders.properties
Block/emissive mapping: shaders/block.properties

No full global illumination or path tracing is claimed. Held light is a local
screen-space lighting approximation. Reflections are procedural sky reflections,
chosen for stability and the 120 FPS target.
