Skip to content

Commit

Permalink
misc bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
null511 committed Mar 10, 2023
1 parent b1155e2 commit 2e98c8d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion shaders/lib/common.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const bool colortex5Clear = false;
#define SHADOW_BIAS_SCALE 1.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.1 2.2 2.3 2.4 2.5]
#define SHADOW_DISTORT_FACTOR 0.20 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00]
#define SHADOW_FILTER 1 // [0 1 2]
#define SHADOW_PCF_SIZE 4 // [2 4 6 8 10 15 20 25 30 35 40 45 50 60 70 80 90 100 120 140 160 180 200 250 300 350 400 450 500 600 700 800]
#define SHADOW_PCF_SIZE 60 // [2 4 6 8 10 15 20 25 30 35 40 45 50 60 70 80 90 100 120 140 160 180 200 250 300 350 400 450 500 600 700 800]
#define SHADOW_PCF_SAMPLES 4 // [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32]
#define SHADOW_PCSS_SAMPLES 4 // [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32]
#define SHADOW_ENABLE_HWCOMP
Expand Down
6 changes: 3 additions & 3 deletions shaders/lib/lighting/basic.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ float SampleLight(const in vec3 fragLocalPos, const in vec3 fragLocalNormal, con
vec4 pos = gl_Vertex;

#if defined RENDER_TERRAIN || defined RENDER_WATER
// #if DYN_LIGHT_MODE != DYN_LIGHT_PIXEL
// int vBlockId;
// #endif
#if !(DYN_LIGHT_MODE == DYN_LIGHT_PIXEL || DYN_LIGHT_MODE == DYN_LIGHT_TRACED)
int vBlockId;
#endif

vBlockId = int(mc_Entity.x + 0.5);

Expand Down
1 change: 0 additions & 1 deletion shaders/program/gbuffers_entities.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ uniform int entityId;
attribute vec3 at_midBlock;

uniform mat4 gbufferProjection;
uniform int entityId;
uniform float near;
#endif
#endif
Expand Down
1 change: 0 additions & 1 deletion shaders/program/gbuffers_water.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ uniform vec3 cameraPosition;
#include "/lib/items.glsl"
#include "/lib/buffers/lighting.glsl"
#include "/lib/lighting/dynamic.glsl"
#include "/lib/lighting/dynamic_blocks.glsl"
#endif

#if DYN_LIGHT_MODE != DYN_LIGHT_NONE
Expand Down
22 changes: 11 additions & 11 deletions shaders/program/shadow.gsh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ uniform float far;


void main() {
if (renderStage == MC_RENDER_STAGE_TERRAIN_SOLID
|| renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT
|| renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
|| renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT) {
#if DYN_LIGHT_MODE != DYN_LIGHT_NONE && defined IRIS_FEATURE_SSBO
#if DYN_LIGHT_MODE != DYN_LIGHT_NONE && defined IRIS_FEATURE_SSBO
if (renderStage == MC_RENDER_STAGE_TERRAIN_SOLID
|| renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT
|| renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
|| renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT) {
#if DYN_LIGHT_COLORS == DYN_LIGHT_COLOR_RP
vec3 lightColor = vec3(0.0);
float lightRange = GetSceneBlockLightLevel(vBlockId[0]);
Expand All @@ -84,12 +84,12 @@ void main() {
#else
AddSceneBlockLight(vBlockId[0], vOriginPos[0]);
#endif
#endif
}
else if (renderStage == MC_RENDER_STAGE_ENTITIES) {
vec4 light = GetSceneEntityLightColor(vEntityId[0], vVertexId);
if (light.a > EPSILON) AddSceneBlockLight(0, vOriginPos[0], light.rgb, light.a);
}
}
else if (renderStage == MC_RENDER_STAGE_ENTITIES) {
vec4 light = GetSceneEntityLightColor(vEntityId[0], vVertexId);
if (light.a > EPSILON) AddSceneBlockLight(0, vOriginPos[0], light.rgb, light.a);
}
#endif

#if defined WORLD_SHADOW_ENABLED && SHADOW_TYPE != SHADOW_TYPE_NONE
//if (vEntityId[0] == MATERIAL_LIGHTNING_BOLT) return;
Expand Down
5 changes: 4 additions & 1 deletion shaders/program/shadow.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ void main() {
vVertexId = -1;
if (renderStage == MC_RENDER_STAGE_ENTITIES) {
vEntityId = entityId;
vVertexId = GetWrappedVertexID();

#if DYN_LIGHT_MODE != DYN_LIGHT_NONE && defined IRIS_FEATURE_SSBO
vVertexId = GetWrappedVertexID();
#endif
}
else {
vBlockId = blockId;
Expand Down
10 changes: 5 additions & 5 deletions shaders/shaders.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
profile.VANILLA= OLD_LIGHTING SHADOW_TYPE:0 DYN_LIGHT_MODE:0 SHADOW_FILTER:0 SHADOW_PCF_SIZE:4
profile.SHADOWS=!OLD_LIGHTING SHADOW_TYPE:2 DYN_LIGHT_MODE:0 SHADOW_FILTER:0 SHADOW_PCF_SIZE:4
profile.LIGHTS = OLD_LIGHTING SHADOW_TYPE:0 DYN_LIGHT_MODE:1 SHADOW_FILTER:0 SHADOW_PCF_SIZE:4
profile.FAST =!OLD_LIGHTING SHADOW_TYPE:2 DYN_LIGHT_MODE:1 SHADOW_FILTER:1 SHADOW_PCF_SIZE:20
profile.FANCY =!OLD_LIGHTING SHADOW_TYPE:2 DYN_LIGHT_MODE:2 SHADOW_FILTER:2 SHADOW_PCF_SIZE:600
profile.VANILLA= OLD_LIGHTING SHADOW_TYPE:0 DYN_LIGHT_MODE:0 SHADOW_FILTER:0 SHADOW_PCF_SIZE:60
profile.SHADOWS=!OLD_LIGHTING SHADOW_TYPE:2 DYN_LIGHT_MODE:0 SHADOW_FILTER:1 SHADOW_PCF_SIZE:60
profile.LIGHTS = OLD_LIGHTING SHADOW_TYPE:0 DYN_LIGHT_MODE:1 SHADOW_FILTER:0 SHADOW_PCF_SIZE:60
profile.FAST =!OLD_LIGHTING SHADOW_TYPE:2 DYN_LIGHT_MODE:1 SHADOW_FILTER:1 SHADOW_PCF_SIZE:60
profile.FANCY =!OLD_LIGHTING SHADOW_TYPE:3 DYN_LIGHT_MODE:2 SHADOW_FILTER:2 SHADOW_PCF_SIZE:600
profile.RTX =!OLD_LIGHTING SHADOW_TYPE:3 DYN_LIGHT_MODE:3 SHADOW_FILTER:2 SHADOW_PCF_SIZE:600

screen=[DEBUG_OPTIONS] <profile> <empty> <empty> [WORLD_OPTIONS] [SHADOW_OPTIONS] [DYNAMIC_LIGHT_OPTIONS] [POST_OPTIONS]
Expand Down

0 comments on commit 2e98c8d

Please sign in to comment.