Skip to content

Commit

Permalink
Update to u34 and add Controller support
Browse files Browse the repository at this point in the history
  • Loading branch information
PeytonPlayz595 committed Jul 5, 2024
1 parent 375c449 commit 9c64ad5
Show file tree
Hide file tree
Showing 114 changed files with 4,325,263 additions and 599,903 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ teavm.js {
optimization = org.teavm.gradle.api.OptimizationLevel.BALANCED
outOfProcess = false
fastGlobalAnalysis = false
processMemory = 512
processMemory = 2048
entryPointName = 'main'
mainClass = 'net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass'
outputDir = file("javascript")
Expand Down
11 changes: 4 additions & 7 deletions desktopRuntime/resources/assets/eagler/glsl/accel_particle.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ out vec4 v_color4f;

uniform mat4 u_matrixTransform;
uniform vec3 u_texCoordSize2f_particleSize1f;
uniform vec4 u_transformParam_1_2_3_4_f;
uniform float u_transformParam_5_f;
uniform vec3 u_transformParam_1_2_5_f;
uniform vec2 u_transformParam_3_4_f;
uniform vec4 u_color4f;

uniform sampler2D u_lightmapTexture;
Expand All @@ -51,11 +51,8 @@ void main() {

vec3 pos3f = p_position3f;
vec2 spos2f = a_position2f * particleSize;
pos3f.x += u_transformParam_1_2_3_4_f.x * spos2f.x;
pos3f.x += u_transformParam_1_2_3_4_f.w * spos2f.y;
pos3f.y += u_transformParam_1_2_3_4_f.y * spos2f.y;
pos3f.z += u_transformParam_1_2_3_4_f.z * spos2f.x;
pos3f.z += u_transformParam_5_f * spos2f.y;
pos3f += u_transformParam_1_2_5_f * spos2f.xyy;
pos3f.zx += u_transformParam_3_4_f * spos2f;

gl_Position = u_matrixTransform * vec4(pos3f, 1.0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ uniform mat4 u_matrixTransform;
#endif

uniform vec3 u_texCoordSize2f_particleSize1f;
uniform vec4 u_transformParam_1_2_3_4_f;
uniform float u_transformParam_5_f;
uniform vec3 u_transformParam_1_2_5_f;
uniform vec2 u_transformParam_3_4_f;

void main() {
v_color4f = p_color4f.bgra;
Expand All @@ -59,11 +59,8 @@ void main() {

vec3 pos3f = p_position3f;
vec2 spos2f = a_position2f * particleSize;
pos3f.x += u_transformParam_1_2_3_4_f.x * spos2f.x;
pos3f.x += u_transformParam_1_2_3_4_f.w * spos2f.y;
pos3f.y += u_transformParam_1_2_3_4_f.y * spos2f.y;
pos3f.z += u_transformParam_1_2_3_4_f.z * spos2f.x;
pos3f.z += u_transformParam_5_f * spos2f.y;
pos3f += u_transformParam_1_2_5_f * spos2f.xyy;
pos3f.zx += u_transformParam_3_4_f * spos2f;

#ifdef COMPILE_GBUFFER_VSH
gl_Position = u_matrixTransform * vec4(pos3f, 1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ minecraft:torch,0,1.0000,0.5983,0.2655,10.0
minecraft:redstone_torch,0,1.0000,0.1578,0.0000,4.0
minecraft:sea_lantern,0,0.5530,0.6468,1.0000,10.0,
minecraft:lava_bucket,0,1.0000,0.4461,0.1054,6.0,
minecraft:nether_star,0,0.5711,0.6611,1.0000,6.0
minecraft:nether_star,0,0.5711,0.6611,1.0000,6.0
minecraft:ender_eye,0,0.1990,0.7750,0.4130,4.0
Original file line number Diff line number Diff line change
@@ -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.1.0",
"vers": "1.2.0",
"author": "lax1dude",
"api_vers": 1,
"features": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#line 2

/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

precision lowp int;
precision mediump float;
precision mediump sampler2D;

in vec4 v_position4f;
in vec2 v_texCoord2f;
in vec4 v_color4f;
in vec2 v_lightmap2f;

layout(location = 0) out vec4 output4f;

uniform sampler2D u_inputTexture;
uniform sampler2D u_lightmapTexture;

uniform mat4 u_inverseViewMatrix4f;

layout(std140) uniform u_chunkLightingData {
mediump int u_dynamicLightCount1i;
mediump int _paddingA_;
mediump int _paddingB_;
mediump int _paddingC_;
mediump vec4 u_dynamicLightArray[12];
};

void main() {
vec4 color = texture(u_inputTexture, v_texCoord2f) * v_color4f;

if(color.a < 0.004) {
discard;
}

vec4 light;
float diffuse = 0.0;
if(u_dynamicLightCount1i > 0) {
vec4 worldPosition4f = u_inverseViewMatrix4f * v_position4f;
worldPosition4f.xyz /= worldPosition4f.w;
vec3 normalVector3f = normalize(u_inverseViewMatrix4f[2].xyz);
int safeLightCount = u_dynamicLightCount1i > 12 ? 0 : u_dynamicLightCount1i;
for(int i = 0; i < safeLightCount; ++i) {
light = u_dynamicLightArray[i];
light.xyz = light.xyz - worldPosition4f.xyz;
diffuse += max(dot(normalize(light.xyz), normalVector3f) * 0.8 + 0.2, 0.0) * max(light.w - sqrt(dot(light.xyz, light.xyz)), 0.0);
}
}

color *= texture(u_lightmapTexture, vec2(min(v_lightmap2f.x + diffuse * 0.066667, 1.0), v_lightmap2f.y));

output4f = color;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#line 2

/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

precision lowp int;
precision highp float;
precision mediump sampler2D;

layout(location = 0) in vec2 a_position2f;

layout(location = 1) in vec3 p_position3f;
layout(location = 2) in vec2 p_texCoords2i;
layout(location = 3) in vec2 p_lightMap2f;
layout(location = 4) in vec2 p_particleSize_texCoordsSize_2i;
layout(location = 5) in vec4 p_color4f;

out vec4 v_position4f;
out vec2 v_texCoord2f;
out vec4 v_color4f;
out vec2 v_lightmap2f;

uniform mat4 u_modelViewMatrix4f;
uniform mat4 u_projectionMatrix4f;
uniform vec3 u_texCoordSize2f_particleSize1f;
uniform vec3 u_transformParam_1_2_5_f;
uniform vec2 u_transformParam_3_4_f;
uniform vec4 u_color4f;

void main() {
v_color4f = u_color4f * p_color4f.bgra;
v_lightmap2f = p_lightMap2f;

vec2 tex2f = a_position2f * 0.5 + 0.5;
tex2f.y = 1.0 - tex2f.y;
tex2f = p_texCoords2i + tex2f * p_particleSize_texCoordsSize_2i.y;
v_texCoord2f = tex2f * u_texCoordSize2f_particleSize1f.xy;

float particleSize = u_texCoordSize2f_particleSize1f.z * p_particleSize_texCoordsSize_2i.x;

vec3 pos3f = p_position3f;
vec2 spos2f = a_position2f * particleSize;
pos3f += u_transformParam_1_2_5_f * spos2f.xyy;
pos3f.zx += u_transformParam_3_4_f * spos2f;

v_position4f = u_modelViewMatrix4f * vec4(pos3f, 1.0);
gl_Position = u_projectionMatrix4f * v_position4f;
}
Loading

0 comments on commit 9c64ad5

Please sign in to comment.