mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #37 - Touch support without userscript, many other feats
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,21 +16,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision mediump float;
|
||||
precision mediump sampler2D;
|
||||
EAGLER_IN(vec2, v_texCoord2f)
|
||||
EAGLER_IN(vec4, v_color4f)
|
||||
|
||||
in vec2 v_texCoord2f;
|
||||
in vec4 v_color4f;
|
||||
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
uniform sampler2D u_inputTexture;
|
||||
uniform vec4 u_colorBias4f;
|
||||
|
||||
void main() {
|
||||
output4f = texture(u_inputTexture, v_texCoord2f) * v_color4f + u_colorBias4f;
|
||||
if(output4f.a < 0.004) {
|
||||
EAGLER_FRAG_COLOR = EAGLER_TEXTURE_2D(u_inputTexture, v_texCoord2f) * v_color4f + u_colorBias4f;
|
||||
if(EAGLER_FRAG_COLOR.a < 0.004) {
|
||||
discard;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,18 +16,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision highp float;
|
||||
precision mediump sampler2D;
|
||||
EAGLER_VSH_LAYOUT_BEGIN()
|
||||
EAGLER_IN(0, vec3, a_position3f)
|
||||
EAGLER_IN(1, vec2, c_position2i)
|
||||
EAGLER_IN(2, vec2, c_coords2i)
|
||||
EAGLER_IN(3, vec4, c_color4f)
|
||||
EAGLER_VSH_LAYOUT_END()
|
||||
|
||||
layout(location = 0) in vec3 a_position3f;
|
||||
|
||||
layout(location = 1) in vec2 c_position2i;
|
||||
layout(location = 2) in vec2 c_coords2i;
|
||||
layout(location = 3) in vec4 c_color4f;
|
||||
|
||||
out vec2 v_texCoord2f;
|
||||
out vec4 v_color4f;
|
||||
EAGLER_OUT(vec2, v_texCoord2f)
|
||||
EAGLER_OUT(vec4, v_color4f)
|
||||
|
||||
uniform mat4 u_matrixTransform;
|
||||
uniform vec2 u_charSize2f;
|
||||
@ -49,5 +46,5 @@ void main() {
|
||||
pos2d.x -= (a_position3f.y - 0.5) * italicBit;
|
||||
v_color4f.a *= 2.0;
|
||||
v_color4f *= u_color4f;
|
||||
gl_Position = u_matrixTransform * vec4(pos2d, 0.0, 1.0);
|
||||
EAGLER_VERT_POSITION = u_matrixTransform * vec4(pos2d, 0.0, 1.0);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,20 +16,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision mediump float;
|
||||
precision mediump sampler2D;
|
||||
EAGLER_IN(vec2, v_texCoord2f)
|
||||
EAGLER_IN(vec4, v_color4f)
|
||||
|
||||
in vec2 v_texCoord2f;
|
||||
in vec4 v_color4f;
|
||||
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
uniform sampler2D u_inputTexture;
|
||||
|
||||
void main() {
|
||||
output4f = texture(u_inputTexture, v_texCoord2f) * v_color4f;
|
||||
if(output4f.a < 0.004) {
|
||||
EAGLER_FRAG_COLOR = EAGLER_TEXTURE_2D(u_inputTexture, v_texCoord2f) * v_color4f;
|
||||
if(EAGLER_FRAG_COLOR.a < 0.004) {
|
||||
discard;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,20 +16,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision highp float;
|
||||
precision mediump sampler2D;
|
||||
EAGLER_VSH_LAYOUT_BEGIN()
|
||||
EAGLER_IN(0, vec2, a_position2f)
|
||||
EAGLER_IN(1, vec3, p_position3f)
|
||||
EAGLER_IN(2, vec2, p_texCoords2i)
|
||||
EAGLER_IN(3, vec2, p_lightMap2f)
|
||||
EAGLER_IN(4, vec2, p_particleSize_texCoordsSize_2i)
|
||||
EAGLER_IN(5, vec4, p_color4f)
|
||||
EAGLER_VSH_LAYOUT_END()
|
||||
|
||||
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 vec2 v_texCoord2f;
|
||||
out vec4 v_color4f;
|
||||
EAGLER_OUT(vec2, v_texCoord2f)
|
||||
EAGLER_OUT(vec4, v_color4f)
|
||||
|
||||
uniform mat4 u_matrixTransform;
|
||||
uniform vec3 u_texCoordSize2f_particleSize1f;
|
||||
@ -40,7 +37,7 @@ uniform vec4 u_color4f;
|
||||
uniform sampler2D u_lightmapTexture;
|
||||
|
||||
void main() {
|
||||
v_color4f = u_color4f * p_color4f.bgra * texture(u_lightmapTexture, p_lightMap2f);
|
||||
v_color4f = u_color4f * p_color4f.bgra * EAGLER_TEXTURE_2D(u_lightmapTexture, p_lightMap2f);
|
||||
|
||||
vec2 tex2f = a_position2f * 0.5 + 0.5;
|
||||
tex2f.y = 1.0 - tex2f.y;
|
||||
@ -54,5 +51,5 @@ void main() {
|
||||
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);
|
||||
EAGLER_VERT_POSITION = u_matrixTransform * vec4(pos3f, 1.0);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -17,11 +17,11 @@
|
||||
*/
|
||||
|
||||
#if defined(COMPILE_ENABLE_TEX_GEN) || defined(COMPILE_ENABLE_FOG)
|
||||
in vec4 v_position4f;
|
||||
EAGLER_IN(vec4, v_position4f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
in vec2 v_texture2f;
|
||||
EAGLER_IN(vec2, v_texture2f)
|
||||
#endif
|
||||
|
||||
uniform vec4 u_color4f;
|
||||
@ -32,15 +32,15 @@ uniform vec4 u_colorBlendAdd4f;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_COLOR_ATTRIB
|
||||
in vec4 v_color4f;
|
||||
EAGLER_IN(vec4, v_color4f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_NORMAL_ATTRIB
|
||||
in vec3 v_normal3f;
|
||||
EAGLER_IN(vec3, v_normal3f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_LIGHTMAP_ATTRIB
|
||||
in vec2 v_lightmap2f;
|
||||
EAGLER_IN(vec2, v_lightmap2f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_ENABLE_TEXTURE2D
|
||||
@ -76,7 +76,7 @@ uniform vec4 u_fogColor4f;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_ENABLE_TEX_GEN
|
||||
in vec3 v_objectPosition3f;
|
||||
EAGLER_IN(vec3, v_objectPosition3f)
|
||||
uniform ivec4 u_texGenPlane4i;
|
||||
uniform vec4 u_texGenS4f;
|
||||
uniform vec4 u_texGenT4f;
|
||||
@ -89,7 +89,7 @@ uniform mat4 u_textureMat4f01;
|
||||
uniform vec2 u_textureAnisotropicFix;
|
||||
#endif
|
||||
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
void main() {
|
||||
|
||||
@ -98,22 +98,29 @@ void main() {
|
||||
#else
|
||||
vec4 color = u_color4f;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef COMPILE_ENABLE_TEX_GEN
|
||||
vec4 tmpVec4 = vec4(v_objectPosition3f, 1.0);
|
||||
vec4 texGenVector;
|
||||
|
||||
vec4 texGenPosSrc[2];
|
||||
texGenPosSrc[0] = vec4(v_objectPosition3f, 1.0);
|
||||
texGenPosSrc[1] = v_position4f;
|
||||
|
||||
texGenVector.x = dot(texGenPosSrc[u_texGenPlane4i.x], u_texGenS4f);
|
||||
texGenVector.y = dot(texGenPosSrc[u_texGenPlane4i.y], u_texGenT4f);
|
||||
texGenVector.z = dot(texGenPosSrc[u_texGenPlane4i.z], u_texGenR4f);
|
||||
texGenVector.w = dot(texGenPosSrc[u_texGenPlane4i.w], u_texGenQ4f);
|
||||
|
||||
texGenVector.x = dot(u_texGenPlane4i.x == 1 ? v_position4f : tmpVec4, u_texGenS4f);
|
||||
texGenVector.y = dot(u_texGenPlane4i.y == 1 ? v_position4f : tmpVec4, u_texGenT4f);
|
||||
texGenVector.z = dot(u_texGenPlane4i.z == 1 ? v_position4f : tmpVec4, u_texGenR4f);
|
||||
texGenVector.w = dot(u_texGenPlane4i.w == 1 ? v_position4f : tmpVec4, u_texGenQ4f);
|
||||
#ifdef EAGLER_HAS_GLES_300
|
||||
texGenVector.xyz = mat4x3(
|
||||
u_textureMat4f01[0].xyw,
|
||||
u_textureMat4f01[1].xyw,
|
||||
u_textureMat4f01[2].xyw,
|
||||
u_textureMat4f01[3].xyw
|
||||
) * texGenVector;
|
||||
texGenVector.xy /= texGenVector.z;
|
||||
#else
|
||||
texGenVector = u_textureMat4f01 * texGenVector;
|
||||
color *= texture(u_samplerTexture, texGenVector.xy / texGenVector.w);
|
||||
|
||||
texGenVector.xy /= texGenVector.w;
|
||||
#endif
|
||||
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerTexture, texGenVector.xy);
|
||||
|
||||
#ifdef COMPILE_ENABLE_ALPHA_TEST
|
||||
if(color.a < u_alphaTestRef1f) discard;
|
||||
#endif
|
||||
@ -126,20 +133,20 @@ void main() {
|
||||
// d3d11 doesn't support GL_NEAREST upscaling with anisotropic
|
||||
// filtering enabled, so it needs this stupid fix to 'work'
|
||||
vec2 uv = floor(v_texture2f * u_textureAnisotropicFix) + 0.5;
|
||||
color *= texture(u_samplerTexture, uv / u_textureAnisotropicFix);
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerTexture, uv / u_textureAnisotropicFix);
|
||||
#else
|
||||
color *= texture(u_samplerTexture, v_texture2f);
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerTexture, v_texture2f);
|
||||
#endif
|
||||
#else
|
||||
color *= texture(u_samplerTexture, u_textureCoords01);
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerTexture, u_textureCoords01);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_ENABLE_LIGHTMAP
|
||||
#ifdef COMPILE_LIGHTMAP_ATTRIB
|
||||
color *= texture(u_samplerLightmap, v_lightmap2f);
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerLightmap, v_lightmap2f);
|
||||
#else
|
||||
color *= texture(u_samplerLightmap, u_textureCoords02);
|
||||
color *= EAGLER_TEXTURE_2D(u_samplerLightmap, u_textureCoords02);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -161,9 +168,18 @@ void main() {
|
||||
#endif
|
||||
float diffuse = 0.0;
|
||||
vec4 light;
|
||||
#ifdef EAGLER_HAS_GLES_300
|
||||
for(int i = 0; i < u_lightsEnabled1i; ++i) {
|
||||
#else
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
#endif
|
||||
light = u_lightsDirections4fv[i];
|
||||
diffuse += max(dot(light.xyz, normal), 0.0) * light.w;
|
||||
#ifndef EAGLER_HAS_GLES_300
|
||||
if(i + 1 >= u_lightsEnabled1i) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
color.rgb *= min(u_lightsAmbient3f + vec3(diffuse), 1.0);
|
||||
#endif
|
||||
@ -179,5 +195,5 @@ void main() {
|
||||
color.rgb = mix(color.rgb, u_fogColor4f.rgb, clamp(f, 0.0, 1.0) * u_fogColor4f.a);
|
||||
#endif
|
||||
|
||||
output4f = color;
|
||||
EAGLER_FRAG_COLOR = color;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,39 +16,39 @@
|
||||
*
|
||||
*/
|
||||
|
||||
in vec3 a_position3f;
|
||||
EAGLER_IN_AUTO(vec3, a_position3f)
|
||||
|
||||
#if defined(COMPILE_ENABLE_TEX_GEN) || defined(COMPILE_ENABLE_FOG)
|
||||
#define _COMPILE_VARYING_POSITION
|
||||
#endif
|
||||
|
||||
#ifdef _COMPILE_VARYING_POSITION
|
||||
out vec4 v_position4f;
|
||||
EAGLER_OUT(vec4, v_position4f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_ENABLE_TEX_GEN
|
||||
out vec3 v_objectPosition3f;
|
||||
EAGLER_OUT(vec3, v_objectPosition3f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TEXTURE_ATTRIB
|
||||
in vec2 a_texture2f;
|
||||
out vec2 v_texture2f;
|
||||
EAGLER_IN_AUTO(vec2, a_texture2f)
|
||||
EAGLER_OUT(vec2, v_texture2f)
|
||||
uniform mat4 u_textureMat4f01;
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_COLOR_ATTRIB
|
||||
in vec4 a_color4f;
|
||||
out vec4 v_color4f;
|
||||
EAGLER_IN_AUTO(vec4, a_color4f)
|
||||
EAGLER_OUT(vec4, v_color4f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_NORMAL_ATTRIB
|
||||
in vec4 a_normal4f;
|
||||
out vec3 v_normal3f;
|
||||
EAGLER_IN_AUTO(vec4, a_normal4f)
|
||||
EAGLER_OUT(vec3, v_normal3f)
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_LIGHTMAP_ATTRIB
|
||||
in vec2 a_lightmap2f;
|
||||
out vec2 v_lightmap2f;
|
||||
EAGLER_IN_AUTO(vec2, a_lightmap2f)
|
||||
EAGLER_OUT(vec2, v_lightmap2f)
|
||||
uniform mat4 u_textureMat4f02;
|
||||
#endif
|
||||
|
||||
@ -92,8 +92,8 @@ void main() {
|
||||
#endif
|
||||
|
||||
#ifdef _COMPILE_VARYING_POSITION
|
||||
gl_Position = u_projectionMat4f * v_position4f;
|
||||
EAGLER_VERT_POSITION = u_projectionMat4f * v_position4f;
|
||||
#else
|
||||
gl_Position = u_modelviewProjMat4f * vec4(a_position3f, 1.0);
|
||||
EAGLER_VERT_POSITION = u_modelviewProjMat4f * vec4(a_position3f, 1.0);
|
||||
#endif
|
||||
}
|
||||
|
@ -226,20 +226,18 @@ void main() {
|
||||
#ifdef COMPILE_ENABLE_TEXTURE2D
|
||||
vec2 texCoords2f;
|
||||
#ifdef COMPILE_ENABLE_TEX_GEN
|
||||
vec4 tmpVec4 = vec4(v_objectPosition3f, 1.0);
|
||||
vec4 texGenVector;
|
||||
vec4 texGenPosSrc[2];
|
||||
texGenPosSrc[0] = vec4(v_objectPosition3f, 1.0);
|
||||
texGenPosSrc[1] = v_position4f;
|
||||
texGenVector.x = dot(texGenPosSrc[u_texGenPlane4i.x], u_texGenS4f);
|
||||
texGenVector.y = dot(texGenPosSrc[u_texGenPlane4i.y], u_texGenT4f);
|
||||
texGenVector.z = dot(texGenPosSrc[u_texGenPlane4i.z], u_texGenR4f);
|
||||
texGenVector.w = dot(texGenPosSrc[u_texGenPlane4i.w], u_texGenQ4f);
|
||||
texGenVector = vec4(mat4x3(
|
||||
texGenVector.x = dot(u_texGenPlane4i.x == 1 ? v_position4f : tmpVec4, u_texGenS4f);
|
||||
texGenVector.y = dot(u_texGenPlane4i.y == 1 ? v_position4f : tmpVec4, u_texGenT4f);
|
||||
texGenVector.z = dot(u_texGenPlane4i.z == 1 ? v_position4f : tmpVec4, u_texGenR4f);
|
||||
texGenVector.w = dot(u_texGenPlane4i.w == 1 ? v_position4f : tmpVec4, u_texGenQ4f);
|
||||
texGenVector.xyz = mat4x3(
|
||||
u_textureMat4f01[0].xyw,
|
||||
u_textureMat4f01[1].xyw,
|
||||
u_textureMat4f01[2].xyw,
|
||||
u_textureMat4f01[3].xyw
|
||||
) * texGenVector, 0.0);
|
||||
) * texGenVector;
|
||||
texCoords2f = texGenVector.xy / texGenVector.z;
|
||||
#else
|
||||
|
||||
|
@ -99,13 +99,13 @@ void main() {
|
||||
reprojectionReflectionOutput4f = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
reprojectionHitVectorOutput4f = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
#endif
|
||||
float fragDepth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
|
||||
float fragDepth = textureLod(u_gbufferDepthTexture, v_position2f2, 0.0).r;
|
||||
|
||||
if(fragDepth < 0.000001) {
|
||||
return;
|
||||
}
|
||||
|
||||
vec4 fragClipSpacePos4f = vec4(v_position2f, fragDepth, 1.0) * 2.0 - 1.0;
|
||||
vec4 fragClipSpacePos4f = vec4(v_position2f2, fragDepth, 1.0) * 2.0 - 1.0;
|
||||
vec4 fragPos4f = u_inverseViewProjMatrix4f * fragClipSpacePos4f;
|
||||
fragPos4f.xyz /= fragPos4f.w;
|
||||
fragPos4f.w = 1.0;
|
||||
|
@ -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.2.1",
|
||||
"vers": "1.2.2",
|
||||
"author": "lax1dude",
|
||||
"api_vers": 1,
|
||||
"features": [
|
||||
|
@ -70,7 +70,7 @@ void main() {
|
||||
originalViewSpacePos.xyz /= originalViewSpacePos.w;
|
||||
originalViewSpacePos.w = 1.0;
|
||||
|
||||
vec4 noiseVec = textureLod(u_noiseConstantTexture, u_randomizerDataMatrix2f * (v_position2f + originalViewSpacePos.xy + normal3f.xz), 0.0);
|
||||
vec4 noiseVec = textureLod(u_noiseConstantTexture, 13.3725 / fract((u_randomizerDataMatrix2f * (v_position2f * 0.42695346 + originalViewSpacePos.xy * 1.373769945645 + normal3f.xz * 42.69456453)) * 1.123234234), 0.0);
|
||||
noiseVec.xyz *= 2.0;
|
||||
noiseVec.xyz -= 1.0;
|
||||
|
||||
|
@ -107,22 +107,23 @@ void main() {
|
||||
#else
|
||||
vec4 color = u_color4f;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef COMPILE_ENABLE_TEX_GEN
|
||||
vec4 tmpVec4 = vec4(v_objectPosition3f, 1.0);
|
||||
vec4 texGenVector;
|
||||
|
||||
vec4 texGenPosSrc[2];
|
||||
texGenPosSrc[0] = vec4(v_objectPosition3f, 1.0);
|
||||
texGenPosSrc[1] = v_position4f;
|
||||
|
||||
texGenVector.x = dot(texGenPosSrc[u_texGenPlane4i.x], u_texGenS4f);
|
||||
texGenVector.y = dot(texGenPosSrc[u_texGenPlane4i.y], u_texGenT4f);
|
||||
texGenVector.z = dot(texGenPosSrc[u_texGenPlane4i.z], u_texGenR4f);
|
||||
texGenVector.w = dot(texGenPosSrc[u_texGenPlane4i.w], u_texGenQ4f);
|
||||
|
||||
texGenVector = u_textureMat4f01 * texGenVector;
|
||||
color *= texture(u_samplerTexture, texGenVector.xy / texGenVector.w);
|
||||
|
||||
texGenVector.x = dot(u_texGenPlane4i.x == 1 ? v_position4f : tmpVec4, u_texGenS4f);
|
||||
texGenVector.y = dot(u_texGenPlane4i.y == 1 ? v_position4f : tmpVec4, u_texGenT4f);
|
||||
texGenVector.z = dot(u_texGenPlane4i.z == 1 ? v_position4f : tmpVec4, u_texGenR4f);
|
||||
texGenVector.w = dot(u_texGenPlane4i.w == 1 ? v_position4f : tmpVec4, u_texGenQ4f);
|
||||
texGenVector.xyz = mat4x3(
|
||||
u_textureMat4f01[0].xyw,
|
||||
u_textureMat4f01[1].xyw,
|
||||
u_textureMat4f01[2].xyw,
|
||||
u_textureMat4f01[3].xyw
|
||||
) * texGenVector;
|
||||
|
||||
color *= texture(u_samplerTexture, texGenVector.xy / texGenVector.z);
|
||||
|
||||
#ifdef COMPILE_ENABLE_ALPHA_TEST
|
||||
if(color.a < u_alphaTestRef1f) discard;
|
||||
#endif
|
||||
|
98
sources/resources/assets/eagler/glsl/gles2_compat.glsl
Normal file
98
sources/resources/assets/eagler/glsl/gles2_compat.glsl
Normal file
@ -0,0 +1,98 @@
|
||||
#line 2 6969
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef EAGLER_HAS_GLES_300
|
||||
|
||||
// For GLES 3.00+ (WebGL 2.0)
|
||||
#ifdef EAGLER_IS_VERTEX_SHADER
|
||||
|
||||
// Vertex Shaders:
|
||||
#define EAGLER_VSH_LAYOUT_BEGIN()
|
||||
#define EAGLER_VSH_LAYOUT_END()
|
||||
#define EAGLER_IN(_loc, _type, _name) layout(location = _loc) in _type _name;
|
||||
#define EAGLER_IN_AUTO(_type, _name) in _type _name;
|
||||
#define EAGLER_OUT(_type, _name) out _type _name;
|
||||
#define EAGLER_VERT_POSITION gl_Position
|
||||
|
||||
#else
|
||||
#ifdef EAGLER_IS_FRAGMENT_SHADER
|
||||
|
||||
// Fragment Shaders:
|
||||
#define EAGLER_IN(_type, _name) in _type _name;
|
||||
#define EAGLER_FRAG_COLOR eagler_FragColor
|
||||
#define EAGLER_FRAG_DEPTH gl_FragDepth
|
||||
|
||||
#define EAGLER_FRAG_OUT() layout(location = 0) out vec4 EAGLER_FRAG_COLOR;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// All Shaders:
|
||||
|
||||
#define EAGLER_TEXTURE_2D(tex, coord2f) texture(tex, coord2f)
|
||||
#define EAGLER_TEXTURE_2D_LOD(_tex, _coord2f, _lod1f) textureLod(_tex, _coord2f, _lod1f)
|
||||
#define EAGLER_HAS_TEXTURE_2D_LOD
|
||||
|
||||
|
||||
#else
|
||||
#ifdef EAGLER_HAS_GLES_200
|
||||
|
||||
// For GLES 2.00 (WebGL 1.0)
|
||||
#ifdef EAGLER_IS_VERTEX_SHADER
|
||||
|
||||
// Vertex Shaders:
|
||||
#define EAGLER_VSH_LAYOUT_BEGIN()
|
||||
#define EAGLER_VSH_LAYOUT_END()
|
||||
#define EAGLER_IN(_loc, _type, _name) attribute _type _name;
|
||||
#define EAGLER_IN_AUTO(_type, _name) attribute _type _name;
|
||||
#define EAGLER_OUT(_type, _name) varying _type _name;
|
||||
#define EAGLER_VERT_POSITION gl_Position
|
||||
|
||||
#else
|
||||
#ifdef EAGLER_IS_FRAGMENT_SHADER
|
||||
|
||||
// Fragment Shaders:
|
||||
#define EAGLER_IN(_type, _name) varying _type _name;
|
||||
#define EAGLER_FRAG_COLOR gl_FragColor
|
||||
// TODO: Must require EXT_frag_depth to use this on GLES 2.0 (currently not needed)
|
||||
#define EAGLER_FRAG_DEPTH gl_FragDepth
|
||||
|
||||
#define EAGLER_FRAG_OUT()
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// All Shaders:
|
||||
|
||||
#define EAGLER_TEXTURE_2D(_tex, _coord2f) texture2D(_tex, _coord2f)
|
||||
|
||||
#ifdef EAGLER_HAS_GLES_200_SHADER_TEXTURE_LOD
|
||||
#define EAGLER_TEXTURE_2D_LOD(_tex, _coord2f, _lod1f) texture2DLodEXT(_tex, _coord2f, _lod1f)
|
||||
#define EAGLER_HAS_TEXTURE_2D_LOD
|
||||
#else
|
||||
// Beware!
|
||||
#define EAGLER_TEXTURE_2D_LOD(_tex, _coord2f, _lod1f) texture2D(_tex, _coord2f)
|
||||
#define EAGLER_HAS_TEXTURE_2D_LOD
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error Unable to determine API version! (Missing directive EAGLER_HAS_GLES_200 or 300)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#line 1 0
|
55
sources/resources/assets/eagler/glsl/hw_fingerprint.fsh
Normal file
55
sources/resources/assets/eagler/glsl/hw_fingerprint.fsh
Normal file
@ -0,0 +1,55 @@
|
||||
#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.
|
||||
*
|
||||
*/
|
||||
|
||||
EAGLER_IN(vec2, v_position2f)
|
||||
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
uniform sampler2D u_inputTexture;
|
||||
uniform mat4 u_textureMatrix;
|
||||
|
||||
vec2 rand(in vec2 co){
|
||||
float f = dot(co, vec2(12.98984576, 78.23378678));
|
||||
return fract(vec2(sin(f + 0.32490982), cos(f - 0.69890)) * 43758.54576873);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 coords4f = vec4(v_position2f.x * 0.25 - 0.125, v_position2f.y * 0.25 - 0.125, v_position2f.y * 10.0 - 9.0, 1.0);
|
||||
coords4f = u_textureMatrix * coords4f;
|
||||
coords4f.xy /= coords4f.w;
|
||||
EAGLER_FRAG_COLOR = EAGLER_TEXTURE_2D(u_inputTexture, coords4f.xy * 0.5 + 0.5);
|
||||
EAGLER_FRAG_COLOR.rg += rand(v_position2f * 1.2344574345) * 0.05;
|
||||
EAGLER_FRAG_COLOR.ba -= rand(v_position2f * 1.2343525225) * 0.05;
|
||||
EAGLER_FRAG_COLOR.a = fract(sin(dot(coords4f.yz, vec2(12.9898, 78.233))) * 43758.5453);
|
||||
EAGLER_FRAG_COLOR.a += exp(length(rand(coords4f.xw)) * -69.420);
|
||||
EAGLER_FRAG_COLOR = pow(EAGLER_FRAG_COLOR, vec4(1.0 / 2.423952));
|
||||
EAGLER_FRAG_COLOR = pow(EAGLER_FRAG_COLOR, vec4(5.4523856));
|
||||
EAGLER_FRAG_COLOR += 0.00004423 + EAGLER_FRAG_COLOR.a * 0.02;
|
||||
EAGLER_FRAG_COLOR = sqrt(EAGLER_FRAG_COLOR);
|
||||
EAGLER_FRAG_COLOR = pow(EAGLER_FRAG_COLOR, vec4(1.0 / 1.9023576));
|
||||
#ifdef EAGLER_HAS_GLES_300
|
||||
EAGLER_FRAG_COLOR.ra += tanh(fract(EAGLER_FRAG_COLOR.a * 32.324834)) * 0.1012426;
|
||||
#endif
|
||||
EAGLER_FRAG_COLOR.b *= 0.934924;
|
||||
EAGLER_FRAG_COLOR.b += (1.23213 / inversesqrt(EAGLER_FRAG_COLOR.a)) * 0.156365;
|
||||
EAGLER_FRAG_COLOR.ga += rand(gl_FragCoord.xy) * 0.13423567;
|
||||
EAGLER_FRAG_COLOR.rb += gl_PointCoord * 0.0124264565;
|
||||
#ifdef EAGLER_HAS_GLES_300
|
||||
EAGLER_FRAG_COLOR *= 0.95234 + asinh(EAGLER_FRAG_COLOR.g * 5.23423) * 0.0254325;
|
||||
#endif
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,15 +16,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision highp float;
|
||||
precision lowp sampler2D;
|
||||
EAGLER_VSH_LAYOUT_BEGIN()
|
||||
EAGLER_IN(0, vec2, a_position2f)
|
||||
EAGLER_VSH_LAYOUT_END()
|
||||
|
||||
layout(location = 0) in vec2 a_position2f;
|
||||
|
||||
out vec2 v_position2f;
|
||||
EAGLER_OUT(vec2, v_position2f)
|
||||
|
||||
void main() {
|
||||
v_position2f = a_position2f * 0.5 + 0.5;
|
||||
gl_Position = vec4(a_position2f, 0.0, 1.0);
|
||||
EAGLER_VERT_POSITION = vec4(a_position2f, 0.0, 1.0);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
#line 2
|
||||
|
||||
// Remove this line below if you plan to modify this file
|
||||
#ifndef EAGLER_IS_GLES_200
|
||||
#define USE_OPTIMIZED
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -52,14 +54,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision mediump float;
|
||||
precision mediump sampler2D;
|
||||
EAGLER_IN(vec2, v_position2f)
|
||||
|
||||
|
||||
in vec2 v_position2f;
|
||||
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
uniform sampler2D u_screenTexture;
|
||||
uniform vec2 u_screenSize2f;
|
||||
@ -110,7 +107,7 @@ uniform vec2 u_screenSize2f;
|
||||
#define FxaaTex sampler2D
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#define FxaaTexTop(t, p) textureLod(t, p, 0.0)
|
||||
#define FxaaTexTop(t, p) EAGLER_TEXTURE_2D_LOD(t, p, 0.0)
|
||||
|
||||
/*============================================================================
|
||||
GREEN AS LUMA OPTION SUPPORT FUNCTION
|
||||
@ -298,7 +295,7 @@ void main(){
|
||||
rcpFrameOpt.xy = -screenSize05;
|
||||
rcpFrameOpt.zw = screenSize05;
|
||||
|
||||
output4f = vec4(FxaaPixelShader(v_position2f + screenSize05, posPos, u_screenTexture, rcpFrameOpt, rcpFrameOpt * 4.0, edgeSharpness, edgeThreshold, edgeThresholdMin).rgb, 1.0);
|
||||
EAGLER_FRAG_COLOR = vec4(FxaaPixelShader(v_position2f + screenSize05, posPos, u_screenTexture, rcpFrameOpt, rcpFrameOpt * 4.0, edgeSharpness, edgeThreshold, edgeThresholdMin).rgb, 1.0);
|
||||
}
|
||||
#else
|
||||
|
||||
@ -306,7 +303,6 @@ void main(){
|
||||
// Is it faster? Idfk, probably compiles faster at least, what matters it I tried
|
||||
|
||||
float _616;
|
||||
vec4 _617;
|
||||
|
||||
void main()
|
||||
{
|
||||
@ -317,14 +313,14 @@ void main()
|
||||
mediump vec4 _608;
|
||||
for(;;)
|
||||
{
|
||||
mediump vec3 _532 = textureLod(u_screenTexture, _611.xy, 0.0).xyz;
|
||||
mediump vec3 _532 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, _611.xy, 0.0).xyz;
|
||||
mediump float _536 = dot(_532 * _532, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625));
|
||||
mediump vec3 _540 = textureLod(u_screenTexture, _611.xw, 0.0).xyz;
|
||||
mediump vec3 _540 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, _611.xw, 0.0).xyz;
|
||||
mediump float _544 = dot(_540 * _540, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625));
|
||||
mediump vec3 _548 = textureLod(u_screenTexture, _611.zy, 0.0).xyz;
|
||||
mediump vec3 _556 = textureLod(u_screenTexture, _611.zw, 0.0).xyz;
|
||||
mediump vec3 _548 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, _611.zy, 0.0).xyz;
|
||||
mediump vec3 _556 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, _611.zw, 0.0).xyz;
|
||||
mediump float _560 = dot(_556 * _556, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625));
|
||||
mediump vec4 _390 = textureLod(u_screenTexture, _290, 0.0);
|
||||
mediump vec4 _390 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, _290, 0.0);
|
||||
mediump vec3 _564 = _390.xyz;
|
||||
mediump float _568 = dot(_564 * _564, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625));
|
||||
mediump float _397 = dot(_548 * _548, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625)) + 0.00260416674427688121795654296875;
|
||||
@ -347,8 +343,8 @@ void main()
|
||||
mediump vec2 _484 = (_612 * 4.0).zw;
|
||||
vec2 _615 = -hp_copy_481;
|
||||
mediump vec2 mp_copy_615 = _615;
|
||||
mediump vec4 _498 = textureLod(u_screenTexture, mp_copy_614 * _454 + _290, 0.0) + textureLod(u_screenTexture, _449 * _454 + _290, 0.0);
|
||||
mediump vec4 _505 = ((textureLod(u_screenTexture, mp_copy_615 * _484 + _290, 0.0) + textureLod(u_screenTexture, _481 * _484 + _290, 0.0)) * 0.25) + (_498 * 0.25);
|
||||
mediump vec4 _498 = EAGLER_TEXTURE_2D_LOD(u_screenTexture, mp_copy_614 * _454 + _290, 0.0) + EAGLER_TEXTURE_2D_LOD(u_screenTexture, _449 * _454 + _290, 0.0);
|
||||
mediump vec4 _505 = ((EAGLER_TEXTURE_2D_LOD(u_screenTexture, mp_copy_615 * _484 + _290, 0.0) + EAGLER_TEXTURE_2D_LOD(u_screenTexture, _481 * _484 + _290, 0.0)) * 0.25) + (_498 * 0.25);
|
||||
mediump float _576 = dot(_505.xyz * _505.xyz, vec3(0.2989999949932098388671875, 0.58700001239776611328125, 0.114000000059604644775390625));
|
||||
mediump vec4 _607;
|
||||
if ((_576 < _412) || (_576 > _409))
|
||||
@ -367,7 +363,7 @@ void main()
|
||||
_608 = _607;
|
||||
break;
|
||||
}
|
||||
output4f = vec4(_608.xyz, 1.0);
|
||||
EAGLER_FRAG_COLOR = vec4(_608.xyz, 1.0);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2023-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
|
||||
@ -16,14 +16,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision highp float;
|
||||
precision highp sampler2D;
|
||||
|
||||
in vec2 v_texCoords2f;
|
||||
EAGLER_IN(vec2, v_texCoords2f)
|
||||
|
||||
#ifndef COMPILE_BLIT_DEPTH
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
#endif
|
||||
|
||||
uniform sampler2D u_inputTexture;
|
||||
@ -40,8 +36,8 @@ void main() {
|
||||
uv2f = (floor(uv2f * u_pixelAlignmentSizes4f.xy) + u_pixelAlignmentOffset2f) * u_pixelAlignmentSizes4f.zw;
|
||||
#endif
|
||||
#ifndef COMPILE_BLIT_DEPTH
|
||||
output4f = textureLod(u_inputTexture, uv2f, u_textureLod1f);
|
||||
EAGLER_FRAG_COLOR = EAGLER_TEXTURE_2D_LOD(u_inputTexture, uv2f, u_textureLod1f);
|
||||
#else
|
||||
gl_FragDepth = textureLod(u_inputTexture, uv2f, u_textureLod1f).r;
|
||||
EAGLER_FRAG_DEPTH = EAGLER_TEXTURE_2D_LOD(u_inputTexture, uv2f, u_textureLod1f).r;
|
||||
#endif
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2023-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
|
||||
@ -16,13 +16,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision lowp float;
|
||||
precision lowp sampler2D;
|
||||
EAGLER_VSH_LAYOUT_BEGIN()
|
||||
EAGLER_IN(0, vec2, a_position2f)
|
||||
EAGLER_VSH_LAYOUT_END()
|
||||
|
||||
layout(location = 0) in vec2 a_position2f;
|
||||
|
||||
out vec2 v_texCoords2f;
|
||||
EAGLER_OUT(vec2, v_texCoords2f)
|
||||
|
||||
uniform vec4 u_srcCoords4f;
|
||||
uniform vec4 u_dstCoords4f;
|
||||
@ -30,5 +28,5 @@ uniform vec4 u_dstCoords4f;
|
||||
void main() {
|
||||
vec2 uv = a_position2f * 0.5 + 0.5;
|
||||
v_texCoords2f = u_srcCoords4f.xy + u_srcCoords4f.zw * uv;
|
||||
gl_Position = vec4(u_dstCoords4f.xy + u_dstCoords4f.zw * uv, 0.0, 1.0);
|
||||
EAGLER_VERT_POSITION = vec4(u_dstCoords4f.xy + u_dstCoords4f.zw * uv, 0.0, 1.0);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#line 2
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2022-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
|
||||
@ -16,13 +16,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
precision lowp int;
|
||||
precision highp float;
|
||||
precision highp sampler2D;
|
||||
EAGLER_IN(vec2, v_position2f)
|
||||
|
||||
in vec2 v_position2f;
|
||||
|
||||
layout(location = 0) out vec4 output4f;
|
||||
EAGLER_FRAG_OUT()
|
||||
|
||||
uniform sampler2D u_inputTexture;
|
||||
uniform float u_textureLod1f;
|
||||
@ -32,6 +28,6 @@ uniform mat3 u_matrixTransform;
|
||||
|
||||
void main() {
|
||||
vec3 coords = u_matrixTransform * vec3(v_position2f, 1.0);
|
||||
vec4 color4f = textureLod(u_inputTexture, coords.xy, u_textureLod1f);
|
||||
output4f = color4f * u_blendFactor4f + u_blendBias4f;
|
||||
vec4 color4f = EAGLER_TEXTURE_2D_LOD(u_inputTexture, coords.xy, u_textureLod1f);
|
||||
EAGLER_FRAG_COLOR = color4f * u_blendFactor4f + u_blendBias4f;
|
||||
}
|
||||
|
Reference in New Issue
Block a user