mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #48 - Added some features from OptiFine
This commit is contained in:
@ -141,8 +141,9 @@ void main() {
|
||||
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
|
||||
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
|
||||
}
|
||||
if(envMapSample4f.a > 0.0) {
|
||||
specular = eaglercraftIBL_Specular(diffuseColor3f.rgb, envMapSample4f.rgb, viewDir3f, normalVector3f, materialData4f.rgb);
|
||||
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
|
||||
if(envMapSample4f.a == 1.0) {
|
||||
specular = eaglercraftIBL_Specular(diffuseColor3f.rgb, envMapSample4f.rgb * envMapSample4f.a, viewDir3f, normalVector3f, materialData4f.rgb);
|
||||
specular *= 1.0 - sqrt(posDst) * 0.2;
|
||||
}
|
||||
break;
|
||||
|
@ -21,7 +21,7 @@ precision highp sampler2DShadow;
|
||||
in vec4 v_position4f;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
in vec2 v_positionClip2f;
|
||||
in vec3 v_positionClip3f;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
@ -351,7 +351,7 @@ void main() {
|
||||
f += materialData3f.r < 0.5 ? 1.0 : 0.0;
|
||||
while(f == 0.0) {
|
||||
float dst2 = dot(worldPosition4f.xyz, worldPosition4f.xyz);
|
||||
if(dst2 > 16.0) {
|
||||
if(dst2 > 25.0) {
|
||||
break;
|
||||
}
|
||||
vec3 reflectDir = reflect(worldDirection4f.xyz, normalVector3f);
|
||||
@ -369,8 +369,9 @@ void main() {
|
||||
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
|
||||
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
|
||||
}
|
||||
if(envMapSample4f.a > 0.0) {
|
||||
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb, worldDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * (1.0 - sqrt(dst2) * 0.25);
|
||||
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
|
||||
if(envMapSample4f.a == 1.0) {
|
||||
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * (1.0 - sqrt(dst2) * 0.2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -453,7 +454,7 @@ void main() {
|
||||
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, v_positionClip2f * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
|
||||
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
|
||||
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
|
||||
#endif
|
||||
break;
|
||||
|
@ -21,7 +21,7 @@ in vec3 a_position3f;
|
||||
out vec4 v_position4f;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
out vec2 v_positionClip2f;
|
||||
out vec3 v_positionClip3f;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
@ -98,6 +98,6 @@ void main() {
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
v_positionClip2f = gl_Position.xy / gl_Position.w;
|
||||
v_positionClip3f = gl_Position.xyw;
|
||||
#endif
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ void main() {
|
||||
|
||||
for(;;) {
|
||||
float dst2 = dot(worldPosition4f.xyz, worldPosition4f.xyz);
|
||||
if(dst2 > 16.0) {
|
||||
if(dst2 > 25.0) {
|
||||
break;
|
||||
}
|
||||
vec3 reflectDir = reflect(worldDirection4f.xyz, normalVector3f);
|
||||
@ -256,8 +256,9 @@ void main() {
|
||||
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
|
||||
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
|
||||
}
|
||||
if(envMapSample4f.a > 0.0) {
|
||||
lightColor3f += eaglercraftIBL_Specular_Glass(envMapSample4f.rgb, worldDirection4f.xyz, normalVector3f) * (1.0 - sqrt(dst2) * 0.25);
|
||||
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
|
||||
if(envMapSample4f.a == 1.0) {
|
||||
lightColor3f += eaglercraftIBL_Specular_Glass(envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f) * (1.0 - sqrt(dst2) * 0.2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
precision highp sampler2DShadow;
|
||||
|
||||
in vec4 v_position4f;
|
||||
in vec2 v_positionClip2f;
|
||||
in vec3 v_positionClip3f;
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
in vec2 v_texture2f;
|
||||
@ -434,7 +434,7 @@ void main() {
|
||||
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb + u_fogColorAddSun4f.rgb;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, v_positionClip2f * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
|
||||
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
|
||||
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
|
||||
#endif
|
||||
break;
|
||||
|
@ -21,7 +21,7 @@ in vec3 a_position3f;
|
||||
out vec4 v_position4f;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
out vec2 v_positionClip2f;
|
||||
out vec3 v_positionClip3f;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
@ -77,6 +77,6 @@ void main() {
|
||||
gl_Position = u_projectionMat4f * v_position4f;
|
||||
|
||||
#ifdef COMPILE_FOG_LIGHT_SHAFTS
|
||||
v_positionClip2f = gl_Position.xy / gl_Position.w;
|
||||
v_positionClip3f = gl_Position.xyw;
|
||||
#endif
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "§eHigh Performance PBR",
|
||||
"desc": "Pack made from scratch specifically for this client, designed to give what I call the best balance between quality and performance possible in a browser but obviously that's just my opinion",
|
||||
"vers": "1.3.0",
|
||||
"vers": "1.3.1",
|
||||
"author": "lax1dude",
|
||||
"api_vers": 1,
|
||||
"features": [
|
||||
|
Reference in New Issue
Block a user