mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
Add photonics API support, add photonics WSR, reduce flickering on photonics 3D blocks, add warning message for shader grass on unsupported versions, fix 4 layers of glass turning into water
This commit is contained in:
+92
-29
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
#extension GL_ARB_shader_image_load_store: enable
|
||||
#extension GL_ARB_shading_language_packing: enable
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@ uniform sampler2D gtexture;
|
||||
uniform sampler2D noisetex;
|
||||
uniform sampler2D colortex4;
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
uniform usampler1D texBlockData;
|
||||
uniform sampler3D texLpv1;
|
||||
uniform sampler3D texLpv2;
|
||||
@@ -113,7 +113,7 @@ uniform int heldItemId2;
|
||||
#include "/lib/hsv.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
#include "/lib/lpv_blocks.glsl"
|
||||
#include "/lib/lpv_common.glsl"
|
||||
#include "/lib/lpv_render.glsl"
|
||||
@@ -486,7 +486,7 @@ void main() {
|
||||
gl_FragData[0].a = color.a;
|
||||
#endif
|
||||
#ifndef BLOOMY_PARTICLES
|
||||
gl_FragData[1].a = 0.0; // for bloomy rain and stuff
|
||||
gl_FragData[1] = vec4(0.0); // for bloomy rain and stuff
|
||||
#endif
|
||||
|
||||
gl_FragData[3] = vec4(0.0,0.0,0.0,0.4);
|
||||
|
||||
@@ -683,8 +683,8 @@ void main() {
|
||||
float gray = dot(Albedo.rgb, vec3(0.2, 1.0, 0.07));
|
||||
if (
|
||||
data_in.blockID == BLOCK_AMETHYST_BUD_MEDIUM || data_in.blockID == BLOCK_AMETHYST_BUD_LARGE || data_in.blockID == BLOCK_AMETHYST_CLUSTER
|
||||
|| data_in.blockID == BLOCK_SSS_STRONG || data_in.blockID == BLOCK_SSS_WEAK
|
||||
|| data_in.blockID == BLOCK_GLOW_LICHEN || data_in.blockID == BLOCK_SNOW_LAYERS
|
||||
|| data_in.blockID == BLOCK_SSS_STRONG || data_in.blockID == BLOCK_SSS_STRONG3 || data_in.blockID == BLOCK_SSS_WEAK || data_in.blockID == BLOCK_CACTUS
|
||||
|| data_in.blockID == BLOCK_CELESTIUM || data_in.blockID == BLOCK_SNOW_LAYERS
|
||||
|| data_in.blockID >= 10 && data_in.blockID < 80
|
||||
) {
|
||||
// IR Reflective (Pink-red)
|
||||
@@ -782,7 +782,7 @@ void main() {
|
||||
/////// ----- SSS ON BLOCKS ----- ///////
|
||||
// strong
|
||||
if (
|
||||
data_in.blockID == BLOCK_SSS_STRONG || data_in.blockID == BLOCK_AIR_WAVING || data_in.blockID == BLOCK_SSS_STRONG_2
|
||||
data_in.blockID == BLOCK_SSS_STRONG || data_in.blockID == BLOCK_SSS_STRONG3 || data_in.blockID == BLOCK_AIR_WAVING || data_in.blockID == BLOCK_SSS_STRONG_2
|
||||
) {
|
||||
SSSAMOUNT = 1.0;
|
||||
}
|
||||
@@ -790,8 +790,8 @@ void main() {
|
||||
else if (
|
||||
data_in.blockID == BLOCK_GROUND_WAVING || data_in.blockID == BLOCK_GROUND_WAVING_VERTICAL ||
|
||||
data_in.blockID == BLOCK_GRASS_SHORT || data_in.blockID == BLOCK_GRASS_TALL_UPPER || data_in.blockID == BLOCK_GRASS_TALL_LOWER ||
|
||||
data_in.blockID == BLOCK_SSS_WEAK || data_in.blockID == BLOCK_SSS_WEAK_2 ||
|
||||
data_in.blockID == BLOCK_GLOW_LICHEN || data_in.blockID == BLOCK_SNOW_LAYERS || data_in.blockID == BLOCK_CARPET ||
|
||||
data_in.blockID == BLOCK_SSS_WEAK || data_in.blockID == BLOCK_CACTUS || data_in.blockID == BLOCK_SSS_WEAK_2 ||
|
||||
data_in.blockID == BLOCK_CELESTIUM || (data_in.blockID >= 269 && data_in.blockID <= 274) || data_in.blockID == BLOCK_SNOW_LAYERS || data_in.blockID == BLOCK_CARPET ||
|
||||
data_in.blockID == BLOCK_AMETHYST_BUD_MEDIUM || data_in.blockID == BLOCK_AMETHYST_BUD_LARGE || data_in.blockID == BLOCK_AMETHYST_CLUSTER ||
|
||||
data_in.blockID == BLOCK_BAMBOO || data_in.blockID == BLOCK_SAPLING || data_in.blockID == BLOCK_VINE || data_in.blockID == BLOCK_VINE_OTHER
|
||||
#ifdef MISC_BLOCK_SSS
|
||||
@@ -831,26 +831,28 @@ void main() {
|
||||
// if(vNameTags > 0) EMISSIVE = 0.9;
|
||||
|
||||
// normal block lightsources
|
||||
if(data_in.blockID >= 100 && data_in.blockID < 300) EMISSIVE = 0.5;
|
||||
if(data_in.blockID >= 100 && data_in.blockID < 282) {
|
||||
EMISSIVE = 0.5;
|
||||
|
||||
if(data_in.blockID == 266 || data_in.blockID == 497) EMISSIVE = 0.2; // sculk stuff
|
||||
if(data_in.blockID == 266 || (data_in.blockID >= 276 && data_in.blockID <= 281)) EMISSIVE = 0.2; // sculk stuff
|
||||
|
||||
else if(data_in.blockID == 195) EMISSIVE = 2.3; // glow lichen
|
||||
else if(data_in.blockID == 195) EMISSIVE = 2.3; // glow lichen
|
||||
|
||||
else if(data_in.blockID == 185) EMISSIVE = 1.5; // crying obsidian
|
||||
else if(data_in.blockID == 185) EMISSIVE = 1.5; // crying obsidian
|
||||
|
||||
else if(data_in.blockID == 105) EMISSIVE = 2.0; // brewing stand
|
||||
|
||||
else if(data_in.blockID == 236) EMISSIVE = 1.0; // respawn anchor
|
||||
else if(data_in.blockID == 105) EMISSIVE = 2.0; // brewing stand
|
||||
|
||||
else if(data_in.blockID == 236) EMISSIVE = 1.0; // respawn anchor
|
||||
|
||||
else if(data_in.blockID == 101) EMISSIVE = 0.7; // large amethyst bud
|
||||
else if(data_in.blockID == 101) EMISSIVE = 0.7; // large amethyst bud
|
||||
|
||||
else if(data_in.blockID == 103) EMISSIVE = 1.0; // amethyst cluster
|
||||
else if(data_in.blockID == 103) EMISSIVE = 1.0; // amethyst cluster
|
||||
|
||||
else if(data_in.blockID == 244) EMISSIVE = 1.5; // soul fire
|
||||
else if(data_in.blockID == 244) EMISSIVE = 1.5; // soul fire
|
||||
}
|
||||
|
||||
#if EMISSIVE_ORES > 0
|
||||
else if(data_in.blockID == 502) {
|
||||
if(data_in.blockID == 502) {
|
||||
EMISSIVE = EMISSIVE_ORES_STRENGTH;
|
||||
|
||||
#ifndef HARDCODED_EMISSIVES_APPROX
|
||||
@@ -901,6 +903,14 @@ void main() {
|
||||
bool emissionCheck = SpecularTex.a <= 0.0;
|
||||
#endif
|
||||
|
||||
#ifdef MIRROR_IRON
|
||||
if(data_in.blockID == 504 || currentRenderedItemId == 504) {
|
||||
OutSpecular.rg = vec2(1.0, 1.0);
|
||||
Albedo.rgb = vec3(1.0);
|
||||
// normal = flatNormals;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined HARDCODED_EMISSIVES_APPROX && (EMISSIVE_TYPE == 1 || EMISSIVE_TYPE == 2)
|
||||
#if EMISSIVE_TYPE == 2 && EMISSIVE_TRIMS > 0
|
||||
if(emissionCheck && !isTrim)
|
||||
|
||||
@@ -85,6 +85,7 @@ uniform sampler2D depthtex2;
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex7;
|
||||
uniform sampler2D colortex9;
|
||||
uniform sampler2D colortex11;
|
||||
uniform sampler2D colortex12;
|
||||
uniform sampler2D colortex13;
|
||||
@@ -188,6 +189,7 @@ uniform float dhVoxyFarPlane;
|
||||
#include "/lib/hsv.glsl"
|
||||
#include "/lib/lpv_common.glsl"
|
||||
#include "/lib/lpv_render.glsl"
|
||||
// #include "/lib/voxel_common.glsl"
|
||||
#endif
|
||||
|
||||
#define FORWARD_SPECULAR
|
||||
@@ -207,12 +209,16 @@ uniform float dhVoxyFarPlane;
|
||||
|
||||
uniform vec3 relativeEyePosition;
|
||||
|
||||
vec2 decodeVec2(float a){
|
||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||
const float constant2 = 256. / 255.;
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
|
||||
#include "/lib/blocks.glsl"
|
||||
#include "/lib/lpv_blocks.glsl"
|
||||
#include "/lib/lpv_buffer.glsl"
|
||||
|
||||
#include "/lib/specular.glsl"
|
||||
#if defined VIVECRAFT
|
||||
uniform bool vivecraftIsVR;
|
||||
uniform vec3 vivecraftRelativeMainHandPos;
|
||||
@@ -221,6 +227,20 @@ uniform vec3 relativeEyePosition;
|
||||
uniform mat4 vivecraftRelativeOffHandRot;
|
||||
#endif
|
||||
|
||||
#define VOXEL_REFLECTIONS_TRANSLUCENT
|
||||
|
||||
#ifdef VOXEL_REFLECTIONS_TRANSLUCENT
|
||||
#endif
|
||||
|
||||
#ifdef PHOTONICS
|
||||
#ifdef VOXEL_REFLECTIONS
|
||||
// #define VOXEL_REFLECTIONS
|
||||
#define PHOTONICS_INCLUDED
|
||||
|
||||
#include "/photonics/photonics.glsl"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "/lib/diffuse_lighting.glsl"
|
||||
|
||||
#if defined PHYSICSMOD_OCEAN_SHADER
|
||||
@@ -475,18 +495,14 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "/lib/specular.glsl"
|
||||
|
||||
void convertHandDepth(inout float depth) {
|
||||
float ndcDepth = depth * 2.0 - 1.0;
|
||||
ndcDepth /= MC_HAND_DEPTH;
|
||||
depth = ndcDepth * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
vec2 decodeVec2(float a){
|
||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||
const float constant2 = 256. / 255.;
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
|
||||
void Emission(
|
||||
inout vec3 Lighting,
|
||||
vec3 Albedo,
|
||||
@@ -611,10 +627,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
|
||||
// bool isHand = abs(MATERIALS - 0.1) < 0.01;
|
||||
bool isWater = MATERIALS > 0.99;
|
||||
bool isReflectiveEntity = abs(MATERIALS - 0.8) < 0.01;
|
||||
bool isReflective = abs(MATERIALS - 0.7) < 0.01 || isWater || isReflectiveEntity;
|
||||
bool isEntity = abs(MATERIALS - 0.9) < 0.01 || isReflectiveEntity;
|
||||
bool isNetherPortal = abs(MATERIALS - 0.6) < 0.01;
|
||||
bool isReflectiveEntity = abs(MATERIALS - 0.2) < 0.01;
|
||||
bool isReflective = abs(MATERIALS - 0.1) < 0.01 || isWater || isReflectiveEntity;
|
||||
bool isEntity = abs(MATERIALS - 0.4) < 0.01 || isReflectiveEntity;
|
||||
// bool isNetherPortal = abs(MATERIALS - 0.6) < 0.01;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////// ALBEDO /////////////////////////////////////
|
||||
@@ -1014,10 +1030,11 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
#endif
|
||||
|
||||
///////////////////////// BLOCKLIGHT LIGHTING OR LPV LIGHTING OR FLOODFILL COLORED LIGHTING
|
||||
vec3 flatWorldNormal = viewToWorld(normalMat.xyz).xyz;
|
||||
#ifdef IS_LPV_ENABLED
|
||||
vec3 normalOffset = vec3(0.0);
|
||||
|
||||
if (any(greaterThan(abs(viewToWorld(normalMat.xyz).xyz), vec3(1.0e-6))))
|
||||
if (any(greaterThan(abs(flatWorldNormal), vec3(1.0e-6))))
|
||||
normalOffset = 0.5*worldSpaceNormal;
|
||||
|
||||
#if LPV_NORMAL_STRENGTH > 0
|
||||
@@ -1109,7 +1126,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
vec3 sunVec = WsunVec;
|
||||
#endif
|
||||
|
||||
vec3 specularReflections = specularReflections(viewPos, normalize(feetPlayerPos), sunVec, vec3(BN, vec2(interleaved_gradientNoise_temporal())), worldSpaceNormal, roughness, f0, Albedo, FinalColor*gl_FragData[0].a, DirectLightColor * Shadows * Shadows, lightmap.y, isHand, isWater, reflectance, flashLightSpecularData);
|
||||
vec3 specularReflections = specularReflections(viewPos, shadowPlayerPos, normalize(feetPlayerPos), sunVec, vec2(BN, interleaved_gradientNoise_temporal()), flatWorldNormal, worldSpaceNormal, roughness, f0, Albedo, FinalColor*gl_FragData[0].a, DirectLightColor * Shadows * Shadows, lightmap.y, isHand, isWater, reflectance, flashLightSpecularData);
|
||||
|
||||
gl_FragData[0].a = gl_FragData[0].a + (1.0-gl_FragData[0].a) * reflectance;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "/lib/SSBOs.glsl"
|
||||
|
||||
#include "/lib/blocks.glsl"
|
||||
#include "/lib/entities.glsl"
|
||||
|
||||
uniform float frameTimeCounter;
|
||||
@@ -210,22 +211,27 @@ void main() {
|
||||
float mat = 0.0;
|
||||
|
||||
// water mask
|
||||
if(isWater) {
|
||||
if(isWater
|
||||
#if MC_VERSION > 12111
|
||||
|| mc_Entity.x == 505
|
||||
#endif
|
||||
|
||||
) {
|
||||
mat = 1.0;
|
||||
}
|
||||
|
||||
// translucent entities
|
||||
#if defined ENTITIES || defined BLOCKENTITIES
|
||||
mat = 0.9;
|
||||
if (entityId == 1804) mat = 0.8;
|
||||
mat = 0.4;
|
||||
if (entityId == 1804) mat = 0.2;
|
||||
#endif
|
||||
|
||||
// translucent blocks
|
||||
if (mc_Entity.x >= 301 && mc_Entity.x <= 321) mat = 0.7;
|
||||
if (mc_Entity.x >= 301 && mc_Entity.x <= 338) mat = 0.1;
|
||||
|
||||
if (mc_Entity.x == 320) mat = 0.6;
|
||||
// if (mc_Entity.x == BLOCK_NETHER_PORTAL) mat = 0.6;
|
||||
|
||||
if (mc_Entity.x == 322) lmtexcoord.z = 0.0;
|
||||
if (mc_Entity.x == WISPJELLY) lmtexcoord.z = 0.0;
|
||||
|
||||
#if defined ENTITIES && defined IS_IRIS
|
||||
NAMETAG = 0;
|
||||
|
||||
@@ -132,7 +132,7 @@ in DATA {
|
||||
|
||||
uniform float sunElevation;
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
uniform usampler1D texBlockData;
|
||||
uniform sampler3D texLpv1;
|
||||
uniform sampler3D texLpv2;
|
||||
@@ -165,8 +165,23 @@ uniform ivec2 eyeBrightnessSmooth;
|
||||
|
||||
uniform vec3 sunVec;
|
||||
|
||||
#define VOXEL_REFLECTIONS_SOLID
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#ifdef VOXEL_REFLECTIONS_SOLID
|
||||
#endif
|
||||
|
||||
#ifdef PHOTONICS
|
||||
#ifdef VOXEL_REFLECTIONS
|
||||
// #define VOXEL_REFLECTIONS
|
||||
#define PHOTONICS_INCLUDED
|
||||
|
||||
#include "/photonics/photonics.glsl"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
uniform int heldItemId;
|
||||
uniform int heldItemId2;
|
||||
#endif
|
||||
@@ -203,7 +218,10 @@ float convertHandDepth_2(in float depth, bool hand) {
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
|
||||
#if defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT
|
||||
uniform vec3 relativeEyePosition;
|
||||
|
||||
#include "/lib/hsv.glsl"
|
||||
#include "/lib/lpv_common.glsl"
|
||||
#include "/lib/lpv_render.glsl"
|
||||
@@ -225,11 +243,15 @@ float convertHandDepth_2(in float depth, bool hand) {
|
||||
#ifdef DEFERRED_ROUGH_REFLECTION
|
||||
#endif
|
||||
|
||||
uniform vec3 relativeEyePosition;
|
||||
#define MAIN_SHADOW_PASS
|
||||
#define FULLRESDEPTH
|
||||
|
||||
#include "/lib/specular.glsl"
|
||||
vec2 decodeVec2(float a){
|
||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||
const float constant2 = 256. / 255.;
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
|
||||
#if defined VIVECRAFT
|
||||
uniform bool vivecraftIsVR;
|
||||
uniform vec3 vivecraftRelativeMainHandPos;
|
||||
@@ -237,9 +259,13 @@ uniform vec3 relativeEyePosition;
|
||||
uniform mat4 vivecraftRelativeMainHandRot;
|
||||
uniform mat4 vivecraftRelativeOffHandRot;
|
||||
#endif
|
||||
#include "/lib/diffuse_lighting.glsl"
|
||||
|
||||
#include "/lib/diffuse_lighting.glsl"
|
||||
#include "/lib/specular.glsl"
|
||||
|
||||
#ifdef END_SHADER
|
||||
#include "/lib/end_fog.glsl"
|
||||
#endif
|
||||
|
||||
float ld(float dist) {
|
||||
return (2.0 * near) / (far + near - dist * (far - near));
|
||||
@@ -254,11 +280,6 @@ vec3 decode (vec2 encn){
|
||||
return clamp(normalize(n.xyz),-1.0,1.0);
|
||||
}
|
||||
|
||||
vec2 decodeVec2(float a){
|
||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||
const float constant2 = 256. / 255.;
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
@@ -948,6 +969,9 @@ uniform float wetness;
|
||||
}
|
||||
#endif
|
||||
|
||||
uniform ivec3 cameraPositionInt;
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
vec3 DEBUG = vec3(1.0);
|
||||
@@ -1485,14 +1509,14 @@ void main() {
|
||||
|
||||
Indirect_lighting += doIndirectLighting(AmbientLightColor * skylight, MinimumLightColor, lightmap.y);
|
||||
|
||||
#ifdef PHOTONICS_ENABLED
|
||||
#if defined PH_ENABLE_GI && defined PHOTONICS && defined ENABLE_PHOTONICS_GI
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float photonicsFalloff = smoothstep(min(far, 128.0), min(0.9*far, 114.0), viewDist);
|
||||
#else
|
||||
float photonicsFalloff = smoothstep(128.0, 114.0, viewDist);
|
||||
#endif
|
||||
|
||||
vec3 gi_color = texture(colortex15, texcoord).xyz*2.5*PHOTONICS_INDIRECT_BRIGHTNESS* skylight;
|
||||
vec3 gi_color = texture(colortex15, texcoord).xyz*2.0*PHOTONICS_INDIRECT_BRIGHTNESS* skylight;
|
||||
gi_color += mix(MinimumLightColor * (MIN_LIGHT_AMOUNT * 0.004 + nightVision*0.02), MinimumLightColor * (MIN_LIGHT_AMOUNT_INSIDE * 0.004 + nightVision*0.02), 1.0-lightmap.y);
|
||||
|
||||
Indirect_lighting = mix(Indirect_lighting, gi_color, photonicsFalloff);
|
||||
@@ -1653,11 +1677,11 @@ void main() {
|
||||
// if(lightningBolt) FINAL_COLOR = vec3(77.0, 153.0, 255.0);
|
||||
|
||||
#if defined DEFERRED_SPECULAR
|
||||
vec3 specularNoises = vec3(vec2(blueNoise(), ig_noise), ig_noise);
|
||||
vec2 specularNoises = vec2(blueNoise(), ig_noise);
|
||||
vec3 specularNormal = normal;
|
||||
if (dot(normal, (feetPlayerPos_normalized)) > 0.0) specularNormal = FlatNormals;
|
||||
|
||||
FINAL_COLOR = specularReflections(viewPos, feetPlayerPos_normalized, WsunVec, specularNoises, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, DirectLightColor*shadowColor*shadowColor, lightmap.y, hand, flashLightSpecularData);
|
||||
FINAL_COLOR = specularReflections(viewPos, feetPlayerPos, feetPlayerPos_normalized, WsunVec, specularNoises, FlatNormals, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, DirectLightColor*shadowColor*shadowColor, lightmap.y, hand, flashLightSpecularData);
|
||||
#endif
|
||||
|
||||
gl_FragData[0].rgb = FINAL_COLOR;
|
||||
|
||||
@@ -609,9 +609,9 @@ void main() {
|
||||
float translucentMasks = texelFetch(colortex7, ivec2(gl_FragCoord.xy),0).a;
|
||||
|
||||
bool isWater = translucentMasks > 0.99;
|
||||
bool isReflectiveEntity = abs(translucentMasks - 0.8) < 0.01;
|
||||
bool isReflective = abs(translucentMasks - 0.7) < 0.01 || isWater || isReflectiveEntity;
|
||||
bool isEntity = abs(translucentMasks - 0.9) < 0.01 || isReflectiveEntity;
|
||||
bool isReflectiveEntity = abs(translucentMasks - 0.2) < 0.01;
|
||||
bool isReflective = abs(translucentMasks - 0.1) < 0.01 || isWater || isReflectiveEntity;
|
||||
bool isEntity = abs(translucentMasks - 0.4) < 0.01 || isReflectiveEntity;
|
||||
|
||||
////// --------------- get volumetrics
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
|
||||
@@ -13,15 +13,15 @@ const int colortex6Format = R11F_G11F_B10F; // additional buffer for bloom (co
|
||||
const int colortex7Format = RGBA8; // Final output, transparencies id (gbuffer->composite4)
|
||||
const int colortex8Format = RGBA16; // Specular Texture, flat normals, vanilla AO
|
||||
|
||||
const int colortex9Format = RGBA16; // rain (encoded rg: gbuffers_weather -> composite3), resource pack sky (rgba: gbuffers_skytextured, gbuffers_skybasic -> deferred1), combined depth quarter res (ba: deferred2 -> wherever)
|
||||
const int colortex9Format = RGBA16; // rain (encoded rg: gbuffers_weather -> composite3), resource pack sky (rgba: gbuffers_skytextured, gbuffers_skybasic -> deferred1), combined depth quarter res (ba: composite -> wherever)
|
||||
|
||||
const int colortex10Format = RGBA16F; // cloud history
|
||||
const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals
|
||||
const int colortex12Format = RGBA16F; // DISTANT HORIZONS + VANILLA MIXED DEPTHs
|
||||
const int colortex12Format = RGBA16F; // empty
|
||||
|
||||
const int colortex13Format = RGBA16F; // low res VL (composite5->composite15)
|
||||
const int colortex14Format = RGBA16; // rg = SSAO and SS-SSS. a = skylightmap for translucents.
|
||||
const int colortex15Format = RGBA16F; // flat normals and vanilla AO
|
||||
const int colortex14Format = RGBA16; // rg = SSAO and SS-SSS. a = skylightmap for translucents.
|
||||
const int colortex15Format = R11F_G11F_B10F; // PHOTONICS GI
|
||||
|
||||
#ifdef VOXY
|
||||
const int colortex16Format = RGBA16F; // voxy translucent stuff...
|
||||
|
||||
@@ -6,14 +6,16 @@ uniform sampler2D colortex7;
|
||||
uniform sampler2D colortex5;
|
||||
uniform sampler2D colortex6;
|
||||
uniform sampler2D colortex10;
|
||||
uniform sampler2D colortex11;
|
||||
uniform sampler2D colortex14;
|
||||
uniform sampler2D colortex15;
|
||||
uniform sampler2D depthtex0;
|
||||
uniform sampler2D depthtex1;
|
||||
uniform sampler2D depthtex2;
|
||||
uniform sampler2D noisetex;
|
||||
uniform sampler2D shadowcolor1;
|
||||
|
||||
#ifndef IS_IRIS
|
||||
#if !defined IS_IRIS || (defined SHADER_GRASS_SETTING && MC_VERSION < 12101 && !defined SHADER_GRASS_UNSUPPORTED_FIX)
|
||||
#include "/lib/text_rendering.glsl"
|
||||
#endif
|
||||
|
||||
@@ -153,6 +155,10 @@ float doVignette( in vec2 texcoord, in float noise){
|
||||
layout (rgba16f) uniform readonly image2D waveSim2;
|
||||
#endif
|
||||
|
||||
uniform sampler2D radiosity_direct;
|
||||
uniform sampler2D radiosity_direct_soft;
|
||||
uniform sampler2D radiosity_handheld;
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -244,6 +250,36 @@ void main() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined SHADER_GRASS_SETTING && MC_VERSION < 12101 && !defined SHADER_GRASS_UNSUPPORTED_FIX
|
||||
const float textSize2 = 4.0;
|
||||
beginText(ivec2(gl_FragCoord.xy/textSize2), ivec2(0.05*viewWidth/textSize2, 0.75*viewHeight/textSize2));
|
||||
text.fgCol = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
printString((_S, _h, _a, _d, _e, _r, _space, _G, _r, _a, _s, _s, _space, _n, _e, _e, _d, _s, _space, _1, _dot, _2, _1, _dot, _1, _space, _o, _r, _space, _h, _i, _g, _h, _e, _r, _exclm));
|
||||
printLine();
|
||||
printString((_D, _i, _s, _a, _b, _l, _e, _space, _i, _t, _exclm));
|
||||
#if MC_VERSION == 12001
|
||||
printLine();
|
||||
printLine();
|
||||
printString((_T, _o, _space, _u, _s, _e, _space, _i, _t, _space, _o, _n, _space, _1, _dot, _2, _0, _dot, _1, _space, _u, _s, _e, _space, _t, _h, _e));
|
||||
printLine();
|
||||
text.fgCol = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
printString((_quote, _E, _c, _l, _i, _p, _s, _e, _space, _S, _h, _a, _d, _e, _r, _space, _G, _r, _a, _s, _s, _space, _C, _o, _m, _p, _a, _t, _quote));
|
||||
printLine();
|
||||
text.fgCol = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
printString((_R, _e, _s, _o, _u, _r, _c, _e, _space, _P, _a, _c, _k, _space, _f, _r, _o, _m, _space, _M, _o, _d, _r, _i, _n, _t, _h, _exclm));
|
||||
printLine();
|
||||
printLine();
|
||||
printString((_A, _d, _d, _i, _t, _i, _o, _n, _a, _l, _l, _y, _space, _e, _n, _a, _b, _l, _e, _space, _t, _h, _e));
|
||||
printLine();
|
||||
text.fgCol = vec4(1.0, 1.0, 0.0, 1.0);
|
||||
printString((_quote, _S, _h, _a, _d, _e, _r, _space, _G, _r, _a, _s, _s, _space, _U, _n, _s, _u, _p, _p, _o, _r, _t, _e, _d, _space, _F, _i, _x, _quote));
|
||||
printLine();
|
||||
text.fgCol = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
printString((_i, _n, _space, _e, _x, _p, _e, _r, _i, _m, _e, _n, _t, _a, _l, _space, _s, _e, _t, _t, _i, _n, _g, _s, _exclm));
|
||||
#endif
|
||||
endText(gl_FragColor.rgb);
|
||||
#endif
|
||||
|
||||
#ifndef IS_IRIS
|
||||
gl_FragColor.rgb = vec3(0.0);
|
||||
const float textSize = 4.0;
|
||||
@@ -255,4 +291,16 @@ void main() {
|
||||
printString((_U, _s, _e, _space, _I, _r, _i, _s, _space, _i, _n, _s, _t, _e, _a, _d, _exclm));
|
||||
endText(gl_FragColor.rgb);
|
||||
#endif
|
||||
|
||||
#ifdef PHOTONICS
|
||||
#if DEBUG_VIEW == debug_radiosity_direct
|
||||
gl_FragColor.rgb = vec3(texture(radiosity_direct, texcoord).rgb);
|
||||
#elif DEBUG_VIEW == debug_radiosity_direct_soft
|
||||
gl_FragColor.rgb = vec3(texture(radiosity_direct_soft, texcoord).rgb);
|
||||
#elif DEBUG_VIEW == debug_radiosity_handheld
|
||||
gl_FragColor.rgb = vec3(texture(radiosity_handheld, texcoord).rgb);
|
||||
#elif DEBUG_VIEW == debug_radiosity_GI
|
||||
gl_FragColor.rgb = vec3(texture(colortex15, texcoord).rgb);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ const ivec3 workGroups = ivec3(6, 6, 1);
|
||||
const vec3 LightColor_Amethyst = vec3(0.464, 0.227, 0.788);
|
||||
const vec3 LightColor_Candles = vec3(1.0, 0.4, 0.1);
|
||||
const vec3 LightColor_CopperBulb = vec3(1.0, 0.7, 0.6);
|
||||
const vec3 LightColor_LightBlock = vec3(1.0);
|
||||
const vec3 LightColor_LightBlock = vec3(0.7);
|
||||
const vec3 LightColor_RedstoneTorch = vec3(0.939, 0.305, 0.164);
|
||||
const vec3 LightColor_SeaPickle = vec3(0.283, 0.394, 0.212);
|
||||
|
||||
@@ -62,7 +62,11 @@ void main() {
|
||||
uint mixMask = 0xFFFF;
|
||||
vec3 tintColor = vec3(1.0);
|
||||
|
||||
if (blockId == BLOCK_SSS_WEAK || blockId == BLOCK_SSS_WEAK_3 || blockId == BLOCK_SSS_STRONG) {
|
||||
if (blockId == BLOCK_SSS_WEAK || blockId == BLOCK_CACTUS || blockId == BLOCK_SSS_WEAK_3 || blockId == BLOCK_SSS_STRONG || blockId == BLOCK_SSS_STRONG3) {
|
||||
mixWeight = 1.0;
|
||||
}
|
||||
|
||||
if (blockId == BLOCK_BUTTON_FLOOR_NORTH_SOUTH || blockId == BLOCK_BUTTON_FLOOR_EAST_WEST || blockId == BLOCK_BUTTON_WALL_NORTH || blockId == BLOCK_BUTTON_WALL_EAST || blockId == BLOCK_BUTTON_WALL_SOUTH || blockId == BLOCK_BUTTON_WALL_WEST || blockId == BLOCK_BUTTON_CEILING_NORTH_SOUTH || blockId == BLOCK_BUTTON_CEILING_EAST_WEST) {
|
||||
mixWeight = 1.0;
|
||||
}
|
||||
|
||||
@@ -500,7 +504,7 @@ void main() {
|
||||
if (blockId == BLOCK_END_ROD || blockId == ITEM_END_ROD) {
|
||||
lightColor = vec3(0.957, 0.929, 0.875);
|
||||
// lightColor = vec3(0.8, 0.3, 1.0);
|
||||
lightRange = 14.0;
|
||||
lightRange = 12.0;
|
||||
}
|
||||
|
||||
if (blockId == BLOCK_FIRE) {
|
||||
@@ -535,7 +539,7 @@ void main() {
|
||||
lightRange = 12.0;
|
||||
}
|
||||
|
||||
if (blockId == BLOCK_GLOW_LICHEN || blockId == ITEM_GLOW_LICHEN) {
|
||||
if (blockId == BLOCK_CELESTIUM || blockId == ITEM_GLOW_LICHEN || blockId == BLOCK_GLOW_LICHEN) {
|
||||
lightColor = vec3(0.1, 0.2, 0.12);
|
||||
lightRange = 7.0;
|
||||
}
|
||||
@@ -794,7 +798,7 @@ void main() {
|
||||
}
|
||||
|
||||
if (
|
||||
blockId == BLOCK_COPPER_LANTERN || blockId == ITEM_COPPER_LANTERN
|
||||
blockId == BLOCK_COPPER_LANTERN || blockId == ITEM_COPPER_LANTERN || blockId == BLOCK_COPPER_TORCH
|
||||
) {
|
||||
lightColor = vec3(0.1, 0.8, 0.3);
|
||||
lightRange = 10.0;
|
||||
@@ -817,6 +821,8 @@ void main() {
|
||||
mixWeight = 0.2;
|
||||
}
|
||||
|
||||
if (blockId >= 21 && blockId <= 37) mixWeight = 1.00;
|
||||
|
||||
if (blockId >= BLOCK_LAMP_LIT_BLACK && blockId <= BLOCK_LAMP_LIT_YELLOW) {
|
||||
lightRange = 15.0;
|
||||
mixWeight = 0.25;
|
||||
@@ -965,6 +971,8 @@ void main() {
|
||||
|
||||
// LPV shapes
|
||||
|
||||
case BLOCK_SSS_STRONG3:
|
||||
case 88:
|
||||
case BLOCK_LPV_IGNORE:
|
||||
mixWeight = 1.00;
|
||||
break;
|
||||
@@ -983,8 +991,7 @@ void main() {
|
||||
mixWeight = 0.9;
|
||||
break;
|
||||
case BLOCK_SCULK_VEIN:
|
||||
mixMask = BuildLpvMask(1u, 1u, 1u, 1u, 1u, 0u);
|
||||
mixWeight = 0.9;
|
||||
mixWeight = 1.00;
|
||||
break;
|
||||
case BLOCK_GLOW_LICHEN:
|
||||
mixWeight = 1.00;
|
||||
@@ -1023,6 +1030,7 @@ void main() {
|
||||
mixWeight = 0.5;
|
||||
break;
|
||||
case BLOCK_SLAB_BOTTOM:
|
||||
case BLOCK_DAYLIGHT_DETECTOR:
|
||||
case BLOCK_SNOW_LAYERS:
|
||||
mixMask = BuildLpvMask(1u, 1u, 1u, 1u, 1u, 0u);
|
||||
mixWeight = 0.5;
|
||||
|
||||
@@ -345,9 +345,7 @@ void main() {
|
||||
float BN = blueNoise();
|
||||
float R2 = R2_dither();
|
||||
|
||||
vec2 tempOffset = offsets[framemod8];
|
||||
|
||||
vec3 fragpos = toScreenSpace(FragCoord*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5, 0.0));
|
||||
vec3 fragpos = toScreenSpace(FragCoord*vec3(texelSize/RENDER_SCALE,1.0));
|
||||
vec3 playerpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
||||
vec3 worldpos = playerpos + cameraPosition;
|
||||
|
||||
@@ -359,8 +357,8 @@ void main() {
|
||||
|
||||
float opaqueMasks = 1.0;
|
||||
|
||||
if(data_in.blockID == BLOCK_GROUND_WAVING_VERTICAL || data_in.blockID == BLOCK_GRASS_SHORT || data_in.blockID == BLOCK_GRASS_TALL_LOWER || data_in.blockID == BLOCK_GRASS_TALL_UPPER ) opaqueMasks = 0.60;
|
||||
else if(data_in.blockID == BLOCK_AIR_WAVING) opaqueMasks = 0.55;
|
||||
// if(data_in.blockID == BLOCK_GROUND_WAVING_VERTICAL || data_in.blockID == BLOCK_GRASS_SHORT || data_in.blockID == BLOCK_GRASS_TALL_LOWER || data_in.blockID == BLOCK_GRASS_TALL_UPPER ) opaqueMasks = 0.60;
|
||||
// else if(data_in.blockID == BLOCK_AIR_WAVING) opaqueMasks = 0.55;
|
||||
|
||||
|
||||
//////////////////////////////// ////////////////////////////////
|
||||
@@ -378,8 +376,11 @@ void main() {
|
||||
// don't fix vanilla ao on some custom block models.
|
||||
// if (Color.a < 0.3) Color.a = 1.0; // fix vanilla ao on some custom block models.
|
||||
|
||||
RayJob ray = RayJob(vec3(0), vec3(0), vec3(0), vec3(0), vec3(0), false);
|
||||
ray.origin = worldpos - world_offset - 0.001f * data_in.block_normal;
|
||||
RayJob ray = RayJob(vec3(0), vec3(0), vec3(0), vec3(0), vec3(0), true);
|
||||
|
||||
float normalOffset = mix(0.00015f, 0.025f, clamp(length(playerpos)*0.006, 0.0, 1.0));
|
||||
ray.origin = worldpos - world_offset - normalOffset * data_in.block_normal;
|
||||
|
||||
ray.direction = playerpos - gbufferModelViewInverse[3].xyz;
|
||||
ray_constraint = ivec3(ray.origin);
|
||||
trace_ray(ray);
|
||||
@@ -544,25 +545,25 @@ void main() {
|
||||
OutSpecular = vec4(0.0,0.0,0.0,0.0);
|
||||
OutSpecular.rg = SpecularTex.rg;
|
||||
|
||||
#if EMISSIVE_ORES > 1 && EMISSIVE_TYPE > 1
|
||||
if(data_in.blockID == 502) {
|
||||
SpecularTex.a = EMISSIVE_ORES_STRENGTH;
|
||||
|
||||
SpecularTex.a *= getEmission(Albedo.rgb);
|
||||
}
|
||||
#endif
|
||||
// #if EMISSIVE_ORES > 1 && EMISSIVE_TYPE > 1
|
||||
// if(data_in.blockID == 502) {
|
||||
// SpecularTex.a = EMISSIVE_ORES_STRENGTH;
|
||||
//
|
||||
// SpecularTex.a *= getEmission(Albedo.rgb);
|
||||
// }
|
||||
// #endif
|
||||
|
||||
|
||||
#if EMISSIVE_TYPE == 2
|
||||
bool emissionCheck = SpecularTex.a <= 0.0;
|
||||
#endif
|
||||
|
||||
#ifdef MIRROR_IRON
|
||||
if(data_in.blockID == 504 || currentRenderedItemId == 504) {
|
||||
OutSpecular.rg = vec2(1.0, 1.0);
|
||||
Albedo.rgb = vec3(1.0);
|
||||
}
|
||||
#endif
|
||||
// #ifdef MIRROR_IRON
|
||||
// if(data_in.blockID == 504 || currentRenderedItemId == 504) {
|
||||
// OutSpecular.rg = vec2(1.0, 1.0);
|
||||
// Albedo.rgb = vec3(1.0);
|
||||
// }
|
||||
// #endif
|
||||
|
||||
#if defined HARDCODED_EMISSIVES_APPROX && (EMISSIVE_TYPE == 1 || EMISSIVE_TYPE == 2)
|
||||
#if EMISSIVE_TYPE == 2
|
||||
|
||||
@@ -258,10 +258,5 @@ void main() {
|
||||
#ifdef TAA_UPSCALING
|
||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
||||
#endif
|
||||
#ifdef TAA
|
||||
vec2 TAA_offsets = offsets[framemod8];
|
||||
|
||||
gl_Position.xy += TAA_offsets * gl_Position.w*texelSize;
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
"renderScale": [SCALE_FACTOR, SCALE_FACTOR],
|
||||
#endif
|
||||
"blending": {-1:"SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE", 2:"off"},
|
||||
"ssbos": {6:"{
|
||||
"ssbos": {4:"{
|
||||
mat4 customShadowMatrixSSBO;
|
||||
|
||||
vec3 customMoonVecSSBO;
|
||||
|
||||
@@ -60,7 +60,7 @@ void voxy_emitFragment(VoxyFragmentParameters parameters) {
|
||||
/////// ----- SSS ON BLOCKS ----- ///////
|
||||
// strong
|
||||
if (
|
||||
blockID == BLOCK_SSS_STRONG || blockID == BLOCK_AIR_WAVING || blockID == BLOCK_SSS_STRONG_2
|
||||
blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SSS_STRONG3 || blockID == BLOCK_AIR_WAVING || blockID == BLOCK_SSS_STRONG_2
|
||||
) {
|
||||
SSSAMOUNT = 1.0;
|
||||
}
|
||||
@@ -72,8 +72,8 @@ void voxy_emitFragment(VoxyFragmentParameters parameters) {
|
||||
SSSAMOUNT = 0.5;
|
||||
}
|
||||
else if (
|
||||
blockID == BLOCK_SSS_WEAK || blockID == BLOCK_SSS_WEAK_2 ||
|
||||
blockID == BLOCK_GLOW_LICHEN || blockID == BLOCK_SNOW_LAYERS || blockID == BLOCK_CARPET ||
|
||||
blockID == BLOCK_SSS_WEAK || blockID == BLOCK_CACTUS || blockID == BLOCK_SSS_WEAK_2 ||
|
||||
blockID == BLOCK_CELESTIUM || blockID == BLOCK_SNOW_LAYERS || blockID == BLOCK_CARPET ||
|
||||
blockID == BLOCK_AMETHYST_BUD_MEDIUM || blockID == BLOCK_AMETHYST_BUD_LARGE || blockID == BLOCK_AMETHYST_CLUSTER ||
|
||||
blockID == BLOCK_BAMBOO || blockID == BLOCK_SAPLING || blockID == BLOCK_VINE || blockID == BLOCK_VINE_OTHER
|
||||
) {
|
||||
@@ -98,26 +98,28 @@ void voxy_emitFragment(VoxyFragmentParameters parameters) {
|
||||
// if(vNameTags > 0) EMISSIVE = 0.9;
|
||||
|
||||
// normal block lightsources
|
||||
if(blockID >= 100 && blockID < 300) EMISSIVE = 0.5;
|
||||
if(blockID >= 100 && blockID < 282) {
|
||||
EMISSIVE = 0.5;
|
||||
|
||||
else if(blockID == 266 || blockID == 497) EMISSIVE = 0.2; // sculk stuff
|
||||
if(blockID == 266 || (blockID >= 276 && blockID <= 281)) EMISSIVE = 0.2; // sculk stuff
|
||||
|
||||
else if(blockID == 195) EMISSIVE = 2.3; // glow lichen
|
||||
else if(blockID == 195) EMISSIVE = 2.3; // glow lichen
|
||||
|
||||
else if(blockID == 185) EMISSIVE = 1.5; // crying obsidian
|
||||
else if(blockID == 185) EMISSIVE = 1.5; // crying obsidian
|
||||
|
||||
else if(blockID == 105) EMISSIVE = 2.0; // brewing stand
|
||||
|
||||
else if(blockID == 236) EMISSIVE = 1.0; // respawn anchor
|
||||
else if(blockID == 105) EMISSIVE = 2.0; // brewing stand
|
||||
|
||||
else if(blockID == 236) EMISSIVE = 1.0; // respawn anchor
|
||||
|
||||
else if(blockID == 101) EMISSIVE = 0.7; // large amethyst bud
|
||||
else if(blockID == 101) EMISSIVE = 0.7; // large amethyst bud
|
||||
|
||||
else if(blockID == 103) EMISSIVE = 1.0; // amethyst cluster
|
||||
else if(blockID == 103) EMISSIVE = 1.0; // amethyst cluster
|
||||
|
||||
else if(blockID == 244) EMISSIVE = 1.5; // soul fire
|
||||
else if(blockID == 244) EMISSIVE = 1.5; // soul fire
|
||||
}
|
||||
|
||||
#if EMISSIVE_ORES > 0
|
||||
else if(blockID == 502) EMISSIVE = EMISSIVE_ORES_STRENGTH;
|
||||
if(blockID == 502) EMISSIVE = EMISSIVE_ORES_STRENGTH;
|
||||
#endif
|
||||
|
||||
#ifdef HARDCODED_EMISSIVES_APPROX
|
||||
|
||||
@@ -12,7 +12,7 @@ layout (location = 3) out vec4 gbuffer_data_3;
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
|
||||
#undef Hand_Held_lights
|
||||
#undef PHOTONICS_ENABLED
|
||||
#undef PHOTONICS
|
||||
#undef IS_LPV_ENABLED
|
||||
#include "/lib/diffuse_lighting.glsl"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - A Bliss Edit
|
||||
prefix.SHADER_VERSION_LABEL = V
|
||||
value.SHADER_VERSION_LABEL.482 = 6.3.3
|
||||
value.SHADER_VERSION_LABEL.482 = 7.0.0
|
||||
|
||||
# if you're here to translate, this is not a joke, these do what they say
|
||||
profile.POTATO=§4Potato
|
||||
@@ -109,7 +109,7 @@ screen.Foliage = Foliage
|
||||
option.WAVY_STRENGTH = Waving Strength
|
||||
option.WAVY_SPEED = Waving Speed
|
||||
|
||||
option.SHADER_GRASS = Shader Grass §c(1.21.1+)
|
||||
option.SHADER_GRASS_SETTING = Shader Grass §c(1.21.1+)
|
||||
option.GRASS_BASE_THICKNESS = Grass Blade Base Thickness
|
||||
option.GRASS_THICKNESS_FALLOFF = Grass Thickness Falloff
|
||||
option.GRASS_THICKNESS_FALLOFF.comment = Controls how quickly each blade of grass becomes narrower. At 1.0 it will stay the same thickness until the tip
|
||||
@@ -1272,7 +1272,7 @@ screen.VOXY_SETTINGS = Voxy Settings
|
||||
option.VOXY_REFLECTIONS = Screen-Space Reflections on LOD Chunks
|
||||
|
||||
screen.PHOTONICS_SETTINGS = Photonics Settings
|
||||
option.PHOTONICS_ENABLED = Enable Photonics
|
||||
option.PHOTONICS_ACTIVE = Enable Photonics
|
||||
option.PHOTONICS_INDIRECT_BRIGHTNESS = GI Brightness
|
||||
option.PHOTONICS_GI_ONLY = GI Only
|
||||
option.PHOTONICS_FLOODFILL_FOG_LIGHT_PROPAGATION = Fog Light Propagation (Floodfill!)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - Bliss 编辑版
|
||||
prefix.SHADER_VERSION_LABEL = 版本
|
||||
value.SHADER_VERSION_LABEL.482 = 6.3.3
|
||||
value.SHADER_VERSION_LABEL.482 = 7.0.0
|
||||
|
||||
# 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名
|
||||
profile.POTATO=§4土豆 (极低配置)
|
||||
@@ -136,7 +136,7 @@ screen.Foliage = 植被
|
||||
option.WAVY_STRENGTH = 摆动强度
|
||||
option.WAVY_SPEED = 摆动速度
|
||||
|
||||
option.SHADER_GRASS = 着色器草 §c(Iris 1.7+)
|
||||
option.SHADER_GRASS_SETTING = 着色器草 §c(Iris 1.7+)
|
||||
option.GRASS_BASE_THICKNESS = 草叶基础厚度
|
||||
option.GRASS_THICKNESS_FALLOFF = 草厚度衰减
|
||||
option.GRASS_THICKNESS_FALLOFF.comment = 控制每片草叶变窄的速度。1.0 时,它将保持相同厚度直到叶尖
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
layout(std430, binding = 6) buffer SSBO1 {
|
||||
layout(std430, binding = 4) buffer SSBO1 {
|
||||
mat4 customShadowMatrixSSBO; // 64 bytes
|
||||
|
||||
vec3 customMoonVecSSBO; // 12 bytes
|
||||
|
||||
+28
-10
@@ -4,8 +4,7 @@
|
||||
#define BLOCK_GRASS_TALL_LOWER 13
|
||||
#define BLOCK_GRASS_TALL_UPPER 14
|
||||
#define BLOCK_SAPLING 15
|
||||
#define BLOCK_VINE 16
|
||||
#define BLOCK_VINE_OTHER 17
|
||||
#define BLOCK_VINE_OTHER 21
|
||||
#define BLOCK_LPV_IGNORE 50
|
||||
#define BLOCK_LPV_MIN 51
|
||||
#define BLOCK_LPV_MED 52
|
||||
@@ -13,6 +12,16 @@
|
||||
#define BLOCK_GROUND_WAVING 54
|
||||
#define BLOCK_GROUND_WAVING_VERTICAL 55
|
||||
#define BLOCK_AIR_WAVING 56
|
||||
#define BLOCK_BUTTON_FLOOR_NORTH_SOUTH 57
|
||||
#define BLOCK_BUTTON_FLOOR_EAST_WEST 58
|
||||
#define BLOCK_BUTTON_WALL_NORTH_SOUTH 59
|
||||
#define BLOCK_BUTTON_WALL_EAST_WEST 60
|
||||
#define BLOCK_BUTTON_WALL_NORTH 59
|
||||
#define BLOCK_BUTTON_WALL_EAST 60
|
||||
#define BLOCK_BUTTON_WALL_SOUTH 61
|
||||
#define BLOCK_BUTTON_WALL_WEST 62
|
||||
#define BLOCK_BUTTON_CEILING_NORTH_SOUTH 63
|
||||
#define BLOCK_BUTTON_CEILING_EAST_WEST 64
|
||||
#define BLOCK_SSS_STRONG_2 79
|
||||
#define BLOCK_SSS_STRONG 80
|
||||
#define BLOCK_SSS_WEAK 81
|
||||
@@ -20,6 +29,8 @@
|
||||
#define BLOCK_SSS_WEAK_3 83
|
||||
#define BLOCK_SSS_WEIRD 84
|
||||
#define BLOCK_GRASS 85
|
||||
#define BLOCK_SSS_STRONG3 87
|
||||
#define BLOCK_CACTUS 89
|
||||
#define BLOCK_AMETHYST_BUD_LARGE 101
|
||||
#define BLOCK_AMETHYST_BUD_MEDIUM 102
|
||||
#define BLOCK_AMETHYST_CLUSTER 103
|
||||
@@ -114,7 +125,7 @@
|
||||
#define BLOCK_FROGLIGHT_PEARLESCENT 192
|
||||
#define BLOCK_FROGLIGHT_VERDANT 193
|
||||
#define BLOCK_FURNACE_LIT 194
|
||||
#define BLOCK_GLOW_LICHEN 195
|
||||
#define BLOCK_CELESTIUM 195
|
||||
#define BLOCK_GLOWSTONE 196
|
||||
#define BLOCK_JACK_O_LANTERN 197
|
||||
#define BLOCK_LANTERN 198
|
||||
@@ -187,7 +198,15 @@
|
||||
#define BLOCK_LAMP_LIT_YELLOW 265
|
||||
#define SCULK_STUFF 266
|
||||
#define BLOCK_ENCHANTING_TABLE 267
|
||||
#define BLOCK_COPPER_LANTERN 268
|
||||
#define BLOCK_COPPER_TORCH 268
|
||||
#define BLOCK_COPPER_LANTERN 269
|
||||
#define BLOCK_GLOW_LICHEN 270
|
||||
#define BLOCK_SCULK_VEIN 276
|
||||
#define BLOCK_VINE 282
|
||||
#define BLOCK_DAYLIGHT_DETECTOR 287
|
||||
#define BLOCK_UNLIT_REDSTONE_TORCH 288
|
||||
#define BLOCK_END_PORTAL_FRAME 289
|
||||
#define BLOCK_HOPPER 290
|
||||
#define BLOCK_GLASS 301
|
||||
#define BLOCK_GLASS_BLACK 302
|
||||
#define BLOCK_GLASS_BLUE 303
|
||||
@@ -205,11 +224,11 @@
|
||||
#define BLOCK_GLASS_RED 315
|
||||
#define BLOCK_GLASS_WHITE 316
|
||||
#define BLOCK_GLASS_YELLOW 317
|
||||
#define BLOCK_HONEY 318
|
||||
#define BLOCK_ICE 319
|
||||
#define BLOCK_NETHER_PORTAL 320
|
||||
#define BLOCK_SLIME 321
|
||||
#define WISPJELLY 322
|
||||
#define BLOCK_HONEY 335
|
||||
#define BLOCK_ICE 336
|
||||
#define BLOCK_NETHER_PORTAL 337
|
||||
#define BLOCK_SLIME 338
|
||||
#define WISPJELLY 339
|
||||
#define BLOCK_CARPET 401
|
||||
#define BLOCK_DOOR_N 402
|
||||
#define BLOCK_DOOR_E 403
|
||||
@@ -308,6 +327,5 @@
|
||||
#define BLOCK_WALL_TALL_N_S_LOW_W_E 495
|
||||
#define BLOCK_WALL_TALL_W_E_LOW_N_S 496
|
||||
#define BLOCK_WALL_MAX 496
|
||||
#define BLOCK_SCULK_VEIN 497
|
||||
#define BLOCK_END_PORTAL 500
|
||||
#define BLOCK_SIGN 501
|
||||
@@ -1,4 +1,4 @@
|
||||
#if defined MAIN_SHADOW_PASS && defined LPV_HANDHELD_SHADOWS && defined IS_LPV_ENABLED
|
||||
#if defined MAIN_SHADOW_PASS && (defined LPV_HANDHELD_SHADOWS && defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT) && !defined VOXY_PROGRAM
|
||||
float swapperlinZ2(float depth, float _near, float _far) {
|
||||
return (2.0 * _near) / (_far + _near - depth * (_far - _near));
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if (defined IS_LPV_ENABLED || defined PHOTONICS && defined PHOTONICS && !defined PH_ENABLE_HANDHELD_LIGHT) && !defined VOXY_PROGRAM
|
||||
vec3 GetHandLight(const in int itemId, const in vec3 playerPos, inout float lightRange) {
|
||||
vec3 lightFinal = vec3(0.0);
|
||||
vec3 lightColor = vec3(0.0);
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined PHOTONICS_ENABLED && !defined PHOTONICS_GI_ONLY
|
||||
#if defined PHOTONICS && !defined VOXY_PROGRAM && !defined PHOTONICS_INCLUDED && defined PHOTONICS_ACTIVE
|
||||
uniform sampler2D radiosity_direct;
|
||||
uniform sampler2D radiosity_direct_soft;
|
||||
uniform sampler2D radiosity_handheld;
|
||||
@@ -116,8 +116,9 @@ vec3 doBlockLightLighting(
|
||||
float lightmapCurve = mix(lightmapLight, 2.5, lightmapBrightspot);
|
||||
vec3 blockLight = lightmapCurve * lightColor;
|
||||
|
||||
#if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store && (!defined PHOTONICS_LIGHT_PASS || !defined PHOTONICS_ENABLED || defined PHOTONICS_GI_ONLY)
|
||||
#if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store && (!defined PHOTONICS_LIGHT_PASS || !defined PHOTONICS || !defined PH_ENABLE_BLOCKLIGHT || !defined PHOTONICS_ACTIVE) && !defined VOXY_PROGRAM
|
||||
vec4 lpvSample = SampleLpvLinear(lpvPos);
|
||||
|
||||
#ifdef VANILLA_LIGHTMAP_MASK
|
||||
lpvSample.rgb *= lightmapCurve;
|
||||
#endif
|
||||
@@ -135,6 +136,7 @@ vec3 doBlockLightLighting(
|
||||
#ifdef Hand_Held_lights
|
||||
// create handheld lightsources
|
||||
|
||||
#if !defined ENABLE_PHOTONICS_HANDHELD || !defined PHOTONICS_LIGHT_PASS
|
||||
if (heldItemId > 0){
|
||||
float lightRange = 0.0;
|
||||
vec3 handLightCol = GetHandLight(heldItemId, playerPos, lightRange);
|
||||
@@ -165,23 +167,68 @@ vec3 doBlockLightLighting(
|
||||
|
||||
blockLight += handLightCol2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined PH_ENABLE_HANDHELD_LIGHT && !defined PH_ENABLE_BLOCKLIGHT && !defined PHOTONICS_LIGHT_PASS
|
||||
vec3 ph_direct_hand = texture(radiosity_handheld, gl_FragCoord.xy*texelSize/RENDER_SCALE).xyz;
|
||||
blockLight += ph_direct_hand * 1.35;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined PHOTONICS_ENABLED && !defined PHOTONICS_GI_ONLY && !defined WEATHER && defined PHOTONICS_LIGHT_PASS
|
||||
#if defined PHOTONICS && defined PH_ENABLE_BLOCKLIGHT && !defined WEATHER && defined PHOTONICS_LIGHT_PASS && !defined VOXY_PROGRAM && defined PHOTONICS_ACTIVE
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
if(!depthCheck)
|
||||
#endif
|
||||
{
|
||||
vec3 ph_direct_hand = texture(radiosity_handheld, gl_FragCoord.xy*texelSize).xyz;
|
||||
vec3 ph_direct = texture(radiosity_direct, gl_FragCoord.xy*texelSize).xyz;
|
||||
vec4 ph_direct_soft = texture(radiosity_direct_soft, gl_FragCoord.xy*texelSize);
|
||||
vec3 photonicsLight = vec3(0.0);
|
||||
|
||||
vec3 photonicsLight = ph_direct_hand * 1.35;
|
||||
photonicsLight += ph_direct;
|
||||
photonicsLight = pow(photonicsLight, vec3(1.45));
|
||||
photonicsLight += (ph_direct_soft.xyz / max(ph_direct_soft.w, 1.0f));
|
||||
photonicsLight += lightColor * 2.5 * min(max(lightmap-0.999,0.0)/(1.0-0.999),1.0);
|
||||
#if defined PH_ENABLE_HANDHELD_LIGHT
|
||||
vec3 ph_direct_hand = texture(radiosity_handheld, gl_FragCoord.xy*texelSize/RENDER_SCALE).xyz;
|
||||
vec3 handLight = ph_direct_hand * 1.35;
|
||||
#else
|
||||
#ifdef Hand_Held_lights
|
||||
vec3 handLight = vec3(0.0);
|
||||
if (heldItemId > 0){
|
||||
float lightRange = 0.0;
|
||||
vec3 handLightCol = GetHandLight(heldItemId, playerPos, lightRange);
|
||||
|
||||
#if defined MAIN_SHADOW_PASS && defined LPV_HANDHELD_SHADOWS
|
||||
if (lightRange > 0.0 && firstPersonCamera) handLightCol *= SSRT_Handlight_Shadows(viewPos, depthCheck, -(viewPos + vec3(-0.25, 0.2, 0.0)), noise, normals, hand);
|
||||
#endif
|
||||
|
||||
#ifdef WEATHER
|
||||
handLightCol *= 0.5;
|
||||
#endif
|
||||
|
||||
handLight += handLightCol;
|
||||
}
|
||||
|
||||
|
||||
if (heldItemId2 > 0){
|
||||
float lightRange2 = 0.0;
|
||||
vec3 handLightCol2 = GetHandLight(heldItemId2, playerPos, lightRange2);
|
||||
|
||||
#if defined MAIN_SHADOW_PASS && defined LPV_HANDHELD_SHADOWS
|
||||
if (lightRange2 > 0.0 && firstPersonCamera) handLightCol2 *= SSRT_Handlight_Shadows(viewPos, depthCheck, -(viewPos + vec3(0.25, 0.2, 0.0)), noise, normals, hand);
|
||||
#endif
|
||||
|
||||
#ifdef WEATHER
|
||||
handLightCol2 *= 0.5;
|
||||
#endif
|
||||
|
||||
handLight += handLightCol2;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PH_ENABLE_BLOCKLIGHT
|
||||
vec3 ph_direct = texture(radiosity_direct, gl_FragCoord.xy*texelSize/RENDER_SCALE).xyz;
|
||||
vec4 ph_direct_soft = texture(radiosity_direct_soft, gl_FragCoord.xy*texelSize/RENDER_SCALE);
|
||||
photonicsLight += ph_direct;
|
||||
photonicsLight += (ph_direct_soft.xyz / max(ph_direct_soft.w, 1.0f));
|
||||
photonicsLight += lightColor * 2.5 * min(max(lightmap-0.999,0.0)/(1.0-0.999),1.0);
|
||||
#endif
|
||||
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float photonicsFalloff = smoothstep(min(far, 256.0), min(0.9*far, 230.0), length(playerPos));
|
||||
@@ -190,7 +237,7 @@ vec3 doBlockLightLighting(
|
||||
#endif
|
||||
|
||||
|
||||
blockLight = mix(blockLight, photonicsLight, photonicsFalloff);
|
||||
blockLight = mix(blockLight, photonicsLight+handLight, photonicsFalloff);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+77
-13
@@ -1037,9 +1037,15 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
|
||||
#define VANILLA_CHUNK_FADING 1 // [0 1 2]
|
||||
|
||||
// #define SHADER_GRASS
|
||||
// #define SHADER_GRASS_SETTING
|
||||
|
||||
#ifdef SHADER_GRASS
|
||||
#ifdef SHADER_GRASS_SETTING
|
||||
#define SHADER_GRASS
|
||||
#endif
|
||||
|
||||
// #define SHADER_GRASS_UNSUPPORTED_FIX
|
||||
|
||||
#ifdef SHADER_GRASS_UNSUPPORTED_FIX
|
||||
#endif
|
||||
|
||||
#define GRASS_BASE_THICKNESS 0.3 // [0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
||||
@@ -1133,6 +1139,9 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
const float voxelDistance = 64.0;
|
||||
#endif
|
||||
|
||||
#define VOXEL_REFLECTIONS_TRANSLUCENT
|
||||
#define VOXEL_REFLECTIONS_SOLID
|
||||
|
||||
// ruining parts of the effect to make it more like vanilla floodfill
|
||||
// #define VANILLA_LIGHTMAP_MASK
|
||||
|
||||
@@ -1165,32 +1174,83 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
// ----- PHOTONICS SETTINGS ----- //
|
||||
//////////////////////////////////
|
||||
|
||||
// #define PHOTONICS_ENABLED
|
||||
#define VOXEL_REFLECTIONS
|
||||
#define PHOTONICS_ACTIVE
|
||||
|
||||
// #define PHOTONICS_GI_ONLY
|
||||
|
||||
#if defined VOXEL_REFLECTIONS && defined PHOTONICS && defined PHOTONICS_ACTIVE
|
||||
#define LPV_ENABLED
|
||||
#define IS_LPV_ENABLED
|
||||
#endif
|
||||
|
||||
// #define MIRROR_IRON
|
||||
#ifdef MIRROR_IRON
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef PHOTONICS
|
||||
#undef PHOTONICS_ACTIVE
|
||||
#endif
|
||||
|
||||
// #define PHOTONICS_FLOODFILL_FOG_LIGHT_PROPAGATION
|
||||
|
||||
#ifdef PHOTONICS_FLOODFILL_FOG_LIGHT_PROPAGATION
|
||||
#endif
|
||||
|
||||
#if defined PHOTONICS_ENABLED && !defined PHOTONICS_GI_ONLY
|
||||
// TODO: THIS IS HORRENDOUS
|
||||
#define ENABLE_PHOTONICS_GI
|
||||
#define ENABLE_PHOTONICS_BLOCKLIGHT
|
||||
#define ENABLE_PHOTONICS_HANDHELD
|
||||
|
||||
#ifndef PHOTONICS_FLOODFILL_FOG_LIGHT_PROPAGATION
|
||||
#ifdef ENABLE_PHOTONICS_GI
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PHOTONICS_BLOCKLIGHT
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PHOTONICS_HANDHELD
|
||||
#endif
|
||||
|
||||
#ifdef PHOTONICS_ACTIVE
|
||||
#else
|
||||
#undef ENABLE_PHOTONICS_GI
|
||||
#undef ENABLE_PHOTONICS_BLOCKLIGHT
|
||||
#undef ENABLE_PHOTONICS_HANDHELD
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#define COLORED_LIGHTS
|
||||
#define COLORED_HANDHELD_LIGHTS
|
||||
|
||||
// TODO: MAKE FLOODFILL USE PHOTONICS VOXEL MAP!
|
||||
#define VOXELIZE
|
||||
#endif
|
||||
|
||||
#if defined PHOTONICS && defined PHOTONICS_ACTIVE
|
||||
#undef VOXELIZE
|
||||
|
||||
#if !defined PHOTONICS_FLOODFILL_FOG_LIGHT_PROPAGATION && !defined VOXEL_REFLECTIONS && defined PH_ENABLE_BLOCKLIGHT
|
||||
#undef IS_LPV_ENABLED
|
||||
#undef LPV_ENABLED
|
||||
#endif
|
||||
|
||||
#undef Hand_Held_lights
|
||||
#else
|
||||
#undef VOXEL_REFLECTIONS
|
||||
#undef MIRROR_IRON
|
||||
#endif
|
||||
|
||||
#ifdef PHOTONICS_GI_ONLY
|
||||
#endif
|
||||
#define PHOTONICS_ALPHA_MODE BLOCK // [NONE BLOCK VOXEL]
|
||||
#define PHOTONICS_MAX_LIGHTS 1000 // [250 500 750 1000 1250]
|
||||
#define PHOTONICS_MAX_SAMPLES 20 // [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
||||
|
||||
#define PHOTONICS_INDIRECT_BRIGHTNESS 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.5 3.0 3.5 4.0 4.5 5.0]
|
||||
|
||||
#define VOXEL_REFLECTIONS_FOG
|
||||
#define VOXEL_REFLECTIONS_LPV_FOG
|
||||
|
||||
#ifdef VOXEL_REFLECTIONS_FOG
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
// ----- DEBUG SETTINGS ----- //
|
||||
////////////////////////////////
|
||||
@@ -1208,7 +1268,11 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#define debug_DEPTHTEX1 10
|
||||
#define debug_CLOUDDEPTHTEX 11
|
||||
#define debug_WATERSIM 12
|
||||
#define DEBUG_VIEW debug_OFF // [debug_OFF debug_SHADOWMAP debug_NORMALS debug_SPECULAR debug_INDIRECT debug_DIRECT debug_VIEW_POSITION debug_DH_WATER_BLENDING debug_FILTERED_STUFF debug_DEPTHTEX0 debug_DEPTHTEX1 debug_CLOUDDEPTHTEX debug_WATERSIM]
|
||||
#define debug_radiosity_direct 13
|
||||
#define debug_radiosity_direct_soft 14
|
||||
#define debug_radiosity_handheld 15
|
||||
#define debug_radiosity_GI 16
|
||||
#define DEBUG_VIEW debug_OFF // [debug_OFF debug_SHADOWMAP debug_NORMALS debug_SPECULAR debug_INDIRECT debug_DIRECT debug_VIEW_POSITION debug_DH_WATER_BLENDING debug_FILTERED_STUFF debug_DEPTHTEX0 debug_DEPTHTEX1 debug_CLOUDDEPTHTEX debug_WATERSIM debug_radiosity_direct debug_radiosity_direct_soft debug_radiosity_handheld debug_radiosity_GI]
|
||||
// #define ISOLATE_RESOURCEPACK_SKY
|
||||
|
||||
#if DEBUG_VIEW == debug_DEPTHTEX0 || DEBUG_VIEW == debug_DEPTHTEX1
|
||||
@@ -1283,7 +1347,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#undef SHADER_GRASS
|
||||
#endif
|
||||
|
||||
#if MC_VERSION < 12101
|
||||
#if MC_VERSION < 12101 && !defined SHADER_GRASS_UNSUPPORTED_FIX
|
||||
#undef SHADER_GRASS
|
||||
#endif
|
||||
|
||||
|
||||
+1907
-17
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,17 @@
|
||||
#ifdef RENDER_SHADOW
|
||||
layout(r16ui) uniform uimage3D imgVoxelMask;
|
||||
// layout(r8ui) uniform uimage3D imgQuarterVoxelMask;
|
||||
//
|
||||
// layout(std430, binding = 5) buffer voxelSSBO {
|
||||
// vec4[6] voxelData[];
|
||||
// };
|
||||
#else
|
||||
layout(r16ui) uniform readonly uimage3D imgVoxelMask;
|
||||
// layout(r8ui) uniform readonly uimage3D imgQuarterVoxelMask;
|
||||
//
|
||||
// layout(std430, binding = 5) readonly buffer voxelSSBO {
|
||||
// vec4[6] voxelData[];
|
||||
// };
|
||||
#endif
|
||||
|
||||
#if defined IS_LPV_ENABLED || defined SHADER_GRASS
|
||||
@@ -11,4 +21,5 @@
|
||||
const uint VoxelSize = uint(5);
|
||||
const uvec3 VoxelSize3 = uvec3(VoxelSize);
|
||||
#endif
|
||||
|
||||
#define BLOCK_EMPTY 0
|
||||
|
||||
@@ -7,12 +7,85 @@ ivec3 GetVoxelIndex(const in vec3 playerPos) {
|
||||
return ivec3(floor(playerPos + cameraOffset) + VoxelSize3/2u);
|
||||
}
|
||||
|
||||
// ivec3 GetVoxelIndex2(const in vec3 playerPos) {
|
||||
// #if !defined IS_LPV_ENABLED && !defined SHADER_GRASS
|
||||
// vec3 cameraOffset = fract(cameraPositionFract-relativeEyePosition);
|
||||
// #else
|
||||
// vec3 cameraOffset = fract(cameraPositionFract);
|
||||
// #endif
|
||||
// return ivec3(floor(playerPos + cameraOffset) + VoxelSize3/8u);
|
||||
// }
|
||||
|
||||
void SetVoxelBlock(const in ivec3 voxelPos, const in uint blockId) {
|
||||
if (clamp(voxelPos, ivec3(0), ivec3(VoxelSize-1u)) != voxelPos) return;
|
||||
|
||||
// imageStore(imgQuarterVoxelMask, voxelPos / 4, uvec4(1u));
|
||||
|
||||
imageStore(imgVoxelMask, voxelPos, uvec4(blockId));
|
||||
}
|
||||
|
||||
// #ifdef SAVE_VOXEL_STUFF
|
||||
// int voxelIndex(ivec3 voxelPos) {
|
||||
// return voxelPos.x + voxelPos.y * int(VoxelSize) + voxelPos.z * int(VoxelSize*VoxelSize);
|
||||
// }
|
||||
//
|
||||
// int voxelNormalIndex(vec3 voxelNormal) {
|
||||
// return clamp(int(abs(voxelNormal.x)*(voxelNormal.x*0.5+0.5) + abs(voxelNormal.y)*(voxelNormal.y*0.5+2.5) + abs(voxelNormal.z)*(voxelNormal.z*0.5+4.5) + 0.5), 0, 5);
|
||||
// }
|
||||
//
|
||||
// float encodeVec2_16(vec2 a){
|
||||
// const vec2 constant1 = vec2( 1., 65536.) / 4294967295.;
|
||||
// vec2 temp = floor( a * 65535. );
|
||||
// return temp.x*constant1.x+temp.y*constant1.y;
|
||||
// }
|
||||
//
|
||||
// float encodeVec2_16(float a, float b){
|
||||
// return encodeVec2_16(vec2(a,b));
|
||||
// }
|
||||
//
|
||||
// vec2 decodeVec2_16(float a){
|
||||
// const vec2 constant1 = 4294967294. / vec2( 65536., 4294967295.);
|
||||
// const float constant2 = 65536. / 65535.;
|
||||
// return fract( a * constant1 ) * constant2 ;
|
||||
// }
|
||||
//
|
||||
// void SaveVoxelData(const in ivec3 voxelPos, in vec2 midTex, in vec2 lightcoord, const in uint voxelId, in vec3 originPos) {
|
||||
// if (clamp(voxelPos, ivec3(0), ivec3(VoxelSize-1u)) != voxelPos) return;
|
||||
//
|
||||
// if(voxelId > 0u) {
|
||||
// vec3 worldNormal = viewToWorld(normalize(gl_NormalMatrix * gl_Normal));
|
||||
// float fractYpos = fract(originPos.y+cameraPosition.y);
|
||||
// float xzLength = length(fract(originPos.xz+cameraPosition.xz) - vec2(0.5));
|
||||
//
|
||||
// if(voxelId == BLOCK_HOPPER && (dot(at_midBlock.xz, worldNormal.xz) < 0.0 || abs(worldNormal.y) > 0.001)
|
||||
// || voxelId == BLOCK_END_PORTAL_FRAME && xzLength < 0.4
|
||||
// || voxelId == BLOCK_GRASS && alphaTestRef >= 0.1
|
||||
// || voxelId >= 22 && voxelId < 38 && fractYpos < 0.99 && fractYpos > 0.01
|
||||
// || (voxelId == BLOCK_LANTERN || voxelId == BLOCK_SOUL_LANTERN || voxelId == BLOCK_COPPER_LANTERN) && xzLength < 0.185
|
||||
// || voxelId == 419 && (xzLength > 0.501 || abs(worldNormal.x) < 0.99)
|
||||
// ) return;
|
||||
//
|
||||
// float encodedRB = encodeVec2(gl_Color.rb);
|
||||
// vec2 _color = vec2(encodedRB, gl_Color.g);
|
||||
//
|
||||
// midTex.r = encodeVec2_16(midTex);
|
||||
// midTex.g = encodeVec2(lightcoord);
|
||||
//
|
||||
// if(voxelId == 419 || voxelId == BLOCK_HOPPER || voxelId == 178 || voxelId >= 11 && voxelId <= 21 || voxelId == BLOCK_LPV_MIN || voxelId == BLOCK_GROUND_WAVING || voxelId > 300 && voxelId < 335 || voxelId >= BLOCK_SSS_STRONG3 && voxelId <= 87 || (voxelId >= 22 && voxelId < 38 && abs(worldNormal.y) < 0.01)) {
|
||||
// voxelData[voxelIndex(voxelPos)][0] = vec4(midTex, _color);
|
||||
// voxelData[voxelIndex(voxelPos)][1] = vec4(midTex, _color);
|
||||
// voxelData[voxelIndex(voxelPos)][2] = vec4(midTex, _color);
|
||||
// voxelData[voxelIndex(voxelPos)][3] = vec4(midTex, _color);
|
||||
// voxelData[voxelIndex(voxelPos)][4] = vec4(midTex, _color);
|
||||
// voxelData[voxelIndex(voxelPos)][5] = vec4(midTex, _color);
|
||||
// }
|
||||
// else
|
||||
// voxelData[voxelIndex(voxelPos)][voxelNormalIndex(worldNormal)] = vec4(midTex, _color);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// #endif
|
||||
|
||||
void PopulateShadowVoxel(const in vec3 playerPos) {
|
||||
uint voxelId = 0u;
|
||||
vec3 originPos = playerPos;
|
||||
@@ -41,6 +114,10 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
|
||||
if (voxelId == 0u) voxelId = 1u;
|
||||
|
||||
originPos += at_midBlock.xyz/64.0;
|
||||
|
||||
// #ifdef SAVE_VOXEL_STUFF
|
||||
// SaveVoxelData(GetVoxelIndex(originPos), mc_midTexCoord.xy, gl_MultiTexCoord1.xy / 240.0, voxelId, playerPos);
|
||||
// #endif
|
||||
}
|
||||
|
||||
#if !defined IS_LPV_ENABLED && !defined SHADER_GRASS
|
||||
@@ -57,7 +134,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
|
||||
if (blockEntityId > 0 && blockEntityId < 500 && blockEntityId != BLOCK_ENCHANTING_TABLE)
|
||||
voxelId = uint(blockEntityId);
|
||||
}
|
||||
else if (currentRenderedItemId > 100 && currentRenderedItemId < 300) {
|
||||
else if (currentRenderedItemId > 100 && currentRenderedItemId < 276) {
|
||||
#if MC_VERSION > 12100 && ((MC_VERSION != 12109 && MC_VERSION != 12110) || IRIS_VERSION >= 10907)
|
||||
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_CURRENT_PLAYER)
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
{
|
||||
"defines": {
|
||||
"colors": {
|
||||
"generic": "#646464"
|
||||
},
|
||||
"intensities": {
|
||||
"default": 1
|
||||
},
|
||||
"radii": {
|
||||
"default": 1
|
||||
},
|
||||
"falloffs": {
|
||||
"default": 1
|
||||
}
|
||||
},
|
||||
"lights": {
|
||||
"lantern": {
|
||||
"intensity": 40,
|
||||
"radius": 6.5,
|
||||
"falloff": 0.6,
|
||||
"color": "rgb(1.0,0.5,0.25)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*198"
|
||||
]
|
||||
},
|
||||
"soul_lantern" : {
|
||||
"intensity": 30,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.1, 0.6, 1.0)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*245"
|
||||
]
|
||||
},
|
||||
"copper_lantern" : {
|
||||
"intensity": 30,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.1, 0.8, 0.3)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*269"
|
||||
]
|
||||
},
|
||||
"sea_lantern" : {
|
||||
"intensity": 45,
|
||||
"radius": 4.5,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.553, 0.748, 0.859)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*242"
|
||||
]
|
||||
},
|
||||
"glowstone" : {
|
||||
"intensity": 45,
|
||||
"radius": 4.5,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.747, 0.594, 0.326)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*196"
|
||||
]
|
||||
},
|
||||
"torch" : {
|
||||
"intensity": 35,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(1.0,0.5,0.25)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*247"
|
||||
]
|
||||
},
|
||||
"soul_torch" : {
|
||||
"intensity": 25,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.1, 0.6, 1.0)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*246"
|
||||
]
|
||||
},
|
||||
"copper_torch" : {
|
||||
"intensity": 25,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.1, 0.8, 0.3)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*268"
|
||||
]
|
||||
},
|
||||
"redstone_torch" : {
|
||||
"intensity": 25,
|
||||
"radius": 4.25,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.939, 0.305, 0.164)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*219"
|
||||
]
|
||||
},
|
||||
"crying_obsidian" : {
|
||||
"intensity": 20,
|
||||
"radius": 3.0,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.390, 0.065, 0.646)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*185"
|
||||
]
|
||||
},
|
||||
"froglight_ochre" : {
|
||||
"intensity": 35,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.768, 0.648, 0.108)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*191"
|
||||
]
|
||||
},
|
||||
"froglight_pearlescent" : {
|
||||
"intensity": 35,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.737, 0.435, 0.658)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*192"
|
||||
]
|
||||
},
|
||||
"froglight_verdant" : {
|
||||
"intensity": 35,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.463, 0.763, 0.409)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*193"
|
||||
]
|
||||
},
|
||||
"glow_lichen" : {
|
||||
"intensity": 50,
|
||||
"radius": 1.5,
|
||||
"falloff": 0.45,
|
||||
"color": "rgb(0.1, 0.2, 0.12)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*270"
|
||||
]
|
||||
},
|
||||
"end_rod" : {
|
||||
"intensity": 50,
|
||||
"radius": 5.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.957, 0.929, 0.875)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*188"
|
||||
]
|
||||
},
|
||||
"shroomlight" : {
|
||||
"intensity": 45,
|
||||
"radius": 4.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.848, 0.469, 0.205)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*243"
|
||||
]
|
||||
},
|
||||
"fire" : {
|
||||
"intensity": 30,
|
||||
"radius": 3.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.864, 0.598, 0.348)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*189"
|
||||
]
|
||||
},
|
||||
"soul_fire" : {
|
||||
"intensity": 25,
|
||||
"radius": 3.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.1, 0.6, 1.0)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*244"
|
||||
]
|
||||
},
|
||||
"enchanting_table" : {
|
||||
"intensity": 25,
|
||||
"radius": 1.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.416, 0.509, 0.979)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*267"
|
||||
]
|
||||
},
|
||||
"beacon" : {
|
||||
"intensity": 45,
|
||||
"radius": 4.5,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(1, 1, 1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*104"
|
||||
]
|
||||
},
|
||||
"redstone_lamp" : {
|
||||
"intensity": 45,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.4,
|
||||
"color": "rgb(0.953, 0.796, 0.496)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*217"
|
||||
]
|
||||
},
|
||||
"magma_block" : {
|
||||
"intensity": 15,
|
||||
"radius": 2.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.747, 0.323, 0.110)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*215"
|
||||
]
|
||||
},
|
||||
"brewing_stand" : {
|
||||
"intensity": 18,
|
||||
"radius": 1.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(0.636, 0.509, 0.179)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*105"
|
||||
]
|
||||
},
|
||||
"candles_lit_1" : {
|
||||
"intensity": 20,
|
||||
"radius": 1.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(1.0, 0.4, 0.1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*174"
|
||||
]
|
||||
},
|
||||
"candles_lit_2" : {
|
||||
"intensity": 20,
|
||||
"radius": 2.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(1.0, 0.4, 0.1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*175"
|
||||
]
|
||||
},
|
||||
"candles_lit_3" : {
|
||||
"intensity": 20,
|
||||
"radius": 3.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(1.0, 0.4, 0.1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*176"
|
||||
]
|
||||
},
|
||||
"candles_lit_4" : {
|
||||
"intensity": 20,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.5,
|
||||
"color": "rgb(1.0, 0.4, 0.1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*177"
|
||||
]
|
||||
},
|
||||
"lava" : {
|
||||
"intensity": 40,
|
||||
"radius": 10.0,
|
||||
"falloff": 0.25,
|
||||
"color": "rgb(0.959, 0.302, 0.106)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*199"
|
||||
]
|
||||
},
|
||||
"nether_portal" : {
|
||||
"intensity": 15,
|
||||
"radius": 4.6,
|
||||
"falloff": 0.3,
|
||||
"color": "rgb(0.502, 0.165, 0.831)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*337"
|
||||
]
|
||||
},
|
||||
"copper_bulb" : {
|
||||
"intensity": 25,
|
||||
"radius": 15.0,
|
||||
"falloff": 0.45,
|
||||
"color": "rgb(1.0, 0.7, 0.6)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*180"
|
||||
]
|
||||
},
|
||||
"exposed_copper_bulb" : {
|
||||
"intensity": 25,
|
||||
"radius": 12.0,
|
||||
"falloff": 0.45,
|
||||
"color": "rgb(1.0, 0.7, 0.6)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*181"
|
||||
]
|
||||
},
|
||||
"oxidized_copper_bulb" : {
|
||||
"intensity": 25,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.45,
|
||||
"color": "rgb(1.0, 0.7, 0.6)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*182"
|
||||
]
|
||||
},
|
||||
"weathered_copper_bulb" : {
|
||||
"intensity": 25,
|
||||
"radius": 8.0,
|
||||
"falloff": 0.45,
|
||||
"color": "rgb(1.0, 0.7, 0.6)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*183"
|
||||
]
|
||||
},
|
||||
"cave_berries" : {
|
||||
"intensity": 15,
|
||||
"radius": 4.0,
|
||||
"falloff": 0.35,
|
||||
"color": "rgb(1.0, 1.0, 0.1)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*178"
|
||||
]
|
||||
},
|
||||
"jack_o_lantern" : {
|
||||
"intensity": 25,
|
||||
"radius": 10.0,
|
||||
"falloff": 0.55,
|
||||
"color": "rgb(0.864, 0.598, 0.348)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*197"
|
||||
]
|
||||
},
|
||||
"powered_rail" : {
|
||||
"intensity": 20,
|
||||
"radius": 5.0,
|
||||
"falloff": 0.55,
|
||||
"color": "rgb(0.939, 0.305, 0.164)",
|
||||
"is_traced": true,
|
||||
"blocks": [
|
||||
"*216"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/SSBOs.glsl"
|
||||
|
||||
uniform sampler2D colortex1;// albedo, detailed_normal
|
||||
uniform sampler2D colortex8;// flat_normal
|
||||
|
||||
uniform vec3 sunPosition;
|
||||
uniform float near;
|
||||
uniform float far;
|
||||
uniform float worldTime;
|
||||
|
||||
uniform vec2 taa_offset;
|
||||
uniform mat4 gbufferProjection;
|
||||
uniform mat4 gbufferModelView;
|
||||
uniform vec2 texelSize;
|
||||
uniform float skyLightLevelSmooth;
|
||||
uniform int framemod8;
|
||||
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
|
||||
vec3 toScreenSpace(vec3 p) {
|
||||
vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
||||
vec3 p3 = p * 2. - 1.;
|
||||
vec4 fragposition = iProjDiag * p3.xyzz + gbufferProjectionInverse[3];
|
||||
return fragposition.xyz / fragposition.w;
|
||||
}
|
||||
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
|
||||
#ifdef TAA
|
||||
vec2 TAA_Offset = offsets[framemod8];
|
||||
#else
|
||||
vec2 TAA_Offset = vec2(0.0);
|
||||
#endif
|
||||
|
||||
vec3 toLinear(vec3 sRGB){
|
||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
||||
}
|
||||
|
||||
|
||||
#define load_tex_coord gl_FragCoord.xy * texelSize
|
||||
|
||||
vec2 decodeVec2(float a){
|
||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||
const float constant2 = 256. / 255.;
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
|
||||
vec3 decode (vec2 encn){
|
||||
vec3 n = vec3(0.0);
|
||||
encn = encn * 2.0 - 1.0;
|
||||
n.xy = abs(encn);
|
||||
n.z = 1.0 - n.x - n.y;
|
||||
n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn;
|
||||
return clamp(normalize(n.xyz),-1.0,1.0);
|
||||
}
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#endif
|
||||
|
||||
vec3 load_world_position() {
|
||||
float z = texelFetch(depthtex0, ivec2(gl_FragCoord.xy), 0).x;
|
||||
|
||||
vec3 viewPos = toScreenSpace(vec3(load_tex_coord/RENDER_SCALE - TAA_Offset*texelSize*0.5, z));
|
||||
|
||||
vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
return feetPlayerPos + cameraPosition;
|
||||
}
|
||||
|
||||
void load_fragment_variables(out vec3 albedo, out vec3 world_pos, out vec3 world_normal, out vec3 world_normal_mapped) {
|
||||
vec4 data = texelFetch(colortex1, ivec2(gl_FragCoord.xy), 0);
|
||||
|
||||
vec4 dataUnpacked0 = vec4(decodeVec2(data.x),decodeVec2(data.y)); // albedo, masks
|
||||
vec4 dataUnpacked1 = vec4(decodeVec2(data.z),decodeVec2(data.w)); // normals, lightmaps
|
||||
|
||||
albedo = toLinear(vec3(dataUnpacked0.xz,dataUnpacked1.x));
|
||||
|
||||
world_normal_mapped = decode(dataUnpacked0.yw);
|
||||
|
||||
vec4 SpecularData = texelFetch(colortex8, ivec2(gl_FragCoord.xy), 0);
|
||||
vec4 specdataUnpacked0 = vec4(decodeVec2(SpecularData.x),decodeVec2(SpecularData.y));
|
||||
vec4 specdataUnpacked1 = vec4(decodeVec2(SpecularData.z),decodeVec2(SpecularData.w));
|
||||
|
||||
world_normal = normalize(vec3(specdataUnpacked0.yw,specdataUnpacked1.y) * 2.0 - 1.0);
|
||||
|
||||
world_pos = load_world_position() - 0.01f * world_normal;
|
||||
}
|
||||
|
||||
#ifdef SMOOTH_SUN_ROTATION
|
||||
vec3 sun_direction = WsunVecSmooth;
|
||||
#else
|
||||
vec3 sun_direction = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
#endif
|
||||
|
||||
vec3 AmbientLightColor = averageSkyCol_CloudsSSBO/1200.0;
|
||||
vec3 indirect_light_color = AmbientLightColor * ambient_brightness;
|
||||
|
||||
vec2 get_taa_jitter() {
|
||||
#ifdef TAA
|
||||
return vec2(offsets[framemod8]*0.5*texelSize);
|
||||
#else
|
||||
return vec2(0.0);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool is_in_world() {
|
||||
return texelFetch(depthtex0, ivec2(gl_FragCoord.xy), 0).x <= 0.9999f;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
writeonly uniform image2D colorimg15;
|
||||
|
||||
void write_indirect(vec3 color) {
|
||||
imageStore(colorimg15, ivec2(gl_FragCoord.xy), vec4(color, 1f));
|
||||
}
|
||||
+68
-25
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user