Skip to content

Commit 13b5df2

Browse files
committed
Reimagined r2.0.2
1 parent cb80796 commit 13b5df2

File tree

16 files changed

+61
-50
lines changed

16 files changed

+61
-50
lines changed

shaderFile_1/shaderFile_4.placebo

Lines changed: 0 additions & 1 deletion
This file was deleted.

shaderFile_1/shaderFile_L.placebo

17.2 KB
Binary file not shown.

shaders/block.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ block.10004=tallgrass sapling deadbush yellow_flower red_flower wheat carrots po
2424
#endif
2525
block.10008=leaves leaves2 oak_leaves spruce_leaves birch_leaves jungle_leaves acacia_leaves dark_oak_leaves azalea_leaves flowering_azalea_leaves mangrove_leaves
2626
block.10012=vine
27-
block.10016=attached_pumpkin_stem attached_melon_stem mangrove_propagule seagrass tall_seagrass kelp_plant kelp hanging_roots sugar_cane cobweb spore_blossom
27+
block.10016=attached_pumpkin_stem attached_melon_stem mangrove_propagule seagrass tall_seagrass kelp_plant kelp hanging_roots sugar_cane spore_blossom
2828
block.10020=double_plant:half=upper sunflower:half=upper lilac:half=upper rose_bush:half=upper peony:half=upper tall_grass:half=upper large_fern:half=upper
2929
block.10024=brewing_stand
3030
block.10028=hay_block
@@ -242,6 +242,7 @@ block.10728=flower_pot potted_dandelion potted_poppy potted_blue_orchid potted_a
242242
block.10732=lever
243243
block.10736=structure_block jigsaw
244244
block.10740=chain
245+
block.10744=cobweb
245246

246247
block.30000=stained_glass white_stained_glass orange_stained_glass magenta_stained_glass light_blue_stained_glass yellow_stained_glass lime_stained_glass pink_stained_glass gray_stained_glass light_gray_stained_glass cyan_stained_glass purple_stained_glass blue_stained_glass brown_stained_glass green_stained_glass red_stained_glass black_stained_glass
247248
block.30004=stained_glass_pane white_stained_glass_pane orange_stained_glass_pane magenta_stained_glass_pane light_blue_stained_glass_pane yellow_stained_glass_pane lime_stained_glass_pane pink_stained_glass_pane gray_stained_glass_pane light_gray_stained_glass_pane cyan_stained_glass_pane purple_stained_glass_pane blue_stained_glass_pane brown_stained_glass_pane green_stained_glass_pane red_stained_glass_pane black_stained_glass_pane

shaders/lib/atmospherics/volumetricLight.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewP
119119
float distb = sqrt(wpos.x * wpos.x + wpos.y * wpos.y);
120120
float distortFactor = 1.0 - shadowMapBias + distb * shadowMapBias;
121121
vec4 shadowPosition = DistortShadow(wpos,distortFactor);
122-
shadowPosition.z += 0.0001;
122+
//shadowPosition.z += 0.0001;
123123

124124
#ifdef OVERWORLD
125125
float percentComplete = currentDist / maxDist;

shaders/lib/common.glsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@
9696
//Internal Settings//
9797
#define SIDE_SHADOWING
9898

99-
#if RP_MODE >= 1 && REFLECTION_QUALITY >= 3
100-
#define PBR_REFLECTIONS
101-
#endif
102-
103-
#if defined WAVING_FOLIAGE || defined WAVING_LEAVES
104-
#define WAVING_ANYTHING_TERRAIN
105-
#endif
106-
10799
#define GLASS_OPACITY 0.25
108100
#define FANCY_NETHERPORTAL
109101
#define TRANSLUCENT_BLEND_FALLOFF_MULT 0.01
@@ -220,6 +212,14 @@
220212
#undef CLOUD_SHADOWS
221213
#endif
222214

215+
#if RP_MODE >= 1 && REFLECTION_QUALITY >= 3
216+
#define PBR_REFLECTIONS
217+
#endif
218+
219+
#if defined WAVING_FOLIAGE || defined WAVING_LEAVES
220+
#define WAVING_ANYTHING_TERRAIN
221+
#endif
222+
223223
//Activate Settings//
224224
#ifdef ENTITY_SHADOWS
225225
#endif

