├── .gitignore ├── .gitattributes ├── shaders ├── gbuffers_basic.fsh ├── gbuffers_basic.vsh ├── gbuffers_block.fsh ├── gbuffers_block.vsh ├── gbuffers_clouds.fsh ├── gbuffers_clouds.vsh ├── gbuffers_hand.fsh ├── gbuffers_hand.vsh ├── gbuffers_weather.fsh ├── gbuffers_weather.vsh ├── gbuffers_beaconbeam.fsh ├── gbuffers_beaconbeam.vsh ├── gbuffers_hand_water.fsh ├── gbuffers_hand_water.vsh ├── gbuffers_skytextured.vsh ├── gbuffers_textured.fsh ├── gbuffers_textured.vsh ├── gbuffers_textured_lit.fsh ├── gbuffers_textured_lit.vsh ├── gbuffers_water.fsh ├── gbuffers_water.vsh ├── gbuffers_terrain.fsh ├── gbuffers_terrain.vsh ├── gbuffers_entities.fsh ├── gbuffers_entities.vsh ├── gbuffers_skybasic.fsh ├── gbuffers_skybasic.vsh ├── gbuffers_skytextured.fsh ├── composite.vsh ├── composite1.vsh ├── composite5.vsh ├── composite6.vsh ├── composite7.vsh ├── composite6.fsh ├── composite5.fsh ├── block.properties ├── entity.properties ├── composite7.fsh ├── lib │ ├── gbuffers.vsh │ ├── gbuffers.fsh │ ├── iris.glsl │ ├── blur.h │ ├── settings.h │ ├── text.glsl │ └── terminus.glsl ├── composite1.fsh ├── lang │ ├── zh_CN.lang │ └── en_us.lang ├── shaders.properties └── composite.fsh ├── TODO.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /shaders/gbuffers_basic.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_basic.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_block.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_block.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_clouds.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_clouds.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_hand.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_hand.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_weather.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_weather.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_beaconbeam.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_beaconbeam.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_hand_water.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_hand_water.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_skytextured.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_textured.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_textured.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_textured_lit.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_textured_lit.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_water.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | #define GBUFFERS_WATER 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_water.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | #define GBUFFERS_WATER 3 | #include "/lib/settings.h" 4 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_terrain.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | #define GBUFFERS_TERRAIN 3 | 4 | #include "/lib/settings.h" 5 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_terrain.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_TERRAIN 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_entities.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_ENTITIES 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_entities.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_ENTITIES 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_skybasic.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_SKYBASIC 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/gbuffers_skybasic.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_SKYBASIC 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.vsh" -------------------------------------------------------------------------------- /shaders/gbuffers_skytextured.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #define GBUFFERS_SKYTEXTURED 4 | 5 | #include "/lib/settings.h" 6 | #include "/lib/gbuffers.fsh" -------------------------------------------------------------------------------- /shaders/composite.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | in vec2 vaUV0; 6 | 7 | out vec2 uv; 8 | 9 | void main() { 10 | gl_Position = ftransform(); 11 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 12 | } -------------------------------------------------------------------------------- /shaders/composite1.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | in vec2 vaUV0; 6 | 7 | out vec2 uv; 8 | 9 | void main() { 10 | gl_Position = ftransform(); 11 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 12 | } -------------------------------------------------------------------------------- /shaders/composite5.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | in vec2 vaUV0; 6 | 7 | out vec2 uv; 8 | 9 | void main() { 10 | gl_Position = ftransform(); 11 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 12 | } -------------------------------------------------------------------------------- /shaders/composite6.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | in vec2 vaUV0; 6 | 7 | out vec2 uv; 8 | 9 | void main() { 10 | gl_Position = ftransform(); 11 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 12 | } -------------------------------------------------------------------------------- /shaders/composite7.vsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | in vec2 vaUV0; 6 | 7 | out vec2 uv; 8 | 9 | void main() { 10 | gl_Position = ftransform(); 11 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 12 | } -------------------------------------------------------------------------------- /shaders/composite6.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | uniform sampler2D colortex1; 6 | in vec2 uv; 7 | 8 | #include "/lib/blur.h" 9 | 10 | /* RENDERTARGETS:1 */ 11 | void main() { 12 | 13 | vec3 color = gaussianVertical(colortex1, uv); 14 | 15 | gl_FragData[0] = vec4(color, 1.0); 16 | } -------------------------------------------------------------------------------- /shaders/composite5.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | uniform sampler2D colortex0; 6 | in vec2 uv; 7 | 8 | #include "/lib/blur.h" 9 | 10 | /* RENDERTARGETS:1 */ 11 | void main() { 12 | 13 | vec3 color = gaussianHorizontal(colortex0, uv); 14 | 15 | gl_FragData[0] = vec4(color, 1.0); 16 | } -------------------------------------------------------------------------------- /shaders/block.properties: -------------------------------------------------------------------------------- 1 | # TRANSLUCENTS 2 | # ============ 3 | block.1002 = minecraft:water 4 | block.1003 = minecraft:nether_portal 5 | block.1004 = minecraft:white_stained_glass minecraft:light_gray_stained_glass minecraft:gray_stained_glass minecraft:black_stained_glass minecraft:brown_stained_glass minecraft:red_stained_glass minecraft:orange_stained_glass minecraft:yellow_stained_glass minecraft:lime_stained_glass minecraft:green_stained_glass minecraft:cyan_stained_glass minecraft:light_blue_stained_glass minecraft:blue_stained_glass minecraft:purple_stained_glass minecraft:magenta_stained_glass minecraft:pink_stained_glass 6 | block.1005 = minecraft:tinted_glass -------------------------------------------------------------------------------- /shaders/entity.properties: -------------------------------------------------------------------------------- 1 | # Hostile 2 | entity.2001 = blaze bogged breeze cave_spider creeper drowned elder_guardian ender_dragon enderman endermite evoker ghast giant guardian hoglin husk illusioner magma_cube phantom \ 3 | piglin piglin_brute pillager pufferfish ravager shulker shulker_bullet silverfish skeleton slime spider stray vex vindicator warden witch wither wither_skeleton zoglin \ 4 | zombie zombie_villager zombified_piglin 5 | 6 | # Neutral/Friendly 7 | entity.2002 = allay armadillo axolotl bat bee camel cat chicken cod cow dolphin donkey fox frog glow_squid goat horse iron_golem llama mooshroom mule ocelot panda parrot pig \ 8 | polar_bear rabbit salmon sheep skeleton_horse snow_golem squid strider tadpole trader_llama tropical_fish turtle villager wandering_trader wolf 9 | 10 | # Players 11 | entity.2003 = player 12 | 13 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | ### HUD based on uniforms 4 | * Iris-exclusive `currentPlayerHealth` and `maxPlayerHealth` uniforms, among [others][uniforms] 5 | * Draw a segmented health bar based on `currentPlayerHealth / maxPlayerHealth` 6 | * Text akin to a console? 7 | * Oscilloscope overlay/Hasselblad [reseau grid w/ fiducials][reticules] 8 | * Option to invert `hideGui` 9 | 10 | ### Pixel size 11 | * Virtualize large pixels 12 | * Options `Horizontal` and `Vertical` resolution as well as border size 13 | * Options for RGB subpixels and/or chromatic dispersion 14 | * See Builder's code for reference 15 | 16 | ### Entity Radar 17 | * Option to show through blocks 18 | 19 | [reticules]: http://www.clavius.org/photoret.html 20 | [uniforms]: https://github.com/IrisShaders/Iris/blob/1.18.2/src/main/java/net/coderbot/iris/uniforms/IrisExclusiveUniforms.java#L25-L32 -------------------------------------------------------------------------------- /shaders/composite7.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | 5 | uniform sampler2D colortex0; 6 | uniform sampler2D colortex1; 7 | uniform sampler2D colortex2; 8 | const bool colortex2Clear = false; 9 | // const int colortex0Format = RGBA16F; 10 | // const int colortex1Format = RGBA16F; 11 | // const int colortex2Format = RGBA16F; 12 | uniform float frameTime; 13 | in vec2 uv; 14 | 15 | /* RENDERTARGETS: 0,2 */ 16 | void main() { 17 | 18 | vec3 color = texture2D(colortex0, uv).rgb; 19 | vec3 bloom = texture2D(colortex1, uv).rgb; 20 | 21 | color = color + mix(color, bloom, BLOOM_MIX); 22 | color = clamp(color, 0.0, 1.0); 23 | 24 | #ifdef GHOSTING 25 | vec3 prevFrame = texture2D(colortex2, uv).rgb; 26 | prevFrame = mix(color, prevFrame, exp2(-32.0 * frameTime)); 27 | color = mix(color, prevFrame, 0.5); 28 | gl_FragData[1] = vec4(prevFrame, 1.0); 29 | #endif 30 | 31 | gl_FragData[0] = vec4(color, 1.0); 32 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VECTOR 2 | Minecraft on an Oscilloscope 3 | 4 | ## Features 5 | - Retro Computing effects 6 | - PBR Resource Pack support 7 | - Highly customisable 8 | - Fine-tuned Presets 9 | 10 | ## Requirements 11 | - Recent Optifine or Iris 12 | - Minecraft 1.17 or later 13 | - May partially work on earlier versions 14 | 15 | ## Known Issues 16 | - With PBR Resource packs, lines may become very dense. Increase or disable `[LINE NORMAL THRESHOLD]` in `[LINE SHAPE]` settings. 17 | - With long render distances, far away details may become very dense. Decrease render distance, or increase/disable `[LINE NORMAL THRESHOLD]` in `[LINE SHAPE]` settings. 18 | - **On Iris**, entity circle shadows appear square and may jitter depending on the viewing angle. Disable entity shadows in Iris/Sodium settings. 19 | - Under certain conditions the sun or moon may appear to have a large outline. Disable sun/moon in the Optifine/Iris/Sodium settings. 20 | - **On Optifine**, the PLAYER HUD option cannot be used. If a player toggles it on, a warning will be shown. 21 | -------------------------------------------------------------------------------- /shaders/lib/gbuffers.vsh: -------------------------------------------------------------------------------- 1 | in vec2 vaUV0; 2 | in vec2 mc_midTexCoord; 3 | in vec4 at_tangent; 4 | 5 | #if defined(GBUFFERS_ENTITIES) && defined(ENTITY_RADAR) 6 | uniform int entityId; 7 | flat out int entityMask; 8 | #endif 9 | 10 | out vec2 mid_uv; 11 | out vec2 uv; 12 | out mat3 tbn; 13 | 14 | #if defined(GBUFFERS_TERRAIN) || defined(GBUFFERS_WATER) 15 | in vec4 vaColor; 16 | in vec3 vaPosition; 17 | #ifdef GBUFFERS_WATER 18 | attribute vec3 mc_Entity; 19 | out float blockID; 20 | #endif 21 | #endif 22 | 23 | void main() { 24 | gl_Position = ftransform(); 25 | // gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; 26 | uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; 27 | mid_uv = mc_midTexCoord - 0.01; 28 | 29 | vec3 normal = gl_NormalMatrix * gl_Normal; 30 | vec3 tangent = normalize(gl_NormalMatrix * at_tangent.xyz); 31 | tbn = mat3(tangent, cross(tangent, normal) * sign(at_tangent.w), normal); 32 | 33 | #if defined GBUFFERS_TERRAIN || defined GBUFFERS_WATER 34 | vertex_color = gl_Color.rgb; 35 | #endif 36 | 37 | #ifdef GBUFFERS_WATER 38 | blockID = mc_Entity.x; 39 | #endif 40 | 41 | 42 | #if defined(GBUFFERS_ENTITIES) && defined(ENTITY_RADAR) 43 | entityMask = entityId - 2000; 44 | #endif 45 | } -------------------------------------------------------------------------------- /shaders/lib/gbuffers.fsh: -------------------------------------------------------------------------------- 1 | in vec2 uv; 2 | in vec2 mid_uv; 3 | in mat3 tbn; 4 | uniform sampler2D gtexture; 5 | uniform sampler2D normals; 6 | uniform sampler2D colortex0; 7 | uniform float alphaTestRef; 8 | uniform mat4 gbufferModelViewInverse; 9 | 10 | const bool gtextureMipmapEnable = true; 11 | 12 | #if defined(GBUFFERS_ENTITIES) && defined(ENTITY_RADAR) 13 | flat in int entityMask; 14 | #endif 15 | 16 | #if defined(GBUFFERS_TERRAIN) || defined(GBUFFERS_WATER) 17 | in vec3 vertex_color; 18 | #endif 19 | #ifdef GBUFFERS_WATER 20 | in float blockID; 21 | #endif 22 | 23 | /* RENDERTARGETS:0,3 */ 24 | void main() { 25 | #ifdef GBUFFERS_SKYTEXTURED 26 | discard; 27 | #endif 28 | vec3 color = textureLod(gtexture, mid_uv, 3.0).rgb; 29 | vec3 normal = texture(normals, uv).xyz; 30 | float alpha = texture(gtexture, uv).a; 31 | 32 | normal = normal * 2.0 - 1.0; 33 | normal = tbn * normal; 34 | normal = mat3(gbufferModelViewInverse) * normal; 35 | 36 | 37 | #if defined(GBUFFERS_TERRAIN) || defined(GBUFFERS_WATER) 38 | color *= vertex_color; 39 | #endif 40 | if (alpha < alphaTestRef) discard; 41 | 42 | #if defined GBUFFERS_WATER && defined SEE_THROUGH_GLASS 43 | if(blockID == 1004 || blockID == 1005) discard; // Stained glass + tinted glass 44 | #endif 45 | 46 | 47 | #ifdef GBUFFERS_SKYBASIC 48 | color = vec3(0.5); 49 | #endif 50 | 51 | 52 | 53 | float entity = 1.0; 54 | 55 | #if defined(GBUFFERS_ENTITIES) && defined(ENTITY_RADAR) 56 | entity = entityMask == 1 ? 0.1 : entity; // Hostile mobs 57 | entity = entityMask == 2 ? 0.2 : entity; // Friendly mobs 58 | entity = entityMask == 3 ? 0.3 : entity; // Players 59 | #endif 60 | 61 | gl_FragData[0] = vec4(color, 1.0); 62 | gl_FragData[1] = vec4(normal, entity); 63 | } -------------------------------------------------------------------------------- /shaders/composite1.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/text.glsl" 5 | 6 | uniform sampler2D colortex0; 7 | in vec2 uv; 8 | 9 | uniform float far; 10 | uniform float frameTimeCounter; 11 | 12 | // from Builderb0y 13 | vec2 distort(vec2 coord) { 14 | const vec2 CURVATURE = vec2(CURVATURE_X, CURVATURE_Y); 15 | const vec2 BARREL_SCALE = 1.0 - (0.23 * CURVATURE); 16 | coord -= 0.5; 17 | coord *= 1.0 + CURVATURE * dot(coord, coord); 18 | coord *= BARREL_SCALE; 19 | return coord + 0.5; 20 | } 21 | 22 | /* RENDERTARGETS:0 */ 23 | void main() { 24 | vec2 uv_curved = distort(uv); 25 | 26 | vec3 color = vec3(0.0); 27 | #ifdef THICKER_LINES 28 | color = texture2D(colortex0, uv_curved).rgb; 29 | vec2 offset = pixelSize * vec2(0, 1); 30 | color = max(color, texture2D(colortex0, uv_curved + offset).rgb); 31 | offset = pixelSize * vec2(0, -1); 32 | color = max(color, texture2D(colortex0, uv_curved + offset).rgb); 33 | offset = pixelSize * vec2(1, 0); 34 | color = max(color, texture2D(colortex0, uv_curved + offset).rgb); 35 | offset = pixelSize * vec2(-1, 0); 36 | color = max(color, texture2D(colortex0, uv_curved + offset).rgb); 37 | #else 38 | color = texture2D(colortex0, uv_curved).rgb; 39 | #endif 40 | 41 | float colorBrightness = dot(color, vec3(1.0)); 42 | color = colorBrightness > 0.01 ? color : USER_BG_COLOR; 43 | 44 | if(uv_curved.x < 0.0 || uv_curved.x > 1.0) { color = vec3(0.0); } 45 | if(uv_curved.y < 0.0 || uv_curved.y > 1.0) { color = vec3(0.0); } 46 | 47 | #ifdef SCANLINES 48 | bool scanline = int(gl_FragCoord.y) % 3 == 0; 49 | 50 | #if SCAN_SIZE != 0 51 | int scan_speed = int(viewHeight) / SCAN_SPEED; 52 | int currentScanLine = int(viewHeight) - int(frameTimeCounter * scan_speed) % int(viewHeight); 53 | int proximityToCurrentLine = SCAN_SIZE - clamp(abs(int(gl_FragCoord.y) - currentScanLine), 0, SCAN_SIZE); 54 | float brightnessMul = float(proximityToCurrentLine) / float(SCAN_SIZE) + 1.0; 55 | color *= scanline ? 0.0 : brightnessMul; 56 | #else 57 | color *= scanline ? 0.0 : 1.0; 58 | #endif 59 | 60 | 61 | // color = vec3(0.0, brightnessMul - 1.0, 0.0); 62 | // color = int(gl_FragCoord.y) == currentScanLine ? vec3(1.0, 0.0, 0.0) : color; 63 | #endif 64 | 65 | // color = texture2D(colortex0, uv).rgb; 66 | 67 | gl_FragData[0] = vec4(color, 1.0); 68 | } -------------------------------------------------------------------------------- /shaders/lib/iris.glsl: -------------------------------------------------------------------------------- 1 | #include "/lib/text.glsl" 2 | 3 | void showWarning(inout vec3 color, float frameTimeCounter) { 4 | 5 | const float fontSize = 0.5; // smaller number = bigger text 6 | beginText(ivec2(gl_FragCoord.xy * fontSize), ivec2(20, viewHeight * fontSize - 30)); 7 | text.fgCol = vec4(USER_COLOR, 1.0); 8 | text.bgCol = vec4(vec3(0.0), 1.0); 9 | // VECTOR ©️ Imperion Inc. 2023 10 | printString((_V, _E, _C, _T, _O, _R, _space, _opprn, _C, _clprn, _space, _I, _m, _p, _e, _r, _i, _o, _n, _space, _I, _n, _c, _dot, _space, t_2, t_0, t_2, t_3)); 11 | printLine(); 12 | printLine(); 13 | // setting "PLAYER HUD" requires IRIS 1.6 or later! 14 | printString((_s, _e, _t, _t, _i, _n, _g, _space, _quote, _P, _L, _A, _Y, _E, _R, _space, _H, _U, _D, _quote)); 15 | printString((_space, _r, _e, _q, _u, _i, _r, _e, _s, _space, _I, _R, _I, _S, _space, t_1, _dot, t_6, _space, _o, _r, _space, _l, _a, _t, _e, _r, _exclm)); 16 | printLine(); 17 | 18 | // see "irisshaders.net" to download 19 | printString((_s, _e, _e, _space, _quote, _i, _r, _i, _s, _s, _h, _a, _d, _e, _r, _s, _dot, _n, _e, _t, _quote, _space, _t, _o, _space, _d, _o, _w, _n, _l, _o, _a, _d)); 20 | printLine(); 21 | // workaround for OPTIFINE: 22 | printString((_w, _o, _r, _k, _a, _r, _o, _u, _n, _d, _space, _f, _o, _r, _space, _O, _P, _T, _I, _F, _I, _N, _E, _colon)); 23 | printLine(); 24 | // set [SCREEN] > "PLAYER HUD" to OFF 25 | printString((_space, _space, _s, _e, _t, _space, _opsqr, _S, _C, _R, _E, _E, _N, _clsqr, _space, _gt, _space, _quote, _P, _L, _A, _Y, _E, _R, _space, _H, _U, _D, _quote, _space, _t, _o, _space, _O, _F, _F)); 26 | printLine(); 27 | 28 | // workaround for IRIS 1.5: 29 | printString((_w, _o, _r, _k, _a, _r, _o, _u, _n, _d, _space, _f, _o, _r, _space, _I, _R, _I, _S, _space, t_1, _dot, t_5, _colon)); 30 | printLine(); 31 | // set [DEBUG] > "IS_IRIS" to ON 32 | printString((_space, _space, _s, _e, _t, _space, _opsqr, _D, _E, _B, _U, _G, _clsqr, _space, _gt, _space, _quote, _I, _S, _under, _I, _R, _I, _S, _quote, _space, _t, _o, _space, _O, _N)); 33 | 34 | //F1 to temporarily hide this message... 35 | printLine(); 36 | printLine(); 37 | printString((_F, _1, _space, _t, _o, _space, _t, _e, _m, _p, _o, _r, _a, _r, _i, _l, _y, _space, _h, _i, _d, _e, _space, _t, _h, _i, _s, _space, _m, _e, _s, _s, _a, _g, _e, _dot, _dot, _dot)); 38 | 39 | // cursor console 40 | printLine(); 41 | printString((_gt)); 42 | float frx = fract(frameTimeCounter); 43 | if(frx < 0.5) { 44 | printString((_block)); 45 | } 46 | 47 | endText(color); 48 | } -------------------------------------------------------------------------------- /shaders/lib/blur.h: -------------------------------------------------------------------------------- 1 | const int gaussian_kernel_size = 63; 2 | const float gaussian_kernel[63] = float[]( 3 | 2.168404344971009e-19, 4 | 1.3444106938820255e-17, 5 | 4.100452616340178e-16, 6 | 8.200905232680356e-15, 7 | 1.2096335218203524e-13, 8 | 1.4031748853116088e-12, 9 | 1.3330161410460284e-11, 10 | 1.0664129128368227e-10, 11 | 7.331588775753156e-10, 12 | 4.398953265451894e-9, 13 | 2.3314452306895037e-8, 14 | 1.1021377454168563e-7, 15 | 4.684085418021639e-7, 16 | 0.0000018015713146237074, 17 | 0.000006305499601182976, 18 | 0.000020177598723785523, 19 | 0.00005927169625111997, 20 | 0.00016038223691479522, 21 | 0.00040095559228698805, 22 | 0.000928528740033025, 23 | 0.0019963367910710034, 24 | 0.003992673582142008, 25 | 0.007440891675810105, 26 | 0.01294068117532192, 27 | 0.02102860690989812, 28 | 0.03196348250304515, 29 | 0.04548649433125655, 30 | 0.06064865910834208, 31 | 0.07581082388542759, 32 | 0.08888165558981166, 33 | 0.09776982114879282, 34 | 0.10092368634714097, 35 | 0.09776982114879282, 36 | 0.08888165558981166, 37 | 0.07581082388542759, 38 | 0.06064865910834208, 39 | 0.04548649433125655, 40 | 0.03196348250304515, 41 | 0.02102860690989812, 42 | 0.01294068117532192, 43 | 0.007440891675810105, 44 | 0.003992673582142008, 45 | 0.0019963367910710034, 46 | 0.000928528740033025, 47 | 0.00040095559228698805, 48 | 0.00016038223691479522, 49 | 0.00005927169625111997, 50 | 0.000020177598723785523, 51 | 0.000006305499601182976, 52 | 0.0000018015713146237074, 53 | 4.684085418021639e-7, 54 | 1.1021377454168563e-7, 55 | 2.3314452306895037e-8, 56 | 4.398953265451894e-9, 57 | 7.331588775753156e-10, 58 | 1.0664129128368227e-10, 59 | 1.3330161410460284e-11, 60 | 1.4031748853116088e-12, 61 | 1.2096335218203524e-13, 62 | 8.200905232680356e-15, 63 | 4.100452616340178e-16, 64 | 1.3444106938820255e-17, 65 | 2.168404344971009e-19 66 | ); 67 | 68 | vec3 gaussianHorizontal(sampler2D tex, vec2 fragUV) { 69 | vec3 color = vec3(0.0); 70 | for(int i = 0; i < gaussian_kernel_size; i++) { 71 | vec2 offset = pixelSize * vec2(i - floor(gaussian_kernel_size / 2.0), 0.0) * BLOOM_SIZE; 72 | color += texture2D(tex, fragUV + offset).rgb * gaussian_kernel[i]; 73 | } 74 | return color; 75 | } 76 | 77 | vec3 gaussianVertical(sampler2D tex, vec2 fragUV) { 78 | vec3 color = vec3(0.0); 79 | for(int i = 0; i < gaussian_kernel_size; i++) { 80 | vec2 offset = pixelSize * vec2(0.0, i - floor(gaussian_kernel_size / 2.0)) * BLOOM_SIZE; 81 | color += texture2D(tex, fragUV + offset).rgb * gaussian_kernel[i]; 82 | } 83 | return color; 84 | } -------------------------------------------------------------------------------- /shaders/lib/settings.h: -------------------------------------------------------------------------------- 1 | uniform float viewWidth; 2 | uniform float viewHeight; 3 | vec2 pixelSize = 1.0 / vec2(viewWidth, viewHeight); 4 | 5 | #define VECTOR_SHADER 0 // [0 1 2 3 4] 6 | 7 | // #define SCANLINES 8 | #define SCAN_SPEED 3 // [1 2 3 4 5 6 7 8 9 10] 9 | #define SCAN_SIZE 0 // [0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200] 10 | #define GHOSTING 11 | // #define PIXEL_SIZE 1 // [1 2 4 8 16 32 64] 12 | // const float pixel_power = log2(PIXEL_SIZE); 13 | 14 | #define CURVATURE_X 1.0 // [-1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0] 15 | #define CURVATURE_Y 1.0 // [-1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0] 16 | 17 | // #define SEE_THROUGH_GLASS 18 | 19 | #define MONOCHROME 20 | #define THICKER_LINES 21 | #define LINE_COLOR_R 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 22 | #define LINE_COLOR_G 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 23 | #define LINE_COLOR_B 0.3 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 24 | const vec3 USER_COLOR = vec3(LINE_COLOR_R, LINE_COLOR_G, LINE_COLOR_B); 25 | #define BG_COLOR_R 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 26 | #define BG_COLOR_G 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 27 | #define BG_COLOR_B 0.3 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 28 | #define BG_COLOR_MUL 0.03 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 29 | const vec3 USER_BG_COLOR = normalize(vec3(BG_COLOR_R, BG_COLOR_G, BG_COLOR_B)) * BG_COLOR_MUL; 30 | #define LINE_THRESHOLD_CONTRAST 0.1 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 31 | #define LINE_THRESHOLD_DEPTH 0.01 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1] 32 | #define LINE_THRESHOLD_NORMAL 0.7 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 100.0] 33 | 34 | // #define ENTITY_RADAR 35 | #define RADAR_FILLED 36 | #define HOSTILE_COLOR_R 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 37 | #define HOSTILE_COLOR_G 0.2 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 38 | #define HOSTILE_COLOR_B 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 39 | const vec3 ENTITY_COLOR_HOSTILE = vec3(HOSTILE_COLOR_R, HOSTILE_COLOR_G, HOSTILE_COLOR_B); 40 | #define FRIENDLY_COLOR_R 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 41 | #define FRIENDLY_COLOR_G 0.4 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 42 | #define FRIENDLY_COLOR_B 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 43 | const vec3 ENTITY_COLOR_FRIENDLY = vec3(FRIENDLY_COLOR_R, FRIENDLY_COLOR_G, FRIENDLY_COLOR_B); 44 | #define PLAYER_COLOR_R 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 45 | #define PLAYER_COLOR_G 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 46 | #define PLAYER_COLOR_B 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 47 | const vec3 ENTITY_COLOR_PLAYER = vec3(PLAYER_COLOR_R, PLAYER_COLOR_G, PLAYER_COLOR_B); 48 | 49 | #define BLOOM_MIX 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] 50 | #define BLOOM_SIZE 2 // [0.1 0.2 0.4 0.8 1 2 4 6 8 12 16 24 32 48 64] 51 | 52 | // #define IS_IRIS 53 | // #define SHOW_PLAYER_HUD 54 | #define HUD_CROSSHAIR 0 // [0 1 2] 55 | // #define RESEAU_PLATE 56 | #define FIDUCIAL_MARKERS_X 3 // [1 2 3 4 5 6 7 8 9] 57 | #define FIDUCIAL_MARKERS_Y 3 // [1 2 3 4 5 6 7 8 9] 58 | 59 | #define RESOLUTION_WARNING 0 // [0 0 0] 60 | // #define HUD_COMPASS_HORIZONTAL 61 | #define HUD_COMPASS_HORIZONTAL_SPACING 16.0 // [8.0 10.0 12.0 16.0 18.0 20.0 24.0 28.0 32.0] 62 | // #define HUD_COMPASS_VERTICAL 63 | #define HUD_COMPASS_VERTICAL_SPACING 12.0 // [6.0 8.0 10.0 12.0 16.0 18.0 20.0 24.0 28.0 32.0] 64 | // #define HUD_COORDS 65 | // #define HUD_CAMERA_DETAILS 66 | 67 | 68 | // Fix wonky option screen parsing 69 | /* 70 | #ifdef GHOSTING 71 | #endif 72 | #ifdef VECTOR_SHADER 73 | #endif 74 | #ifdef SEE_THROUGH_GLASS 75 | #endif 76 | #ifdef RESOLUTION_WARNING 77 | #endif 78 | */ 79 | 80 | /* 81 | COLORTEX0: 82 | DESC: Albedo/Main Buffer 83 | WRITE: 84 | GBUFFERS 85 | COMPOSITE 86 | COMPOSITE1 87 | COMPOSITE7 88 | READ: 89 | COMPOSITE 90 | COMPOSITE1 91 | COMPOSITE5 92 | COMPOSITE7 93 | COLORTEX1: 94 | DESC: Bloom 95 | WRITE: 96 | COMPOSITE5 97 | COMPOSITE6 98 | READ: 99 | COMPOSITE6 100 | COMPOSITE7 101 | COLORTEX2: 102 | DESC: Ghosting 103 | NONCLEARING: TRUE 104 | WRITE: 105 | COMPOSITE7 106 | READ: 107 | COMPOSITE7 108 | COLORTEX3: 109 | DESC: Normals, Entity mask 110 | WRITE: 111 | GBUFFERS 112 | READ: 113 | COMPOSITE 114 | */ -------------------------------------------------------------------------------- /shaders/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | #shaders/lang/zh_CN.lang 2 | #本汉化由Surisen提供。并非专业译者,请谅解。 3 | #本汉化文档对应 Vector Shader 1.3 版本。 4 | #本汉化文档以 CC BY-NC-SA 4.0 协议进行许可。 5 | 6 | option.VECTOR_SHADER=VECTOR 7 | value.VECTOR_SHADER.0=§aVECTOR 8 | value.VECTOR_SHADER.1=§6VECTOR 9 | value.VECTOR_SHADER.2=§cVECTOR 10 | value.VECTOR_SHADER.3=§fVECTOR 11 | value.VECTOR_SHADER.4=§bVECTOR 12 | 13 | profile.VECTOR=§aVECTOR 14 | profile.IBM=§2IBM 15 | profile.MARV=§4MARV 16 | profile.VEGAS=§6VEGAS 17 | profile.JPL=§fJPL 18 | 19 | screen.LINE_COLOR=线条颜色 20 | screen.LINE_COLOR.comment=调节线条和背景的颜色. 21 | screen.RADAR.comment=开启或调节实体雷达设置. 22 | screen.LINE_SHAPE=线条形状 23 | screen.LINE_SHAPE.comment=调节线条的数量. 24 | screen.SCREEN.comment=关于屏幕的设置,例如泛光和扫描线. 25 | screen.HUD.comment=调节抬头显示. 26 | 27 | 28 | option.MONOCHROME.comment=屏幕仅显示一种颜色 29 | option.LINE_COLOR_R=线条 - 红色 30 | option.LINE_COLOR_R.comment=线条中红色的比重. 31 | option.LINE_COLOR_G=线条 - 绿色 32 | option.LINE_COLOR_G.comment=线条中绿色的比重. 33 | option.LINE_COLOR_B=线条 - 蓝色 34 | option.LINE_COLOR_B.comment=线条中蓝色的比重. 35 | option.BG_COLOR_R=背景 - 红色 36 | option.BG_COLOR_R.comment=背景颜色中红色的比重. 37 | option.BG_COLOR_G=背景 - 绿色 38 | option.BG_COLOR_G.comment=背景颜色中绿色的比重. 39 | option.BG_COLOR_B=背景 - 蓝色 40 | option.BG_COLOR_B.comment=背景颜色中蓝色的比重. 41 | option.BG_COLOR_MUL=背景亮度 42 | option.BG_COLOR_MUL.comment=背景亮度 43 | 44 | option.ENTITY_RADAR=实体雷达 45 | option.ENTITY_RADAR.comment=开启实体雷达 46 | option.RADAR_FILLED=雷达填充 47 | option.RADAR_FILLED.comment=显示的实体为填充状态 48 | option.HOSTILE_COLOR_R=敌对生物 - 红色 49 | option.HOSTILE_COLOR_R.comment=敌对生物显示颜色的红色比重 50 | option.HOSTILE_COLOR_G=敌对生物 - 绿色 51 | option.HOSTILE_COLOR_G.comment=敌对生物显示颜色的绿色比重 52 | option.HOSTILE_COLOR_B=敌对生物 - 蓝色 53 | option.HOSTILE_COLOR_B.comment=敌对生物显示颜色的蓝色比重 54 | option.FRIENDLY_COLOR_R=友好生物 - 红色 55 | option.FRIENDLY.COLOR_R.comment=友好生物显示颜色的红色比重 56 | option.FRIENDLY_COLOR_G=友好生物 - 绿色 57 | option.FRIENDLY_COLOR_G.comment=友好生物显示颜色的绿色比重 58 | option.FRIENDLY_COLOR_B=友好生物 - 蓝色 59 | option.FRIENDLY_COLOR_B.comment=友好生物显示颜色的蓝色比重 60 | option.PLAYER_COLOR_R=玩家 - 红色 61 | option.PLAYER_COLOR_R.comment=玩家显示颜色的红色比重 62 | option.PLAYER_COLOR_G=玩家 - 绿色 63 | option.PLAYER_COLOR_G.comment=玩家显示颜色的绿色比重 64 | option.PLAYER_COLOR_B=玩家 - 蓝色 65 | option.PLAYER_COLOR_B.comment=玩家显示颜色的蓝色比重 66 | 67 | 68 | option.THICKER_LINES=厚线条 69 | option.THICKER_LINES.comment=加粗所有线条. 这个在边缘检测后处理,所以并不能使更多的线条被展示出来. 70 | option.LINE_THRESHOLD_CONTRAST=线条对比度阈值 71 | option.LINE_THRESHOLD_CONTRAST.comment=更高的阈值意味着越少的线条被检测到. 72 | option.LINE_THRESHOLD_DEPTH=线条深度阈值 73 | option.LINE_THRESHOLD_DEPTH.comment=更高的阈值意味着越少的线条被检测到. 74 | option.LINE_THRESHOLD_NORMAL=线条法线阈值 75 | option.LINE_THRESHOLD_NORMAL.comment=更高的阈值意味着越少的线条被检测到. 76 | value.LINE_THRESHOLD_NORMAL.100.0=禁用 77 | option.SEE_THROUGH_GLASS=可看穿的玻璃 78 | option.SEE_THROUGH_GLASS.comment=阻止彩色玻璃不透明, 代价是其现在不可见. 方块轮廓仍然会显示. 79 | 80 | 81 | option.SCANLINES.comment=启用扫描线,模拟有限的垂直分辨率 82 | option.SCAN_SIZE=扫描尺寸 83 | option.SCAN_SIZE.comment=扫描效果的强度. 需要启用 扫描线 选项 84 | value.SCAN_SIZE.0=关 85 | option.SCAN_SPEED=扫描速度 86 | option.SCAN_SPEED.comment=扫描效果的速度 87 | option.GHOSTING.comment=启用基于Phosphor[萤火虫]的剔除而产生的重影. 88 | option.CURVATURE_X=水平曲率 89 | option.CURVATURE_X.comment=模拟屏幕水平弯曲. 90 | option.CURVATURE_Y=垂直曲率 91 | option.CURVATURE_Y.comment=模拟屏幕垂直弯曲. 92 | option.BLOOM_MIX=泛光混合 93 | option.BLOOM_MIX.comment=泛光在图像顶部的不透明度. 94 | option.BLOOM_SIZE=泛光强度 95 | option.BLOOM_SIZE.comment=泛光蔓延范围. 96 | 97 | 98 | option.SHOW_PLAYER_HUD=玩家HUD 99 | option.SHOW_PLAYER_HUD.comment=启用HUD来显示玩家的健康值、饥饿值和氧气, 需要Iris! 100 | option.HUD_CROSSHAIR=准心 101 | option.HUD_CROSSHAIR.comment=在HUD中显示准心 102 | value.HUD_CROSSHAIR.0=关闭 103 | value.HUD_CROSSHAIR.1=交错 104 | value.HUD_CROSSHAIR.2=圆圈 105 | option.RESEAU_PLATE=网格板 106 | option.RESEAU_PLATE.comment=显示靶标, 科学类拍摄常见 107 | option.FIDUCIAL_MARKERS_X=水平靶标 108 | option.FIDUCIAL_MARKERS_X.comment=水平显示靶标的数量 109 | option.FIDUCIAL_MARKERS_Y=垂直靶标 110 | option.FIDUCIAL_MARKERS_Y.comment=垂直显示靶标的数量 111 | option.RESOLUTION_WARNING=分辨率 112 | value.RESOLUTION_WARNING.0=§c警告 113 | option.RESOLUTION_WARNING.comment=若游戏分辨率太低或太高, 这些元素看起来会很奇怪. 它们为 1920x1080 尺寸设计. 114 | option.HUD_COORDS=坐标 115 | option.HUD_COORDS.comment=显示玩家当前世界坐标 116 | option.HUD_CAMERA_DETAILS=相机细节 117 | option.HUD_CAMERA_DETAILS.comment=相机视场角和分辨率 118 | option.HUD_COMPASS_HORIZONTAL=航向角 (YAW) 119 | option.HUD_COMPASS_HORIZONTAL.comment=显示当前相机相对于北方的航向角. 120 | option.HUD_COMPASS_VERTICAL=俯仰角 (PITCH) 121 | option.HUD_COMPASS_VERTICAL.comment=显示当前相机相对于水平面的俯仰角. 122 | option.HUD_COMPASS_HORIZONTAL_SPACING=航向角显示间距 123 | option.HUD_COMPASS_HORIZONTAL_SPACING.comment=航向角中的点之间的间距. 124 | option.HUD_COMPASS_VERTICAL_SPACING=俯仰角显示间距 125 | option.HUD_COMPASS_VERTICAL_SPACING.comment=俯仰角中的点之间的间距. 126 | 127 | 128 | #额外接口 129 | screen.RADAR=雷达 130 | 131 | screen.SCREEN=屏幕 132 | 133 | option.MONOCHROME=单色 134 | 135 | option.SCANLINES=扫描线 136 | 137 | option.GHOSTING=重影 138 | 139 | screen.DEBUG=调试 140 | 141 | option.GBUFFERS_ENTITIES=GBuffers 实体 142 | 143 | option.GBUFFERS_SKYBASIC=GBuffers 基本天空 144 | 145 | option.GBUFFERS_SKYTEXTURED=GBuffers 天空纹理 146 | 147 | option.GBUFFERS_TERRAIN=GBuffers 地表 148 | 149 | option.GBUFFERS_WATER=GBuffers 水体 150 | 151 | option.PIXEL_SIZE=像素尺寸 152 | 153 | option.IS_IRIS=是否为IRIS? 154 | 155 | option.UTILITY_TEXTRENDERING_INCLUDED=内部有效文本渲染 -------------------------------------------------------------------------------- /shaders/lang/en_us.lang: -------------------------------------------------------------------------------- 1 | option.VECTOR_SHADER=VECTOR 2 | value.VECTOR_SHADER.0=§aVECTOR 3 | value.VECTOR_SHADER.1=§6VECTOR 4 | value.VECTOR_SHADER.2=§cVECTOR 5 | value.VECTOR_SHADER.3=§fVECTOR 6 | value.VECTOR_SHADER.4=§bVECTOR 7 | 8 | profile.VECTOR=§aVECTOR 9 | profile.IBM=§2IBM 10 | profile.MARV=§4MARV 11 | profile.VEGAS=§6VEGAS 12 | profile.JPL=§fJPL 13 | 14 | screen.LINE_COLOR=LINE COLOR 15 | screen.LINE_COLOR.comment=Control the line and background color 16 | screen.RADAR.comment=Toggle and adjust the entity radar settings 17 | screen.LINE_SHAPE=LINE SHAPE 18 | screen.LINE_SHAPE.comment=Tune the amount of lines 19 | screen.SCREEN.comment=Settings related to the screen such as bloom and scanlines 20 | screen.HUD.comment=Adjust the Heads-Up Display 21 | 22 | 23 | option.MONOCHROME.comment=Screen only shows one color 24 | option.LINE_COLOR_R=LINE RED 25 | option.LINE_COLOR_R.comment=Amount of RED in the line color 26 | option.LINE_COLOR_G=LINE GREEN 27 | option.LINE_COLOR_G.comment=Amount of GREEN in the line color 28 | option.LINE_COLOR_B=LINE BLUE 29 | option.LINE_COLOR_B.comment=Amount of BLUE in the line color 30 | option.BG_COLOR_R=BACKGROUND RED 31 | option.BG_COLOR_R.comment=Amount of RED in the background color 32 | option.BG_COLOR_G=BACKGROUND GREEN 33 | option.BG_COLOR_G.comment=Amount of GREEN in the background color 34 | option.BG_COLOR_B=BACKGROUND BLUE 35 | option.BG_COLOR_B.comment=Amount of BLUE in the background color 36 | option.BG_COLOR_MUL=BACKGROUND BRIGHTNESS 37 | option.BG_COLOR_MUL.comment=Brightness of background 38 | 39 | option.ENTITY_RADAR=RADAR 40 | option.ENTITY_RADAR.comment=Toggle the entity radar 41 | option.RADAR_FILLED=RADAR FILLED 42 | option.RADAR_FILLED.comment=Show entities as filled 43 | option.HOSTILE_COLOR_R=HOSTILE RED 44 | option.HOSTILE_COLOR_R.comment=Amount of RED in the hostile color 45 | option.HOSTILE_COLOR_G=HOSTILE GREEN 46 | option.HOSTILE_COLOR_G.comment=Amount of GREEN in the hostile color 47 | option.HOSTILE_COLOR_B=HOSTILE BLUE 48 | option.HOSTILE_COLOR_B.comment=Amount of BLUE in the hostile color 49 | option.FRIENDLY_COLOR_R=FRIENDLY RED 50 | option.FRIENDLY.COLOR_R.comment=Amount of RED in the friendly color 51 | option.FRIENDLY_COLOR_G=FRIENDLY GREEN 52 | option.FRIENDLY_COLOR_G.comment=Amount of GREEN in the friendly color 53 | option.FRIENDLY_COLOR_B=FRIENDLY BLUE 54 | option.FRIENDLY_COLOR_B.comment=Amount of BLUE in the friendly color 55 | option.PLAYER_COLOR_R=PLAYER RED 56 | option.PLAYER_COLOR_R.comment=Amount of RED in the player color 57 | option.PLAYER_COLOR_G=PLAYER GREEN 58 | option.PLAYER_COLOR_G.comment=Amount of GREEN in the player color 59 | option.PLAYER_COLOR_B=PLAYER BLUE 60 | option.PLAYER_COLOR_B.comment=Amount of BLUE in the player color 61 | 62 | 63 | option.THICKER_LINES=THICKER LINES 64 | option.THICKER_LINES.comment=Thicken all lines. This runs after edge detection, so won't make more edges show up 65 | option.LINE_THRESHOLD_CONTRAST=LINE CONTRAST THRESHOLD 66 | option.LINE_THRESHOLD_CONTRAST.comment=Higher threshold means less lines detected 67 | option.LINE_THRESHOLD_DEPTH=LINE DEPTH THRESHOLD 68 | option.LINE_THRESHOLD_DEPTH.comment=Higher threshold means less lines detected 69 | option.LINE_THRESHOLD_NORMAL=LINE NORMAL THRESHOLD 70 | option.LINE_THRESHOLD_NORMAL.comment=Higher threshold means less lines detected 71 | value.LINE_THRESHOLD_NORMAL.100.0=DISABLED 72 | option.SEE_THROUGH_GLASS=SEE THROUGH GLASS 73 | option.SEE_THROUGH_GLASS.comment=Prevents stained glass from being opaque, at the cost of it now being invisible. The block outline will still show. 74 | 75 | 76 | option.SCANLINES.comment=Enables scanlines, emulating limited vertical resolution 77 | option.SCAN_SIZE=SCAN SIZE 78 | option.SCAN_SIZE.comment=The size of the sweeping scan effect. Required SCANLINES to be ON 79 | value.SCAN_SIZE.0=OFF 80 | option.SCAN_SPEED=SCAN SPEED 81 | option.SCAN_SPEED.comment=The speed of the sweeping scan effect 82 | option.GHOSTING.comment=Enables ghosting due to phosphor fading 83 | option.CURVATURE_X=HORIZONTAL CURVATURE 84 | option.CURVATURE_X.comment=Emulate horizontal screen curvature 85 | option.CURVATURE_Y=VERTICAL CURVATURE 86 | option.CURVATURE_Y.comment=Emulate vertical screen curvature 87 | option.BLOOM_MIX=BLOOM MIX 88 | option.BLOOM_MIX.comment=The opacity of the bloom on top of the image 89 | option.BLOOM_SIZE=BLOOM SIZE 90 | option.BLOOM_SIZE.comment=The spread of the bloom 91 | 92 | 93 | option.SHOW_PLAYER_HUD=PLAYER HUD 94 | option.SHOW_PLAYER_HUD.comment=Enables HUD elements to show the player's Health, Hunger, and Oxygen. Requires Iris! 95 | option.HUD_CROSSHAIR=CROSSHAIR 96 | option.HUD_CROSSHAIR.comment=Enable a crosshair on the HUD 97 | value.HUD_CROSSHAIR.0=OFF 98 | value.HUD_CROSSHAIR.1=CROSS 99 | value.HUD_CROSSHAIR.2=CIRCLE 100 | option.RESEAU_PLATE=RESEAU PLATE 101 | option.RESEAU_PLATE.comment=Show fiducial markers, used for scientific and technical photographs 102 | option.FIDUCIAL_MARKERS_X=HORIZONTAL FIDUCIAL MARKERS 103 | option.FIDUCIAL_MARKERS_X.comment=How many columns of markers should be shown 104 | option.FIDUCIAL_MARKERS_Y=VERTICAL FIDUCIAL MARKERS 105 | option.FIDUCIAL_MARKERS_Y.comment=How many rows of markers should be shown 106 | option.RESOLUTION_WARNING=RESOLUTION 107 | value.RESOLUTION_WARNING.0=§cWARNING 108 | option.RESOLUTION_WARNING.comment=These elements will look weird if your resolution is too low or too high. They are designed for approximately 1920x1080 109 | option.HUD_COORDS=COORDINATES 110 | option.HUD_COORDS.comment=Show your current world coordinates 111 | option.HUD_CAMERA_DETAILS=CAMERA DETAILS 112 | option.HUD_CAMERA_DETAILS.comment=Camera FoV and resolution 113 | option.HUD_COMPASS_HORIZONTAL=YAW COMPASS 114 | option.HUD_COMPASS_HORIZONTAL.comment=Show your current camera yaw relative to north 115 | option.HUD_COMPASS_VERTICAL=PITCH COMPASS 116 | option.HUD_COMPASS_VERTICAL.comment=Show your current camera pitch 117 | option.HUD_COMPASS_HORIZONTAL_SPACING=YAW COMPASS SPACING 118 | option.HUD_COMPASS_HORIZONTAL_SPACING.comment=The spacing between pips in the yaw compass 119 | option.HUD_COMPASS_VERTICAL_SPACING=PITCH COMPASS SPACING 120 | option.HUD_COMPASS_VERTICAL_SPACING.comment=The spacing between pips in the pitch compass -------------------------------------------------------------------------------- /shaders/shaders.properties: -------------------------------------------------------------------------------- 1 | blend.gbuffers_entities=off 2 | 3 | sliders=\ 4 | LINE_COLOR_R LINE_COLOR_G LINE_COLOR_B BG_COLOR_MUL BG_COLOR_R BG_COLOR_G BG_COLOR_B \ 5 | BLOOM_MIX BLOOM_SIZE \ 6 | LINE_THRESHOLD_CONTRAST LINE_THRESHOLD_DEPTH LINE_THRESHOLD_NORMAL \ 7 | SCAN_SIZE SCAN_SPEED \ 8 | CURVATURE_X CURVATURE_Y \ 9 | HOSTILE_COLOR_R HOSTILE_COLOR_G HOSTILE_COLOR_B FRIENDLY_COLOR_R FRIENDLY_COLOR_G FRIENDLY_COLOR_B PLAYER_COLOR_R PLAYER_COLOR_G PLAYER_COLOR_B \ 10 | FIDUCIAL_MARKERS_X FIDUCIAL_MARKERS_Y \ 11 | HUD_COMPASS_HORIZONTAL_SPACING HUD_COMPASS_VERTICAL_SPACING 12 | 13 | screen.columns=1 14 | screen=\ 15 | VECTOR_SHADER \ 16 | \ 17 | \ 18 | [LINE_COLOR] \ 19 | [LINE_SHAPE] \ 20 | [SCREEN] \ 21 | [HUD] \ 22 | [DEBUG] 23 | 24 | screen.LINE_COLOR.columns=1 25 | screen.LINE_COLOR=\ 26 | [RADAR] \ 27 | MONOCHROME \ 28 | LINE_COLOR_R \ 29 | LINE_COLOR_G \ 30 | LINE_COLOR_B \ 31 | \ 32 | BG_COLOR_MUL \ 33 | BG_COLOR_R \ 34 | BG_COLOR_G \ 35 | BG_COLOR_B 36 | 37 | screen.RADAR.columns=3 38 | screen.RADAR=\ 39 | ENTITY_RADAR RADAR_FILLED \ 40 | HOSTILE_COLOR_R FRIENDLY_COLOR_R PLAYER_COLOR_R \ 41 | HOSTILE_COLOR_G FRIENDLY_COLOR_G PLAYER_COLOR_G \ 42 | HOSTILE_COLOR_B FRIENDLY_COLOR_B PLAYER_COLOR_B 43 | 44 | screen.LINE_SHAPE.columns=1 45 | screen.LINE_SHAPE=\ 46 | THICKER_LINES \ 47 | LINE_THRESHOLD_CONTRAST \ 48 | LINE_THRESHOLD_DEPTH \ 49 | LINE_THRESHOLD_NORMAL \ 50 | SEE_THROUGH_GLASS 51 | 52 | screen.SCREEN.columns=2 53 | screen.SCREEN=\ 54 | SCANLINES SCAN_SIZE \ 55 | GHOSTING SCAN_SPEED \ 56 | \ 57 | BLOOM_MIX CURVATURE_X \ 58 | BLOOM_SIZE CURVATURE_Y 59 | 60 | screen.HUD.columns=2 61 | screen.HUD=\ 62 | SHOW_PLAYER_HUD HUD_CROSSHAIR \ 63 | \ 64 | RESEAU_PLATE FIDUCIAL_MARKERS_X \ 65 | FIDUCIAL_MARKERS_Y \ 66 | \ 67 | RESOLUTION_WARNING \ 68 | HUD_COORDS HUD_CAMERA_DETAILS \ 69 | HUD_COMPASS_HORIZONTAL HUD_COMPASS_HORIZONTAL_SPACING \ 70 | HUD_COMPASS_VERTICAL HUD_COMPASS_VERTICAL_SPACING 71 | 72 | 73 | 74 | screen.DEBUG=* 75 | 76 | # Vector monitor, like would be found on an oscilloscope or Asteroids 77 | profile.VECTOR = MONOCHROME LINE_COLOR_R:0.0 LINE_COLOR_G:1.0 LINE_COLOR_B:0.3 THICKER_LINES \ 78 | BG_COLOR_R:0.0 BG_COLOR_G:1.0 BG_COLOR_B:0.3 BG_COLOR_MUL:0.03 LINE_THRESHOLD_CONTRAST:0.1 LINE_THRESHOLD_DEPTH:0.01 LINE_THRESHOLD_NORMAL:0.7 \ 79 | !SCANLINES SCAN_SIZE:0 SCAN_SPEED:3 CURVATURE_X:1.0 CURVATURE_Y:1.0 GHOSTING BLOOM_MIX:0.5 BLOOM_SIZE:2 \ 80 | !ENTITY_RADAR RADAR_FILLED HOSTILE_COLOR_R:1.0 HOSTILE_COLOR_G:0.2 HOSTILE_COLOR_B:0.0 FRIENDLY_COLOR_R:0.0 FRIENDLY_COLOR_G:0.4 FRIENDLY_COLOR_B:1.0 PLAYER_COLOR_R:1.0 PLAYER_COLOR_G:0.0 PLAYER_COLOR_B:1.0 \ 81 | !SHOW_PLAYER_HUD HUD_CROSSHAIR:0 !RESEAU_PLATE FIDUCIAL_MARKERS_X:3 FIDUCIAL_MARKERS_Y:3 \ 82 | !HUD_COMPASS_HORIZONTAL !HUD_COMPASS_VERTICAL !HUD_COORDS !HUD_CAMERA_DETAILS \ 83 | HUD_COMPASS_HORIZONTAL_SPACING:16.0 HUD_COMPASS_VERTICAL_SPACING:12.0 84 | # Inspired by the IBM 5151 85 | profile.IBM = MONOCHROME LINE_COLOR_R:0.0 LINE_COLOR_G:1.0 LINE_COLOR_B:0.3 !THICKER_LINES \ 86 | BG_COLOR_R:0.0 BG_COLOR_G:1.0 BG_COLOR_B:0.3 BG_COLOR_MUL:0.03 LINE_THRESHOLD_CONTRAST:0.1 LINE_THRESHOLD_DEPTH:0.01 LINE_THRESHOLD_NORMAL:0.7 \ 87 | SCANLINES SCAN_SIZE:50 SCAN_SPEED:3 CURVATURE_X:0.6 CURVATURE_Y:0.3 GHOSTING BLOOM_MIX:0.7 BLOOM_SIZE:2 \ 88 | !ENTITY_RADAR !RADAR_FILLED HOSTILE_COLOR_R:1.0 HOSTILE_COLOR_G:0.2 HOSTILE_COLOR_B:0.0 FRIENDLY_COLOR_R:0.0 FRIENDLY_COLOR_G:0.4 FRIENDLY_COLOR_B:1.0 PLAYER_COLOR_R:1.0 PLAYER_COLOR_G:0.0 PLAYER_COLOR_B:1.0 \ 89 | !SHOW_PLAYER_HUD HUD_CROSSHAIR:0 RESEAU_PLATE FIDUCIAL_MARKERS_X:3 FIDUCIAL_MARKERS_Y:3 \ 90 | !HUD_COMPASS_HORIZONTAL !HUD_COMPASS_VERTICAL !HUD_COORDS !HUD_CAMERA_DETAILS \ 91 | HUD_COMPASS_HORIZONTAL_SPACING:16.0 HUD_COMPASS_VERTICAL_SPACING:12.0 92 | # Partially inspired by the MARV logo from 2013 to 2019 93 | profile.MARV = MONOCHROME LINE_COLOR_R:1.0 LINE_COLOR_G:0.8 LINE_COLOR_B:0.0 THICKER_LINES \ 94 | BG_COLOR_R:1.0 BG_COLOR_G:0.0 BG_COLOR_B:0.0 BG_COLOR_MUL:0.3 LINE_THRESHOLD_CONTRAST:0.1 LINE_THRESHOLD_DEPTH:0.01 LINE_THRESHOLD_NORMAL:0.7 \ 95 | !SCANLINES SCAN_SIZE:0 SCAN_SPEED:3 CURVATURE_X:0.8 CURVATURE_Y:1.6 GHOSTING BLOOM_MIX:1.0 BLOOM_SIZE:0.8 \ 96 | ENTITY_RADAR !RADAR_FILLED HOSTILE_COLOR_R:1.0 HOSTILE_COLOR_G:0.2 HOSTILE_COLOR_B:0.0 FRIENDLY_COLOR_R:0.0 FRIENDLY_COLOR_G:1.0 FRIENDLY_COLOR_B:0.0 PLAYER_COLOR_R:1.0 PLAYER_COLOR_G:0.8 PLAYER_COLOR_B:0.0 \ 97 | !SHOW_PLAYER_HUD HUD_CROSSHAIR:0 !RESEAU_PLATE FIDUCIAL_MARKERS_X:3 FIDUCIAL_MARKERS_Y:3 \ 98 | !HUD_COMPASS_HORIZONTAL !HUD_COMPASS_VERTICAL !HUD_COORDS !HUD_CAMERA_DETAILS \ 99 | HUD_COMPASS_HORIZONTAL_SPACING:16.0 HUD_COMPASS_VERTICAL_SPACING:12.0 100 | # Inspired by the 'Fallout: New Vegas' Pip-Boy 3000 101 | profile.VEGAS = MONOCHROME LINE_COLOR_R:1.0 LINE_COLOR_G:0.5 LINE_COLOR_B:0.0 THICKER_LINES \ 102 | BG_COLOR_R:1.0 BG_COLOR_G:0.5 BG_COLOR_B:0.0 BG_COLOR_MUL:0.06 LINE_THRESHOLD_CONTRAST:0.1 LINE_THRESHOLD_DEPTH:0.01 LINE_THRESHOLD_NORMAL:0.7 \ 103 | SCANLINES SCAN_SIZE:0 SCAN_SPEED:3 CURVATURE_X:0.5 CURVATURE_Y:0.5 GHOSTING BLOOM_MIX:0.4 BLOOM_SIZE:2 \ 104 | ENTITY_RADAR RADAR_FILLED HOSTILE_COLOR_R:1.0 HOSTILE_COLOR_G:0.0 HOSTILE_COLOR_B:0.0 FRIENDLY_COLOR_R:1.0 FRIENDLY_COLOR_G:0.5 FRIENDLY_COLOR_B:0.0 PLAYER_COLOR_R:0.0 PLAYER_COLOR_G:1.0 PLAYER_COLOR_B:0.3 \ 105 | SHOW_PLAYER_HUD HUD_CROSSHAIR:2 !RESEAU_PLATE FIDUCIAL_MARKERS_X:3 FIDUCIAL_MARKERS_Y:3 \ 106 | HUD_COMPASS_HORIZONTAL !HUD_COMPASS_VERTICAL !HUD_COORDS !HUD_CAMERA_DETAILS \ 107 | HUD_COMPASS_HORIZONTAL_SPACING:16.0 HUD_COMPASS_VERTICAL_SPACING:12.0 108 | # Inspired by the Death Star graphics from 'Star Wars IV: A New Hope', computed at JPL 109 | profile.JPL = MONOCHROME LINE_COLOR_R:1.0 LINE_COLOR_G:1.0 LINE_COLOR_B:1.0 THICKER_LINES \ 110 | BG_COLOR_R:0.0 BG_COLOR_G:0.0 BG_COLOR_B:0.0 BG_COLOR_MUL:0.0 LINE_THRESHOLD_CONTRAST:0.4 LINE_THRESHOLD_DEPTH:0.01 LINE_THRESHOLD_NORMAL:3.5 \ 111 | !SCANLINES SCAN_SIZE:50 SCAN_SPEED:3 CURVATURE_X:0.0 CURVATURE_Y:0.0 GHOSTING BLOOM_MIX:0.5 BLOOM_SIZE:2 \ 112 | !ENTITY_RADAR !RADAR_FILLED HOSTILE_COLOR_R:1.0 HOSTILE_COLOR_G:0.2 HOSTILE_COLOR_B:0.0 FRIENDLY_COLOR_R:0.0 FRIENDLY_COLOR_G:0.4 FRIENDLY_COLOR_B:1.0 PLAYER_COLOR_R:1.0 PLAYER_COLOR_G:0.0 PLAYER_COLOR_B:1.0 \ 113 | SHOW_PLAYER_HUD HUD_CROSSHAIR:1 RESEAU_PLATE FIDUCIAL_MARKERS_X:3 FIDUCIAL_MARKERS_Y:3 \ 114 | !HUD_COMPASS_HORIZONTAL HUD_COMPASS_VERTICAL !HUD_COORDS HUD_CAMERA_DETAILS \ 115 | HUD_COMPASS_HORIZONTAL_SPACING:16.0 HUD_COMPASS_VERTICAL_SPACING:12.0 -------------------------------------------------------------------------------- /shaders/lib/text.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | -------------------------------------------------------------------------------- 3 | 4 | GLSL Debug Text Renderer by SixthSurge 5 | 6 | Character set based on Monocraft by IdreesInc 7 | https://github.com/IdreesInc/Monocraft 8 | 9 | Usage: 10 | 11 | // Call beginText to initialize the text renderer. You can scale the fragment position to adjust the size of the text 12 | beginText(ivec2(gl_FragCoord.xy), ivec2(0, viewHeight)); 13 | ^ fragment position ^ text box position (upper left corner) 14 | 15 | // You can print various data types 16 | printBool(false); 17 | printFloat(sqrt(-1.0)); // Prints "NaN" 18 | printInt(42); 19 | printVec3(skyColor); 20 | 21 | // ...or arbitrarily long strings 22 | printString((_H, _e, _l, _l, _o, _comma, _space, _w, _o, _r, _l, _d)); 23 | 24 | // To start a new line, use 25 | newLine(); 26 | 27 | // You can also configure the text color on the fly 28 | text.fgCol = vec4(1.0, 0.0, 0.0, 1.0); 29 | text.bgCol = vec4(0.0, 0.0, 0.0, 1.0); 30 | 31 | // ...as well as the number base and number of decimal places to print 32 | text.base = 16; 33 | text.fpPrecision = 4; 34 | 35 | // Finally, call endText to blend the current fragment color with the text 36 | endText(fragColor); 37 | 38 | Important: any variables you display must be the same for all fragments, or 39 | at least all of the fragments that the text covers. Otherwise, different 40 | fragments will try to print different values, resulting in, well, a mess 41 | 42 | -------------------------------------------------------------------------------- 43 | */ 44 | 45 | #if !defined UTILITY_TEXTRENDERING_INCLUDED 46 | #define UTILITY_TEXTRENDERING_INCLUDED 47 | 48 | // Include a font here 49 | #include "/lib/terminus.glsl" 50 | 51 | const int charWidth = 8; 52 | const int charHeight = 16; 53 | const int charSpacing = 1; 54 | const int lineSpacing = 3; 55 | 56 | const ivec2 charSize = ivec2(charWidth, charHeight); 57 | const ivec2 spaceSize = charSize + ivec2(charSpacing, lineSpacing); 58 | 59 | // Text renderer 60 | 61 | struct Text { 62 | vec4 result; // Output color from the text renderer 63 | vec4 fgCol; // Text foreground color 64 | vec4 bgCol; // Text background color 65 | ivec2 fragPos; // The position of the fragment (can be scaled to adjust the size of the text) 66 | ivec2 textPos; // The position of the top-left corner of the text 67 | ivec2 charPos; // The position of the next character in the text 68 | int base; // Number base 69 | int fpPrecision; // Number of decimal places to print 70 | } text; 71 | 72 | // Fills the global text object with default values 73 | void beginText(ivec2 fragPos, ivec2 textPos) { 74 | text.result = vec4(0.0); 75 | text.fgCol = vec4(1.0); 76 | text.bgCol = vec4(0.0, 0.0, 0.0, 0.6); 77 | text.fragPos = fragPos; 78 | text.textPos = textPos; 79 | text.charPos = ivec2(0); 80 | text.base = 10; 81 | text.fpPrecision = 2; 82 | } 83 | 84 | // Applies the rendered text to the fragment 85 | void endText(inout vec3 fragColor) { 86 | fragColor = mix(fragColor.rgb, text.result.rgb, text.result.a); 87 | } 88 | 89 | void printChar(uvec4 character) { 90 | ivec2 pos = text.fragPos - text.textPos - spaceSize * text.charPos * ivec2(1, -1) + ivec2(0, spaceSize.y); 91 | 92 | uint index = uint(pos.y * 8 + 7 - pos.x); 93 | 94 | // Draw background 95 | if (clamp(pos, ivec2(0), spaceSize - 1) == pos) 96 | text.result = mix(text.result, text.bgCol, text.bgCol.a); 97 | 98 | // Draw character 99 | if (clamp(pos, ivec2(0), charSize - 1) == pos) 100 | text.result = mix(text.result, text.fgCol, text.fgCol.a * float((character[(index >> 5)] >> (index & 31u)) & 1u)); 101 | 102 | // Advance to next character 103 | text.charPos.x++; 104 | } 105 | 106 | #define printString(string) { \ 107 | uvec4[] characters = uvec4[] string; \ 108 | for (int i = 0; i < characters.length(); ++i) printChar(characters[i]); \ 109 | } 110 | 111 | void printUnsignedInt(uint value, int len) { 112 | const uvec4[36] digits = uvec4[]( 113 | _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, 114 | _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, 115 | _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, 116 | _u, _v, _w, _x, _y, _z 117 | ); 118 | 119 | // Advance to end of the number 120 | text.charPos.x += len - 1; 121 | 122 | // Write number backwards 123 | for (int i = 0; i < len; ++i) { 124 | printChar(digits[value % uint(text.base)]); 125 | value /= uint(text.base); 126 | text.charPos.x -= 2; 127 | } 128 | 129 | // Return to end of the number 130 | text.charPos.x += len + 1; 131 | } 132 | 133 | void printUnsignedInt(uint value) { 134 | float logValue = log(float(value)) + 1e-6; 135 | float logBase = log(float(text.base)); 136 | 137 | int len = int(ceil(logValue / logBase)); 138 | len = max(len, 1); 139 | 140 | printUnsignedInt(value, len); 141 | } 142 | 143 | void printInt(int value) { 144 | if (value < 0) printChar(_hyphn); 145 | printUnsignedInt(uint(abs(value))); 146 | } 147 | 148 | void printFloat(float value) { 149 | if (value < 0.0) printChar(_hyphn); 150 | 151 | if (isnan(value)) { 152 | printString((_N, _a, _N)); 153 | } else if (isinf(value)) { 154 | printString((_i, _n, _f)); 155 | } else { 156 | float i, f = modf(abs(value), i); 157 | 158 | uint integralPart = uint(i); 159 | uint fractionalPart = uint(f * pow(float(text.base), float(text.fpPrecision)) + 0.5); 160 | 161 | printUnsignedInt(integralPart); 162 | printChar(_dot); 163 | printUnsignedInt(fractionalPart, text.fpPrecision); 164 | } 165 | } 166 | 167 | void printBool(bool value) { 168 | if (value) { 169 | printString((_t, _r, _u, _e)); 170 | } else { 171 | printString((_f, _a, _l, _s, _e)); 172 | } 173 | } 174 | 175 | void printVec2(vec2 value) { 176 | printFloat(value.x); 177 | printString((_comma, _space)); 178 | printFloat(value.y); 179 | } 180 | void printVec3(vec3 value) { 181 | printFloat(value.x); 182 | printString((_comma, _space)); 183 | printFloat(value.y); 184 | printString((_comma, _space)); 185 | printFloat(value.z); 186 | } 187 | void printVec4(vec4 value) { 188 | printFloat(value.x); 189 | printString((_comma, _space)); 190 | printFloat(value.y); 191 | printString((_comma, _space)); 192 | printFloat(value.z); 193 | printString((_comma, _space)); 194 | printFloat(value.w); 195 | } 196 | 197 | void printIvec2(ivec2 value) { 198 | printInt(value.x); 199 | printString((_comma, _space)); 200 | printInt(value.y); 201 | } 202 | void printIvec3(ivec3 value) { 203 | printInt(value.x); 204 | printString((_comma, _space)); 205 | printInt(value.y); 206 | printString((_comma, _space)); 207 | printInt(value.z); 208 | } 209 | void printIvec4(ivec4 value) { 210 | printInt(value.x); 211 | printString((_comma, _space)); 212 | printInt(value.y); 213 | printString((_comma, _space)); 214 | printInt(value.z); 215 | printString((_comma, _space)); 216 | printInt(value.w); 217 | } 218 | 219 | void printUvec2(uvec2 value) { 220 | printUnsignedInt(value.x); 221 | printString((_comma, _space)); 222 | printUnsignedInt(value.y); 223 | } 224 | void printUvec3(uvec3 value) { 225 | printUnsignedInt(value.x); 226 | printString((_comma, _space)); 227 | printUnsignedInt(value.y); 228 | printString((_comma, _space)); 229 | printUnsignedInt(value.z); 230 | } 231 | void printUvec4(uvec4 value) { 232 | printUnsignedInt(value.x); 233 | printString((_comma, _space)); 234 | printUnsignedInt(value.y); 235 | printString((_comma, _space)); 236 | printUnsignedInt(value.z); 237 | printString((_comma, _space)); 238 | printUnsignedInt(value.w); 239 | } 240 | 241 | void printLine() { 242 | text.charPos.x = 0; 243 | ++text.charPos.y; 244 | } 245 | 246 | #endif // UTILITY_TEXTRENDERING_INCLUDED 247 | -------------------------------------------------------------------------------- /shaders/lib/terminus.glsl: -------------------------------------------------------------------------------- 1 | // Generated by WoMspace#7331 ShaderFont Utility 2 | // from https://terminus-font.sourceforge.net/ 3 | // Distributed under the SIL Open Font License (OFL) 4 | // https://scripts.sil.org/OFL 5 | 6 | const uvec4 _space = uvec4(0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u); 7 | const uvec4 _exclm = uvec4(0x00000000u, 0x18001818u, 0x18181818u, 0x00001818u); 8 | const uvec4 _quote = uvec4(0x00000000u, 0x00000000u, 0x00000000u, 0x00666666u); 9 | const uvec4 _hash = uvec4(0x00000000u, 0xfe6c6c6cu, 0x6cfe6c6cu, 0x00006c6cu); 10 | const uvec4 _dolla = uvec4(0x10100000u, 0x1616d67cu, 0xd6d0d07cu, 0x0010107cu); 11 | const uvec4 _prcnt = uvec4(0x00000000u, 0x30366b66u, 0x6c0c1818u, 0x000066d6u); 12 | const uvec4 _amp = uvec4(0x00000000u, 0xccccdc76u, 0x6c3876dcu, 0x0000386cu); 13 | const uvec4 _opprn = uvec4(0x00000000u, 0x3030180cu, 0x30303030u, 0x00000c18u); 14 | const uvec4 _clprn = uvec4(0x00000000u, 0x0c0c1830u, 0x0c0c0c0cu, 0x00003018u); 15 | const uvec4 _astr = uvec4(0x00000000u, 0x386c0000u, 0x006c38feu, 0x00000000u); 16 | const uvec4 _comma = uvec4(0x30000000u, 0x00001818u, 0x00000000u, 0x00000000u); 17 | const uvec4 _dot = uvec4(0x00000000u, 0x00001818u, 0x00000000u, 0x00000000u); 18 | const uvec4 _fslsh = uvec4(0x00000000u, 0x30306060u, 0x0c0c1818u, 0x00000606u); 19 | 20 | // original Terminus font 21 | const uvec4 t_plus = uvec4(0x00000000u, 0x18180000u, 0x0018187eu, 0x00000000u); 22 | const uvec4 t_hyphn = uvec4(0x00000000u, 0x00000000u, 0x000000feu, 0x00000000u); 23 | const uvec4 t_0 = uvec4(0x00000000u, 0xe6c6c67cu, 0xc6cedef6u, 0x00007cc6u); 24 | const uvec4 t_1 = uvec4(0x00000000u, 0x1818187eu, 0x78181818u, 0x00001838u); 25 | const uvec4 t_2 = uvec4(0x00000000u, 0x3060c0feu, 0xc6060c18u, 0x00007cc6u); 26 | const uvec4 t_3 = uvec4(0x00000000u, 0x06c6c67cu, 0xc6063c06u, 0x00007cc6u); 27 | const uvec4 t_4 = uvec4(0x00000000u, 0xfe060606u, 0x1e3666c6u, 0x0000060eu); 28 | const uvec4 t_5 = uvec4(0x00000000u, 0x0606c67cu, 0xc0c0fc06u, 0x0000fec0u); 29 | const uvec4 t_6 = uvec4(0x00000000u, 0xc6c6c67cu, 0xc0c0fcc6u, 0x00003c60u); 30 | const uvec4 t_7 = uvec4(0x00000000u, 0x18303030u, 0x060c0c18u, 0x0000fe06u); 31 | const uvec4 t_8 = uvec4(0x00000000u, 0xc6c6c67cu, 0xc6c67cc6u, 0x00007cc6u); 32 | const uvec4 t_9 = uvec4(0x00000000u, 0x06060c78u, 0xc6c6c67eu, 0x00007cc6u); 33 | 34 | // Hornet Font 35 | const uvec4 _0 = uvec4(0x423c0000u, 0x81818181u, 0x81818181u, 0x003c4281u); 36 | const uvec4 _1 = uvec4(0x083e0000u, 0x08080808u, 0x08080808u, 0x00081828u); 37 | const uvec4 _2 = uvec4(0x407f0000u, 0x04081020u, 0x01010102u, 0x003c4281u); 38 | const uvec4 _3 = uvec4(0x423c0000u, 0x02010181u, 0x0101021cu, 0x003c4281u); 39 | const uvec4 _4 = uvec4(0x04040000u, 0x8484ff04u, 0x44444484u, 0x00040444u); 40 | const uvec4 _5 = uvec4(0x423c0000u, 0x01010181u, 0x8080fc02u, 0x00fe8080u); 41 | const uvec4 _6 = uvec4(0x423c0000u, 0xc2818181u, 0x808080bcu, 0x003c4281u); 42 | const uvec4 _7 = uvec4(0x20200000u, 0x08081010u, 0x02020404u, 0x00ff0101u); 43 | const uvec4 _8 = uvec4(0x423c0000u, 0x42818181u, 0x8181423cu, 0x003c4281u); 44 | const uvec4 _9 = uvec4(0x423c0000u, 0x3d010181u, 0x81818143u, 0x003c4281u); 45 | const uvec4 _deg = uvec4(0x00000000u, 0x00000000u, 0x90600000u, 0x00006090u); 46 | const uvec4 _plus = uvec4(0x00000000u, 0x10101000u, 0x101010feu, 0x00000000u); 47 | const uvec4 _hyphn = uvec4(0x00000000u, 0x00000000u, 0x0000007eu, 0x00000000u); 48 | const uvec4 _times = uvec4(0x00000000u, 0x28448200u, 0x82442810u, 0x00000000u); 49 | 50 | const uvec4 _colon = uvec4(0x00000000u, 0x00001818u, 0x00181800u, 0x00000000u); 51 | const uvec4 _smcln = uvec4(0x30000000u, 0x00001818u, 0x00181800u, 0x00000000u); 52 | const uvec4 _lt = uvec4(0x00000000u, 0x30180c06u, 0x0c183060u, 0x00000006u); 53 | const uvec4 _eq = uvec4(0x00000000u, 0xfe000000u, 0x00fe0000u, 0x00000000u); 54 | const uvec4 _gt = uvec4(0x00000000u, 0x0c183060u, 0x30180c06u, 0x00000060u); 55 | const uvec4 _qstn = uvec4(0x00000000u, 0x18001818u, 0xc6c60c18u, 0x00007cc6u); 56 | const uvec4 _at = uvec4(0x00000000u, 0xd6cec07eu, 0xced6d6d6u, 0x00007cc6u); 57 | const uvec4 _A = uvec4(0x00000000u, 0xc6c6c6c6u, 0xc6c6c6feu, 0x00007cc6u); 58 | const uvec4 _B = uvec4(0x00000000u, 0xc6c6c6fcu, 0xc6c6fcc6u, 0x0000fcc6u); 59 | const uvec4 _C = uvec4(0x00000000u, 0xc0c6c67cu, 0xc6c0c0c0u, 0x00007cc6u); 60 | const uvec4 _D = uvec4(0x00000000u, 0xc6c6ccf8u, 0xc6c6c6c6u, 0x0000f8ccu); 61 | const uvec4 _E = uvec4(0x00000000u, 0xc0c0c0feu, 0xc0c0f8c0u, 0x0000fec0u); 62 | const uvec4 _F = uvec4(0x00000000u, 0xc0c0c0c0u, 0xc0c0f8c0u, 0x0000fec0u); 63 | const uvec4 _G = uvec4(0x00000000u, 0xc6c6c67cu, 0xc6c0c0deu, 0x00007cc6u); 64 | const uvec4 _H = uvec4(0x00000000u, 0xc6c6c6c6u, 0xc6c6fec6u, 0x0000c6c6u); 65 | const uvec4 _I = uvec4(0x00000000u, 0x1818183cu, 0x18181818u, 0x00003c18u); 66 | const uvec4 _J = uvec4(0x00000000u, 0x0ccccc78u, 0x0c0c0c0cu, 0x00001e0cu); 67 | const uvec4 _K = uvec4(0x00000000u, 0xd8ccc6c6u, 0xccd8f0f0u, 0x0000c6c6u); 68 | const uvec4 _L = uvec4(0x00000000u, 0xc0c0c0feu, 0xc0c0c0c0u, 0x0000c0c0u); 69 | const uvec4 _M = uvec4(0x00000000u, 0xc6c6c6c6u, 0xeefed6c6u, 0x000082c6u); 70 | const uvec4 _N = uvec4(0x00000000u, 0xcec6c6c6u, 0xc6e6f6deu, 0x0000c6c6u); 71 | const uvec4 _O = uvec4(0x00000000u, 0xc6c6c67cu, 0xc6c6c6c6u, 0x00007cc6u); 72 | const uvec4 _P = uvec4(0x00000000u, 0xc0c0c0c0u, 0xc6c6c6fcu, 0x0000fcc6u); 73 | const uvec4 _Q = uvec4(0x06000000u, 0xc6c6de7cu, 0xc6c6c6c6u, 0x00007cc6u); 74 | const uvec4 _R = uvec4(0x00000000u, 0xf0d8ccc6u, 0xc6c6c6fcu, 0x0000fcc6u); 75 | const uvec4 _S = uvec4(0x00000000u, 0x06c6c67cu, 0xc0c07c06u, 0x00007cc6u); 76 | const uvec4 _T = uvec4(0x00000000u, 0x18181818u, 0x18181818u, 0x0000ff18u); 77 | const uvec4 _U = uvec4(0x00000000u, 0xc6c6c67cu, 0xc6c6c6c6u, 0x0000c6c6u); 78 | const uvec4 _V = uvec4(0x00000000u, 0x6c6c3838u, 0xc6c6c66cu, 0x0000c6c6u); 79 | const uvec4 _W = uvec4(0x00000000u, 0xfeeec682u, 0xc6c6c6d6u, 0x0000c6c6u); 80 | const uvec4 _X = uvec4(0x00000000u, 0x6c6cc6c6u, 0x6c6c3838u, 0x0000c6c6u); 81 | const uvec4 _Y = uvec4(0x00000000u, 0x18181818u, 0x66663c18u, 0x0000c3c3u); 82 | const uvec4 _Z = uvec4(0x00000000u, 0x60c0c0feu, 0x060c1830u, 0x0000fe06u); 83 | const uvec4 _opsqr = uvec4(0x00000000u, 0x3030303cu, 0x30303030u, 0x00003c30u); 84 | const uvec4 _bslsh = uvec4(0x00000000u, 0x0c0c0606u, 0x30301818u, 0x00006060u); 85 | const uvec4 _clsqr = uvec4(0x00000000u, 0x0c0c0c3cu, 0x0c0c0c0cu, 0x00003c0cu); 86 | const uvec4 _caret = uvec4(0x00000000u, 0x00000000u, 0x00000000u, 0x00183c66u); 87 | const uvec4 _under = uvec4(0x00fe0000u, 0x00000000u, 0x00000000u, 0x00000000u); 88 | const uvec4 _tick = uvec4(0x00000000u, 0x00000000u, 0x00000000u, 0x30180000u); 89 | const uvec4 _a = uvec4(0x00000000u, 0xc6c6c67eu, 0x007c067eu, 0x00000000u); 90 | const uvec4 _b = uvec4(0x00000000u, 0xc6c6c6fcu, 0xc0fcc6c6u, 0x0000c0c0u); 91 | const uvec4 _c = uvec4(0x00000000u, 0xc0c0c67cu, 0x007cc6c0u, 0x00000000u); 92 | const uvec4 _d = uvec4(0x00000000u, 0xc6c6c67eu, 0x067ec6c6u, 0x00000606u); 93 | const uvec4 _e = uvec4(0x00000000u, 0xfec0c07cu, 0x007cc6c6u, 0x00000000u); 94 | const uvec4 _f = uvec4(0x00000000u, 0x30303030u, 0x30fc3030u, 0x00001e30u); 95 | const uvec4 _g = uvec4(0x06067c00u, 0xc6c6c67eu, 0x007ec6c6u, 0x00000000u); 96 | const uvec4 _h = uvec4(0x00000000u, 0xc6c6c6c6u, 0xc0fcc6c6u, 0x0000c0c0u); 97 | const uvec4 _i = uvec4(0x00000000u, 0x1818183cu, 0x00381818u, 0x00001818u); 98 | const uvec4 _j = uvec4(0x66663c00u, 0x06060606u, 0x000e0606u, 0x00000606u); 99 | const uvec4 _k = uvec4(0x00000000u, 0xf0d8ccc6u, 0xc0c6ccd8u, 0x0000c0c0u); 100 | const uvec4 _l = uvec4(0x00000000u, 0x1818183cu, 0x18181818u, 0x00003818u); 101 | const uvec4 _m = uvec4(0x00000000u, 0xd6d6d6d6u, 0x00fcd6d6u, 0x00000000u); 102 | const uvec4 _n = uvec4(0x00000000u, 0xc6c6c6c6u, 0x00fcc6c6u, 0x00000000u); 103 | const uvec4 _o = uvec4(0x00000000u, 0xc6c6c67cu, 0x007cc6c6u, 0x00000000u); 104 | const uvec4 _p = uvec4(0xc0c0c000u, 0xc6c6c6fcu, 0x00fcc6c6u, 0x00000000u); 105 | const uvec4 _q = uvec4(0x06060600u, 0xc6c6c67eu, 0x007ec6c6u, 0x00000000u); 106 | const uvec4 _r = uvec4(0x00000000u, 0xc0c0c0c0u, 0x00def0e0u, 0x00000000u); 107 | const uvec4 _s = uvec4(0x00000000u, 0x7c0606fcu, 0x007ec0c0u, 0x00000000u); 108 | const uvec4 _t = uvec4(0x00000000u, 0x3030301eu, 0x30fc3030u, 0x00003030u); 109 | const uvec4 _u = uvec4(0x00000000u, 0xc6c6c67eu, 0x00c6c6c6u, 0x00000000u); 110 | const uvec4 _v = uvec4(0x00000000u, 0x6c6c3838u, 0x00c6c6c6u, 0x00000000u); 111 | const uvec4 _w = uvec4(0x00000000u, 0xd6d6d67cu, 0x00c6c6d6u, 0x00000000u); 112 | const uvec4 _x = uvec4(0x00000000u, 0x386cc6c6u, 0x00c6c66cu, 0x00000000u); 113 | const uvec4 _y = uvec4(0x06067c00u, 0xc6c6c67eu, 0x00c6c6c6u, 0x00000000u); 114 | const uvec4 _z = uvec4(0x00000000u, 0x3060c0feu, 0x00fe0c18u, 0x00000000u); 115 | const uvec4 _opbrc = uvec4(0x00000000u, 0x3030301cu, 0x30306030u, 0x00001c30u); 116 | const uvec4 _pipe = uvec4(0x00000000u, 0x18181818u, 0x18181818u, 0x00001818u); 117 | const uvec4 _clbrc = uvec4(0x00000000u, 0x18181870u, 0x18180c18u, 0x00007018u); 118 | const uvec4 _tilde = uvec4(0x00000000u, 0x00000000u, 0x00000000u, 0x0073dbceu); 119 | const uvec4 _block = uvec4(0xFFFF0000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x00FFFFFFu); -------------------------------------------------------------------------------- /shaders/composite.fsh: -------------------------------------------------------------------------------- 1 | #version 150 compatibility 2 | 3 | #include "/lib/settings.h" 4 | #include "/lib/iris.glsl" 5 | 6 | uniform sampler2D colortex0; // albedo 7 | uniform sampler2D colortex3; // normals, entity mask 8 | uniform sampler2D depthtex0; 9 | in vec2 uv; 10 | 11 | 12 | #if defined(SHOW_PLAYER_HUD) && defined(IS_IRIS) 13 | uniform float currentPlayerHealth; 14 | uniform float maxPlayerHealth; 15 | uniform float currentPlayerAir; 16 | uniform float maxPlayerAir; 17 | uniform float currentPlayerHunger; 18 | uniform float maxPlayerHunger; 19 | #endif 20 | 21 | #if defined HUD_COMPASS_HORIZONTAL || defined HUD_COMPASS_VERTICAL 22 | uniform mat4 gbufferModelView; 23 | #endif 24 | 25 | #ifdef HUD_COORDS 26 | uniform vec3 cameraPosition; 27 | #endif 28 | #ifdef HUD_CAMERA_DETAILS 29 | uniform mat4 gbufferProjection; 30 | #endif 31 | 32 | uniform float frameTimeCounter; 33 | uniform int hideGUI; 34 | uniform float far; 35 | uniform float near; 36 | uniform float aspectRatio; 37 | 38 | const float edge_kernel[9] = float[](-1.0, -1.0, -1.0, -1.0, 8.0, -1.0, -1.0, -1.0, -1.0); 39 | 40 | // Choc version 41 | float linearizeDepth(float dist) { 42 | return (2.0 * near) / (far + near - dist * (far - near)); 43 | } 44 | 45 | bool equals(float input1, float input2, float epsilon) { 46 | return abs(input1 - input2) < epsilon; 47 | } 48 | 49 | bool isCross(ivec2 position, int crossLength, int crossGirth) { 50 | return (abs(gl_FragCoord.x - position.x) < crossLength && abs(gl_FragCoord.y - position.y) < crossGirth) 51 | || (abs(gl_FragCoord.y - position.y) < crossLength && abs(gl_FragCoord.x - position.x) < crossGirth); 52 | } 53 | 54 | /* RENDERTARGETS:0 */ 55 | void main() { 56 | 57 | vec3 color = vec3(0.0); 58 | 59 | 60 | #ifdef IS_IRIS 61 | #ifdef SHOW_PLAYER_HUD 62 | // HP bar 63 | if(uv.x > 0.275 && uv.x < 0.475 - (0.2 - currentPlayerHealth * 0.2) && uv.y > 0.125 && uv.y < 0.15 && currentPlayerHealth > 0.0) { 64 | color = vec3(1.0, 0.0, 0.0); 65 | gl_FragData[0] = vec4(color, 1.0); 66 | return; 67 | } else if(currentPlayerHealth > -1.0 && uv.x > 0.275 && uv.x < 0.475 && uv.y > 0.1225 && uv.y < 0.125) { 68 | color = vec3(1.0, 0.0, 0.0); 69 | gl_FragData[0] = vec4(color, 1.0); 70 | return; 71 | } 72 | // Hunger bar 73 | else if(uv.x > 0.525 + (0.2 - currentPlayerHunger * 0.2) && uv.x < 0.725 && uv.y > 0.125 && uv.y < 0.15) { 74 | color = vec3(1.0, 1.0, 0.0); 75 | gl_FragData[0] = vec4(color, 1.0); 76 | return; 77 | } else if(currentPlayerHunger > -1.0 && uv.x > 0.525 && uv.x < 0.725 && uv.y > 0.1225 && uv.y < 0.125) { 78 | color = vec3(1.0, 1.0, 0.0); 79 | gl_FragData[0] = vec4(color, 1.0); 80 | return; 81 | } 82 | // Air bar 83 | else if(currentPlayerAir < 1.0 && uv.x > 0.275 + (0.225 - currentPlayerAir * 0.225) && uv.x < 0.725 - (0.225 - currentPlayerAir * 0.225) && uv.y > 0.175 && uv.y < 0.2) { 84 | color = vec3(0.0, 0.5, 1.0); 85 | gl_FragData[0] = vec4(color, 1.0); 86 | return; 87 | } 88 | else if(currentPlayerAir > -1.0 && currentPlayerAir < 1.0 && uv.x > 0.275 && uv.x < 0.725 && uv.y > 0.1725 && uv.y < 0.175) { 89 | color = vec3(0.0, 0.5, 1.0); 90 | gl_FragData[0] = vec4(color, 1.0); 91 | return; 92 | } 93 | #if HUD_CROSSHAIR == 1 94 | // Cross crosshair 95 | ivec2 screenCenter = ivec2(viewWidth, viewHeight) / 2; 96 | if(isCross(screenCenter, 10, 1)) { 97 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 98 | return; 99 | } 100 | #elif HUD_CROSSHAIR == 2 101 | // Circle crosshair 102 | ivec2 screenCenter = ivec2(viewWidth, viewHeight) / 2; 103 | float dist = distance(screenCenter, gl_FragCoord.xy); 104 | if(dist < 10 && dist > 9 || dist < 1) { 105 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 106 | return; 107 | } 108 | #endif 109 | #endif 110 | #elif defined(SHOW_PLAYER_HUD) 111 | if(hideGUI == 0){ 112 | showWarning(color, frameTimeCounter); 113 | gl_FragData[0] = vec4(color, 1.0); 114 | return; 115 | } 116 | #endif 117 | 118 | #ifdef RESEAU_PLATE 119 | for(int x = 0; x < FIDUCIAL_MARKERS_X; x++) { for(int y = 0; y < FIDUCIAL_MARKERS_Y; y++) { 120 | ivec2 marker_position = ivec2( 121 | viewWidth / FIDUCIAL_MARKERS_X * (x + 0.5), 122 | viewHeight / FIDUCIAL_MARKERS_Y * (y + 0.5) 123 | ); 124 | 125 | if(isCross(marker_position, 20, 1)) { 126 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 127 | return; 128 | }; 129 | }} 130 | #endif 131 | 132 | #ifdef HUD_COORDS 133 | { 134 | ivec3 coords = ivec3(cameraPosition); 135 | // box 136 | if(uv.x > 0.01 && uv.x < 0.08 && uv.y > 0.85 && uv.y < 0.97) { 137 | if(uv.x > 0.011 && uv.x < 0.079 && uv.y > 0.8515 && uv.y < 0.9685) { 138 | vec3 col = vec3(0.0); 139 | beginText(ivec2(gl_FragCoord.xy * 0.5), ivec2(vec2(0.025 * viewWidth, 0.97 * viewHeight) * 0.5)); 140 | text.fgCol = vec4(USER_COLOR, 1.0); 141 | // right-align 142 | if(abs(coords.x) < 1000) {printString((_space));}; if(abs(coords.x) < 100) {printString((_space));}; if(abs(coords.x) < 10) {printString((_space));}; if(coords.x >= 0) printString((_space)); 143 | // x-component 144 | printInt(coords.x); printLine(); 145 | // right-align 146 | if(abs(coords.y) < 1000) {printString((_space));}; if(abs(coords.y) < 100) {printString((_space));}; if(abs(coords.y) < 10) {printString((_space));}; if(coords.y >= 0) printString((_space)); 147 | // y-component 148 | printInt(coords.y); printLine(); 149 | // right-align 150 | if(abs(coords.z) < 1000) {printString((_space));}; if(abs(coords.z) < 100) {printString((_space));}; if(abs(coords.z) < 10) {printString((_space));}; if(coords.z >= 0) printString((_space)); 151 | // z-component 152 | printInt(coords.z); 153 | endText(col); 154 | gl_FragData[0] = vec4(col, 1.0); 155 | return; 156 | } else { 157 | 158 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 159 | return; 160 | } 161 | } 162 | } 163 | #endif 164 | 165 | #ifdef HUD_CAMERA_DETAILS 166 | { 167 | if(uv.x > 0.01 && uv.x < 0.15 && uv.y > 0.04 && uv.y < 0.125) { 168 | if(uv.x > 0.011 && uv.x < 0.149 && uv.y > 0.0415 && uv.y < 0.1235) { 169 | vec3 col = vec3(0.0); 170 | beginText(ivec2(gl_FragCoord.xy * 0.5), ivec2(0.015 * viewWidth, 0.125 * viewHeight) / 2); 171 | text.fgCol = vec4(USER_COLOR, 1.0); 172 | float focal_length = gbufferProjection[1].y * 11.87; 173 | float fov = 2.0 * atan(24.0 / (2.0 * focal_length)); 174 | fov = degrees(fov); 175 | // right-align 176 | // if(fov < 100.0) {printChar(_space);}; if(fov < 10.0) { printChar(_space);}; 177 | printUnsignedInt(uint(fov)); printChar(_deg); 178 | printLine(); 179 | printUnsignedInt(uint(viewWidth)); printChar(_times); printUnsignedInt(uint(viewHeight)); 180 | endText(col); 181 | gl_FragData[0] = vec4(col, 1.0); 182 | return; 183 | } else { 184 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 185 | return; 186 | } 187 | } 188 | } 189 | #endif 190 | 191 | #ifdef HUD_COMPASS_HORIZONTAL 192 | { 193 | float size = HUD_COMPASS_HORIZONTAL_SPACING; 194 | float theta = gbufferModelView[0][0]; 195 | theta = acos(theta) / 3.1415926; 196 | if(gbufferModelView[2][0] < 0.0) theta *= -1.0; 197 | theta *= 180.0; 198 | 199 | // calibration line 200 | if(abs(uv.x - 0.5) < 0.0005 && uv.y > 0.915 && uv.y < 0.955) { 201 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 202 | return; 203 | } 204 | 205 | // lines 206 | if(uv.x > 0.3 && uv.x < 0.7 && uv.y > 0.92 && uv.y < 0.95) { 207 | for(int angle_marker = 0; angle_marker < 720; angle_marker += 5) { 208 | float offset = -theta * size + viewWidth * 0.5; 209 | if(theta < 180.0) { offset -= 360.0 * size; } 210 | float line_pos = angle_marker * size + offset; 211 | if(abs(gl_FragCoord.x - line_pos) < 1.0) { 212 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 213 | return; 214 | } 215 | } 216 | gl_FragData[0] = vec4(0.0); 217 | return; 218 | } 219 | // text 220 | if(uv.x > 0.3 && uv.x < 0.7 && uv.y > 0.95 && uv.y < 0.99) { 221 | beginText(ivec2(gl_FragCoord.xy * 0.5), ivec2(0)); 222 | text.fgCol = vec4(USER_COLOR, 1.0); 223 | text.bgCol = vec4(0.0); 224 | vec3 text_line = vec3(0.0); 225 | 226 | for(int angle_marker = 0; angle_marker < 720; angle_marker += 10) { 227 | float offset = -theta * size + viewWidth * 0.5; 228 | float digit_offset = 6.0; 229 | if(angle_marker % 360 >= 10.0) digit_offset += 10.0; 230 | if(angle_marker % 360 >= 100.0) digit_offset += 8.0; 231 | if(theta < 180.0) { offset -= 360.0 * size; } 232 | vec2 text_pos = vec2(angle_marker * size + offset - digit_offset, viewHeight * 0.993) * 0.5; 233 | text.charPos = ivec2(0); 234 | text.textPos = ivec2(text_pos); 235 | printInt(angle_marker % 360); 236 | // printLine(); 237 | // printChar(_pipe); 238 | } 239 | 240 | endText(text_line); 241 | gl_FragData[0] = vec4(text_line, 1.0); 242 | return; 243 | } 244 | } 245 | #endif 246 | #ifdef HUD_COMPASS_VERTICAL 247 | { 248 | const float size = HUD_COMPASS_VERTICAL_SPACING; 249 | float theta = gbufferModelView[1][2]; 250 | theta = acos(theta) / 3.1415926; 251 | theta = theta * 180.0 - 90.0; 252 | 253 | // calibration line 254 | if(uv.x > 0.045 && uv.x < 0.075 && abs(uv.y - 0.5) < 0.001) { 255 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 256 | return; 257 | } 258 | // lines 259 | if(uv.x > 0.05 && uv.x < 0.07 && uv.y > 0.2 && uv.y < 0.8) { 260 | for(int angle_marker = -130; angle_marker <= 130; angle_marker += 5) { 261 | float offset = -theta * size + viewHeight * 0.5; 262 | float line_pos = angle_marker * size + offset; 263 | if(abs(gl_FragCoord.y - line_pos) < 1.0) { 264 | gl_FragData[0] = vec4(USER_COLOR, 1.0); 265 | return; 266 | } 267 | } 268 | gl_FragData[0] = vec4(0.0); 269 | return; 270 | } 271 | 272 | // text 273 | if(uv.x > 0.01 && uv.x < 0.05 && uv.y > 0.2 && uv.y < 0.8) { 274 | beginText(ivec2(gl_FragCoord.xy * 0.5), ivec2(0)); 275 | text.fgCol = vec4(USER_COLOR, 1.0); 276 | text.bgCol = vec4(0.0); 277 | vec3 text_line = vec3(0.0); 278 | 279 | for(int angle_marker = -130; angle_marker <= 130; angle_marker += 10) { 280 | float offset = -theta * size + viewHeight * 0.5; 281 | vec2 digit_offset = vec2(0.0, 10.0); 282 | if(angle_marker < 0.0) digit_offset.x -= 9.0; 283 | if(abs(angle_marker) >= 10.0) digit_offset.x -= 9.0; 284 | if(abs(angle_marker) >= 100.0) digit_offset.x -= 9.0; 285 | vec2 text_pos = vec2(viewWidth * 0.035, angle_marker * size + offset) * 0.5 + digit_offset; 286 | text.charPos = ivec2(0); 287 | text.textPos = ivec2(text_pos); 288 | printInt(angle_marker); 289 | } 290 | 291 | endText(text_line); 292 | gl_FragData[0] = vec4(text_line, 1.0); 293 | return; 294 | } 295 | } 296 | #endif 297 | 298 | 299 | 300 | for(int y = 0; y < 3; y++) { 301 | for(int x = 0; x < 3; x++) { 302 | vec2 offset = pixelSize * vec2(x - 1, y - 1) * 1.0; 303 | color += texture2D(colortex0, uv + offset).rgb * edge_kernel[y * 3 + x]; 304 | } 305 | } 306 | color /= 4.5; 307 | 308 | float depth = 0.0; 309 | for(int y = 0; y < 3; y++) { 310 | for(int x = 0; x < 3; x++) { 311 | vec2 offset = pixelSize * vec2(float(x) - 1.0, float(y) - 1.0) * 1.0; 312 | float rawDepth = texture2D(depthtex0, uv + offset).r; 313 | depth += linearizeDepth(rawDepth) * edge_kernel[y * 3 + x]; 314 | } 315 | } 316 | depth *= 0.8; 317 | 318 | vec3 normal = vec3(0.0); 319 | for(int y = 0; y < 3; y++) { 320 | for(int x = 0; x < 3; x++) { 321 | vec2 offset = pixelSize * vec2(x - 1, y - 1) * 1.0; 322 | normal += texture2D(colortex3, uv + offset).rgb * edge_kernel[y * 3 + x]; 323 | } 324 | } 325 | 326 | // Human eye sensitivity 327 | float grey = dot(color, vec3(0.21, 0.72, 0.07)); 328 | float normalGrey = dot(abs(normal), vec3(1.0)); 329 | 330 | float sobelLine = grey > LINE_THRESHOLD_CONTRAST ? 1.0 : 0.0; 331 | float depthLine = depth > LINE_THRESHOLD_DEPTH ? 1.0 : 0.0; 332 | float normalLine = normalGrey > LINE_THRESHOLD_NORMAL ? 1.0 : 0.0; 333 | float line = max(depthLine, sobelLine); 334 | line = max(line, normalLine); 335 | 336 | #ifdef MONOCHROME 337 | color = normalize(USER_COLOR) * line; 338 | #else 339 | color = normalize(color) * line; 340 | #endif 341 | 342 | #ifdef ENTITY_RADAR 343 | float entityMask = texture2D(colortex3, uv).a; 344 | 345 | #ifdef RADAR_FILLED 346 | bool doRadarColor = entityMask > 0.01; 347 | #else 348 | bool doRadarColor = line > 0.01; 349 | #endif 350 | 351 | if(doRadarColor) { 352 | color = equals(entityMask, 0.1, 0.01) ? ENTITY_COLOR_HOSTILE : color; 353 | color = equals(entityMask, 0.2, 0.01) ? ENTITY_COLOR_FRIENDLY : color; 354 | color = equals(entityMask, 0.3, 0.01) ? ENTITY_COLOR_PLAYER : color; 355 | } 356 | #endif 357 | 358 | gl_FragData[0] = vec4(color, 1.0); 359 | } --------------------------------------------------------------------------------