Skip to content

Commit 9f98385

Browse files
author
eaglercraft
committed
u48
1 parent f8114bb commit 9f98385

File tree

1,054 files changed

+16712
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,054 files changed

+16712
-1204
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
u47
1+
u48

desktopRuntime/resources/assets/eagler/CREDITS.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,58 @@
239239

240240
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241241

242+
Project Name: Alfheim
243+
Project Author: Red Studio
244+
Project URL: https://github.com/Red-Studio-Ragnarok/Alfheim
245+
246+
Used For: Optimized lighting engine
247+
248+
* MIT License
249+
*
250+
* Copyright (c) 2023 Red Studio
251+
*
252+
* Permission is hereby granted, free of charge, to any person obtaining a copy
253+
* of this software and associated documentation files (the "Software"), to deal
254+
* in the Software without restriction, including without limitation the rights
255+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
256+
* copies of the Software, and to permit persons to whom the Software is
257+
* furnished to do so, subject to the following conditions:
258+
*
259+
* The above copyright notice and this permission notice shall be included in all
260+
* copies or substantial portions of the Software.
261+
*
262+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
263+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
264+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
265+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
266+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
267+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
268+
* SOFTWARE.
269+
270+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271+
272+
Project Name: OptiFine (1.8.9_HD_U_M6)
273+
Project Author: sp614x
274+
Project URL: https://optifine.net/
275+
276+
Used For: A few, limited portions we "borrowed" without the author's permission
277+
278+
Note: Eaglercraft is not OptiFine, we only use the code for connected textures
279+
and maintaining compatibility with certain resource pack features
280+
281+
* The mod OptiFine is Copyright © 2011-2021 by sp614x and the intellectual
282+
* property of the author.
283+
* It may be not be reproduced under any circumstances except for personal,
284+
* private use as long as it remains in its unaltered, unedited form.
285+
* It may not be placed on any web site or otherwise distributed publicly
286+
* without advance written permission.
287+
* Use of this mod on any other website or as a part of any public display
288+
* is strictly prohibited and a violation of copyright.
289+
290+
(sorry sp614x)
291+
292+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
293+
242294
Project Name: Google Guava
243295
Project Author: Google
244296
Project URL: https://github.com/google/guava

