add handheld light distance slider. add snells window toggle. remove all traces of physics mod support.

This commit is contained in:
Xonk
2024-01-11 14:43:16 -05:00
parent 6d9771bb72
commit 5cac7c90a4
11 changed files with 35 additions and 264 deletions

View File

@ -102,7 +102,7 @@ void main() {
#endif
#ifdef Hand_Held_lights
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(viewPos)/10,0.0),1.5),0.0,1.0));
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(viewPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
#endif

View File

@ -78,8 +78,6 @@ uniform sampler2D depthtex0;
uniform vec4 entityColor;
// in vec3 velocity;
flat varying int PHYSICSMOD_SNOW;
flat varying float blockID;
flat varying float SSSAMOUNT;
@ -316,8 +314,8 @@ void main() {
#ifdef Hand_Held_lights
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(fragpos)/10,0.0),1.5),0.0,1.0));
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(fragpos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
#ifdef HAND
torchlightmap *= 0.9;
#endif
@ -477,9 +475,6 @@ void main() {
gl_FragDepth = toClipSpace3(truePos).z;
#endif
if(PHYSICSMOD_SNOW < 1) normal = applyBump(tbnMatrix, NormalTex.xyz, mix(1.0,1-Puddle_shape,rainfall) );
#endif
//////////////////////////////// ////////////////////////////////

View File

@ -58,7 +58,6 @@ flat varying float HELD_ITEM_BRIGHTNESS;
flat varying int PHYSICSMOD_SNOW;
flat varying int NameTags;
uniform int frameCounter;
@ -240,16 +239,11 @@ void main() {
#endif
NameTags = 0;
PHYSICSMOD_SNOW = 0;
#ifdef ENTITIES
// disallow POM to work on item frames.
if(entityId == 2300) SIGN = 1;
#ifdef ENTITY_PHYSICSMOD_SNOW
if(entityId == 829925) PHYSICSMOD_SNOW = 1;
#endif
// try and single out nametag text and then discard nametag background
// if( dot(gl_Color.rgb, vec3(1.0/3.0)) < 1.0) NameTags = 1;

View File

@ -273,12 +273,6 @@ vec3 GGX (vec3 n, vec3 v, vec3 l, float r, vec3 F0) {
return dotNL * D * F / (dotLH*dotLH*(1.0-k2)+k2);
}
#define PHYSICSMOD_FRAGMENT
#include "/lib/oceans.glsl"
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@ -378,7 +372,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
#endif
#ifdef Hand_Held_lights
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS*clamp( pow(max(1.0-length(viewPos)/10,0.0),1.5),0.0,1.0));
lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS*clamp( pow(max(1.0-length(viewPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
#endif
vec3 Indirect_lighting = vec3(0.0);
@ -534,8 +528,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
float normalDotEye = dot(normal, normalize(viewPos));
float fresnel = pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0);
// snells window looking thing
if(isEyeInWater == 1 ) fresnel = pow(clamp(1.66 + normalDotEye,0.0,1.0), 25.0);
#ifdef SNELLS_WINDOW
// snells window looking thing
if(isEyeInWater == 1 ) fresnel = pow(clamp(1.66 + normalDotEye,0.0,1.0), 25.0);
#endif
fresnel = mix(f0, 1.0, fresnel);

View File

@ -80,8 +80,6 @@ vec4 toClipSpace3(vec3 viewSpacePosition) {
void main() {
vec4 Swtich_gl_vertex = gl_Vertex;
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
vec2 lmcoord = gl_MultiTexCoord1.xy / 255.0; // is this even correct? lol
lmtexcoord.zw = lmcoord;
@ -125,7 +123,7 @@ void main() {
flatnormal = normalMat.xyz;
viewVector = ( gl_ModelViewMatrix * Swtich_gl_vertex).xyz;
viewVector = ( gl_ModelViewMatrix * gl_Vertex).xyz;
viewVector = normalize(tbnMatrix * viewVector);

View File

@ -182,6 +182,7 @@ void applyContrast(inout vec3 color, float contrast){
void ApplyDistortion(inout vec2 Texcoord, vec2 TangentNormals, vec2 depths){
vec2 UnalteredTexcoord = Texcoord;
Texcoord = abs(Texcoord + (TangentNormals * clamp((ld(depths.x) - ld(depths.y)) * 0.5,0.0,0.15)) * RENDER_SCALE );