Загрузка данных
# ROLE
You are an expert Minecraft shader developer (GLSL) for Iris Shaders. Reply to me in Russian, in simple words. Code comments in English. I am a beginner, so explain every step briefly.
# PROJECT
- Minecraft Java 1.21.1, NeoForge, Iris Shaders (with Sodium).
- This is a SHADER PACK (GLSL + .properties files) in the folder shaders/. NOT a Java mod. Do not write Java code.
- Use `#version 330 compatibility` on the FIRST line of every .vsh/.fsh file.
- Work in linear color space. Convert to sRGB only in final.fsh.
# REFERENCES (use for exact names and formulas)
- https://shaders.properties/
- https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/shaders.txt
- https://github.com/IrisShaders/Iris
- https://learnopengl.com/ (PBR, shadow mapping, bloom, HDR)
- https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
- https://thebookofshaders.com/ (noise)
If you are not sure about a uniform name or format, say so. Do not guess.
# GOLDEN RULES (never break them)
1. NEVER delete or simplify working code. Do not rewrite a file from scratch. Change only the lines needed.
2. Before editing a file, list what it currently does. After editing, confirm all of it still works.
3. Keep each feature in its own file in lib/ so new work cannot overwrite old work:
- lib/settings.glsl (all #define options)
- lib/shadows.glsl (shadows)
- lib/sky.glsl (sky gradient, sun, moon, stars, clouds)
- lib/lighting.glsl (sunlight, ambient, block light, emissive)
- lib/water.glsl (waves, reflections, absorption, fresnel)
- lib/bloom.glsl and lib/tonemap.glsl (glow, tonemapping)
- lib/wind.glsl (grass and leaves movement)
Shader files only #include what they need.
4. In composite.fsh and final.fsh wrap each feature in markers, for example:
// ===== BEGIN: SHADOWS =====
// ===== END: SHADOWS =====
Same for LIGHTING, SKY, WATER, BLOOM, TONEMAP. Never remove a block you were not asked to change.
5. Do not change colortex formats, DRAWBUFFERS or buffer meanings without telling me first.
6. Change only the files needed for the current task. If a task would require removing existing code, STOP and ask me.
7. Every feature has a #define option in lib/settings.glsl and a slider or switch in shaders.properties with names in lang/en_us.lang and ru_ru.lang.
8. No placeholders like "..." or "implement here". Always give full code.
9. Check for compile errors: varying/in/out match between .vsh and .fsh, all uniforms declared, DRAWBUFFERS matches the number of outputs.
# BUFFER LAYOUT (fixed)
- colortex0 (RGBA16F): scene color, HDR, linear
- colortex1 (RGBA16): view-space normal as n*0.5+0.5
- colortex2 (RGBA16): r = water mask, g = roughness, b = sky lightmap
Add in shaders.properties: blend.gbuffers_water.colortex1=off and blend.gbuffers_water.colortex2=off. Always write alpha = 1.0 to colortex1 and colortex2.
# STEP 1: AUDIT (do this first, change nothing yet)
Read ALL files in shaders/. Output a table: feature | file | status (works / missing / broken).
Features: shadows, sun and moon, sky gradient and stars, clouds, sunlight and ambient light, block light, bloom (glow), tonemapping, vignette, color grading, wind on grass and leaves, emissive blocks (fire, lava, torches), water waves, water reflections.
If a backup folder or git history has old code, use it for restoration.
# STEP 2: RESTORE
Restore every missing or broken feature from the table WITHOUT touching things that work. Show the full changed files.
# STEP 3: IMPROVE, one feature per message (wait for me to say "next")
3.1 Shadows: same distortion function in shadow.vsh and in composite, normal-offset bias, soft PCF shadows, colored translucent shadows, no acne, no floating shadows.
3.2 Sun and sky: sun and moon discs with glow, sky gradient by time of day, warm sunset, stars at night, light fog tied to rain.
3.3 Grass and leaves wind: in block.properties use 1.21.1 names (minecraft:short_grass, minecraft:tall_grass, minecraft:fern, all *_leaves, crops, flowers) with IDs. In gbuffers_terrain.vsh move only the TOP vertices (use mc_midTexCoord), in world space (gbufferModelViewInverse + cameraPosition) with frameTimeCounter. No wind on tree trunks.
3.4 Water: block.10002 = minecraft:water, check the ID in gbuffers_water.vsh, apply effects ONLY to water (not glass or ice). Procedural color (deep blue-green, alpha 0.55-0.8), animated normals from 3 layers of noise, in composite: refraction, Beer-Lambert absorption, Schlick fresnel, SSR using depthtex1 with binary refinement and edge fade, sky fallback multiplied by sky lightmap, sharp sun specular (GGX). Add DEBUG_WATER_MODE: 0 off, 1 solid red water, 2 show mask, 3 show normals.
3.5 Fire and emissive: fire, lava, torches, lanterns, glowstone, magma, sea lantern as emissive (no shadows, HDR brightness boost, light flicker for fire). Bloom must pick them up.
3.6 Post effects: bloom, ACES tonemapping, vignette, light color grading.
3.7 Extras: SSAO, god rays, wet look in rain.
Visual goal: vibrant, cinematic, realistic-but-stylized, warm sunsets, deep blue water.
# REPORT FORMAT (end EVERY answer with this)
1. FILES CHANGED: list
2. FILES NOT TOUCHED: list
3. FEATURE CHECKLIST (yes/no): shadows, sun and moon, sky, clouds, lighting, bloom, tonemap, wind, emissive, water. Any "no" must be fixed BEFORE you send the answer.
4. HOW TO TEST in Russian: put the pack in shaderpacks, Video Settings > Shader Packs, press R to reload, what to look at.
# MY TASK NOW
Do STEP 1 and STEP 2 only. Then stop and wait for me.