desktopRuntime/resources/assets/eagler/glsl/deferred/deferred_combine.fsh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ void main() {
141141
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
142142
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
143143
}
144-
if(envMapSample4f.a > 0.0) {
145-
specular = eaglercraftIBL_Specular(diffuseColor3f.rgb, envMapSample4f.rgb, viewDir3f, normalVector3f, materialData4f.rgb);
144+
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
145+
if(envMapSample4f.a == 1.0) {
146+
specular = eaglercraftIBL_Specular(diffuseColor3f.rgb, envMapSample4f.rgb * envMapSample4f.a, viewDir3f, normalVector3f, materialData4f.rgb);
146147
specular *= 1.0 - sqrt(posDst) * 0.2;
147148
}
148149
break;

desktopRuntime/resources/assets/eagler/glsl/deferred/forward_core.fsh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ precision highp sampler2DShadow;
2121
in vec4 v_position4f;
2222

2323
#ifdef COMPILE_FOG_LIGHT_SHAFTS
24-
in vec2 v_positionClip2f;
24+
in vec3 v_positionClip3f;
2525
#endif
2626

2727
#ifdef COMPILE_TEXTURE_ATTRIB
@@ -351,7 +351,7 @@ void main() {
351351
f += materialData3f.r < 0.5 ? 1.0 : 0.0;
352352
while(f == 0.0) {
353353
float dst2 = dot(worldPosition4f.xyz, worldPosition4f.xyz);
354-
if(dst2 > 16.0) {
354+
if(dst2 > 25.0) {
355355
break;
356356
}
357357
vec3 reflectDir = reflect(worldDirection4f.xyz, normalVector3f);
@@ -369,8 +369,9 @@ void main() {
369369
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
370370
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
371371
}
372-
if(envMapSample4f.a > 0.0) {
373-
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb, worldDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * (1.0 - sqrt(dst2) * 0.25);
372+
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
373+
if(envMapSample4f.a == 1.0) {
374+
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * (1.0 - sqrt(dst2) * 0.2);
374375
}
375376
break;
376377
}
@@ -453,7 +454,7 @@ void main() {
453454
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb;
454455

455456
#ifdef COMPILE_FOG_LIGHT_SHAFTS
456-
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, v_positionClip2f * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
457+
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);
457458
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
458459
#endif
459460
break;

desktopRuntime/resources/assets/eagler/glsl/deferred/forward_core.vsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in vec3 a_position3f;
2121
out vec4 v_position4f;
2222

2323
#ifdef COMPILE_FOG_LIGHT_SHAFTS
24-
out vec2 v_positionClip2f;
24+
out vec3 v_positionClip3f;
2525
#endif
2626

2727
#ifdef COMPILE_TEXTURE_ATTRIB
@@ -98,6 +98,6 @@ void main() {
9898
#endif
9999

100100
#ifdef COMPILE_FOG_LIGHT_SHAFTS
101-
v_positionClip2f = gl_Position.xy / gl_Position.w;
101+
v_positionClip3f = gl_Position.xyw;
102102
#endif
103103
}

desktopRuntime/resources/assets/eagler/glsl/deferred/forward_glass_highlights.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void main() {
238238

239239
for(;;) {
240240
float dst2 = dot(worldPosition4f.xyz, worldPosition4f.xyz);
241-
if(dst2 > 16.0) {
241+
if(dst2 > 25.0) {
242242
break;
243243
}
244244
vec3 reflectDir = reflect(worldDirection4f.xyz, normalVector3f);
@@ -256,8 +256,9 @@ void main() {
256256
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
257257
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
258258
}
259-
if(envMapSample4f.a > 0.0) {
260-
lightColor3f += eaglercraftIBL_Specular_Glass(envMapSample4f.rgb, worldDirection4f.xyz, normalVector3f) * (1.0 - sqrt(dst2) * 0.25);
259+
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
260+
if(envMapSample4f.a == 1.0) {
261+
lightColor3f += eaglercraftIBL_Specular_Glass(envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f) * (1.0 - sqrt(dst2) * 0.2);
261262
}
262263
break;
263264
}

desktopRuntime/resources/assets/eagler/glsl/deferred/realistic_water_render.fsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
precision highp sampler2DShadow;
2020

2121
in vec4 v_position4f;
22-
in vec2 v_positionClip2f;
22+
in vec3 v_positionClip3f;
2323

2424
#ifdef COMPILE_TEXTURE_ATTRIB
2525
in vec2 v_texture2f;
@@ -434,7 +434,7 @@ void main() {
434434
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb + u_fogColorAddSun4f.rgb;
435435

436436
#ifdef COMPILE_FOG_LIGHT_SHAFTS
437-
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, v_positionClip2f * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
437+
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);
438438
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
439439
#endif
440440
break;

desktopRuntime/resources/assets/eagler/glsl/deferred/realistic_water_render.vsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in vec3 a_position3f;
2121
out vec4 v_position4f;
2222

2323
#ifdef COMPILE_FOG_LIGHT_SHAFTS
24-
out vec2 v_positionClip2f;
24+
out vec3 v_positionClip3f;
2525
#endif
2626

2727
#ifdef COMPILE_TEXTURE_ATTRIB
@@ -77,6 +77,6 @@ void main() {
7777
gl_Position = u_projectionMat4f * v_position4f;
7878

7979
#ifdef COMPILE_FOG_LIGHT_SHAFTS
80-
v_positionClip2f = gl_Position.xy / gl_Position.w;
80+
v_positionClip3f = gl_Position.xyw;
8181
#endif
8282
}

desktopRuntime/resources/assets/eagler/glsl/deferred/shader_pack_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "§eHigh Performance PBR",
33
"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",
4-
"vers": "1.3.0",
4+
"vers": "1.3.1",
55
"author": "lax1dude",
66
"api_vers": 1,
77
"features": [

desktopRuntime/resources/assets/eagler/glsl/texture_mix.fsh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#line 2
22

33
/*
4-
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
4+
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
55
*
66
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
77
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -16,18 +16,16 @@
1616
*
1717
*/
1818

19-
EAGLER_IN(vec2, v_position2f)
19+
EAGLER_IN(vec2, v_texCoords2f)
2020

2121
EAGLER_FRAG_OUT()
2222

2323
uniform sampler2D u_inputTexture;
2424
uniform float u_textureLod1f;
2525
uniform vec4 u_blendFactor4f;
2626
uniform vec4 u_blendBias4f;
27-
uniform mat3 u_matrixTransform;
2827

2928
void main() {
30-
vec3 coords = u_matrixTransform * vec3(v_position2f, 1.0);
31-
vec4 color4f = EAGLER_TEXTURE_2D_LOD(u_inputTexture, coords.xy, u_textureLod1f);
29+
vec4 color4f = EAGLER_TEXTURE_2D_LOD(u_inputTexture, v_texCoords2f, u_textureLod1f);
3230
EAGLER_FRAG_COLOR = color4f * u_blendFactor4f + u_blendBias4f;
3331
}

0 commit comments

Comments
 (0)