shaders/lib/lighting/mainLighting.glsl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ vec3 highlightColor = normalize(pow(lightColor, vec3(0.37))) * (0.5 + 1.3 * sunV
2323

2424
//Lighting//
2525
void DoLighting(inout vec3 color, inout vec3 shadowMult, vec3 playerPos, vec3 viewPos, float lViewPos, vec3 normalM, vec2 lightmap,
26-
bool noSmoothLighting, bool noDirectionalShading, bool noVanillaAO, int subsurfaceMode,
26+
bool noSmoothLighting, bool noDirectionalShading, bool noVanillaAO, bool centerShadowBias, int subsurfaceMode,
2727
float smoothnessG, float highlightMult, float emission) {
2828
float lightmapY2 = pow2(lightmap.y);
2929
float lightmapYM = smoothstep1(lightmap.y);
@@ -105,29 +105,31 @@ void DoLighting(inout vec3 color, inout vec3 shadowMult, vec3 playerPos, vec3 vi
105105
vec3 worldNormal = normalize(ViewToPlayer(normal*1000.0));
106106
vec3 bias = worldNormal * min(0.12 + length(playerPos) / 200.0, 0.5) * (2.0 - NdotLmax0);
107107

108-
// Fix light leaking in caves
109108
#ifdef GBUFFERS_TERRAIN
110109
if (subsurfaceMode == 2) {
111110
bias *= vec3(0.0, 0.0, -0.75);
112111
} else if (subsurfaceMode == 1) {
113112
bias *= 1.0 - lightmapYM;
114113
}
115114
#endif
115+
// Fix light leaking in caves
116116
if (lightmapYM < 0.999) {
117-
#ifdef GBUFFERS_ENTITIES
118-
vec3 centerplayerPos = floor(playerPosM + cameraPosition) - cameraPosition + 0.5;
119-
playerPosM = mix(centerplayerPos, playerPosM, 0.5 + 0.5 * lightmapYM);
120-
#elif defined GBUFFERS_HAND
117+
#ifdef GBUFFERS_HAND
121118
playerPosM = mix(vec3(0.0), playerPosM, 0.2 + 0.8 * lightmapYM);
122119
#else
123-
vec3 edgeFactor = 0.2 * (0.5 - fract(playerPosM + cameraPosition + worldNormal * 0.01));
124-
125-
#ifdef GBUFFERS_WATER
126-
bias *= 0.7;
127-
playerPosM += (1.0 - lightmapYM) * edgeFactor;
128-
#endif
129-
130-
playerPosM += (1.0 - pow2(pow2(max(glColor.a, lightmapYM)))) * edgeFactor;
120+
if (centerShadowBias) {
121+
vec3 centerPos = floor(playerPosM + cameraPosition) - cameraPosition + 0.5;
122+
playerPosM = mix(centerPos, playerPosM, 0.5 + 0.5 * lightmapYM);
123+
} else {
124+
vec3 edgeFactor = 0.2 * (0.5 - fract(playerPosM + cameraPosition + worldNormal * 0.01));
125+
126+
#ifdef GBUFFERS_WATER
127+
bias *= 0.7;
128+
playerPosM += (1.0 - lightmapYM) * edgeFactor;
129+
#endif
130+
131+
playerPosM += (1.0 - pow2(pow2(max(glColor.a, lightmapYM)))) * edgeFactor;
132+
}
131133
#endif
132134
}
133135

shaders/lib/materials/materialHandling/terrainMaterials.glsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ if (mat < 10512) {
1010
}
1111
else if (mat == 10004) { // Grounded Waving Foliage
1212
subsurfaceMode = 1, noSmoothLighting = true, noDirectionalShading = true;
13-
1413
DoFoliageColorTweaks(color.rgb, shadowMult, snowMinNdotU, lViewPos);
1514

1615
#ifndef REALTIME_SHADOWS
@@ -23,7 +22,8 @@ if (mat < 10512) {
2322
#include "/lib/materials/specificMaterials/terrain/leaves.glsl"
2423
}
2524
else /*if (mat == 10012)*/ { // Vine
26-
shadowMult = vec3(1.7); //dup2315
25+
shadowMult = vec3(1.7);
26+
centerShadowBias = true;
2727
}
2828
}
2929
} else {
@@ -33,7 +33,6 @@ if (mat < 10512) {
3333
}
3434
else /*if (mat == 10020)*/ { // Upper Waving Foliage
3535
subsurfaceMode = 1, noSmoothLighting = true, noDirectionalShading = true;
36-
3736
DoFoliageColorTweaks(color.rgb, shadowMult, snowMinNdotU, lViewPos);
3837

3938
#ifndef REALTIME_SHADOWS
@@ -1694,7 +1693,7 @@ if (mat < 10512) {
16941693
lmCoordM.x = 1.0 - 0.5 * dot(fractPos.xz, fractPos.xz);
16951694

16961695
float dotColor = dot(color.rgb, color.rgb);
1697-
if (color.r > color.b && color.r - color.g < 0.15 && dotColor < 1.5) {
1696+
if (color.r > color.b && color.r - color.g < 0.15 && dotColor < 1.4) {
16981697
#include "/lib/materials/specificMaterials/terrain/oakWood.glsl"
16991698
} else if (color.r > color.b || dotColor > 2.9) {
17001699
noDirectionalShading = true;
@@ -1904,8 +1903,9 @@ if (mat < 10512) {
19041903
#include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl"
19051904
}
19061905
} else {
1907-
if (mat == 10744) { //
1908-
1906+
if (mat == 10744) { // Cobweb
1907+
subsurfaceMode = 1, noSmoothLighting = true, noDirectionalShading = true;
1908+
centerShadowBias = true;
19091909
}
19101910
else /*if (mat == 10748)*/ { //
19111911

shaders/lib/materials/specificMaterials/translucents/water.glsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ glColorM = sqrt1(glColorM) * vec3(1.0, 0.85, 0.8);
1616
color.rgb = colorPM * glColorM;
1717
#endif
1818

19-
#if defined GENERATED_NORMALS && WATER_STYLE >= 3
19+
#define PHYSICS_OCEAN_INJECTION
20+
#if defined GENERATED_NORMALS && WATER_STYLE >= 3 || defined PHYSICS_OCEAN
2021
noGeneratedNormals = true;
2122
#endif
2223

shaders/program/deferred1.glsl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,20 +277,19 @@ void main() {
277277
#include "/lib/materials/materialHandling/deferredMaterials.glsl"
278278
#else
279279
if (materialMaskInt <= 240) {
280-
#ifdef PBR_REFLECTIONS
280+
#ifdef CUSTOM_PBR
281281
#if RP_MODE == 2 // SEUSPBR
282282
float metalness = materialMaskInt / 240.0;
283283

284284
intenseFresnel = metalness;
285-
reflectColor = mix(reflectColor, color.rgb / max(color.r, max(color.g, color.b)), metalness);
286285
color.rgb *= 1.0 - 0.25 * metalness;
287286
#elif RP_MODE == 3 // labPBR
288287
float metalness = float(materialMaskInt >= 230);
289288

290289
intenseFresnel = materialMaskInt / 240.0;
291-
reflectColor = mix(reflectColor, color.rgb / max(color.r, max(color.g, color.b)), metalness);
292290
color.rgb *= 1.0 - 0.25 * metalness;
293291
#endif
292+
reflectColor = mix(reflectColor, color.rgb / max(color.r + 0.00001, max(color.g, color.b)), metalness);
294293
#endif
295294
} else {
296295
if (materialMaskInt == 254) // No SSAO, No TAA

shaders/program/gbuffers_basic.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void main() {
8383

8484
vec3 shadowMult = vec3(1.0);
8585
DoLighting(color.rgb, shadowMult, playerPos, viewPos, lViewPos, normal, lmCoord,
86-
false, false, false, 0,
86+
false, false, false, false, 0,
8787
0.0, 0.0, 0.0);
8888

8989
#if SELECTION_OUTLINE > 0

0 commit comments

Comments
 (0)