move vec to generated

This commit is contained in:
Asuro
2025-03-30 19:45:48 +02:00
parent b006d14197
commit 052fc2cc07
16 changed files with 662 additions and 289 deletions

View File

@@ -9,7 +9,7 @@ SAMPLER2D(s_texColor, 0);
SAMPLER3D(s_ditherSampler, 1);
SAMPLER2D(s_rampSampler, 2);
uniform vec4 u_time;
uniform vec4 u_testColor;
uniform vec4 u_dotColor;
uniform vec4 u_texInfo;
uniform vec4 u_baseColor;
@@ -92,7 +92,7 @@ void main()
float testSpeed = 1.0;
vec3 testOffset = vec3(0.0, 0.0, 50.0);
float3 lightPos = vec3(sin(u_time.x * testSpeed) * testRadius, 5.0, cos(u_time.x * testSpeed) * testRadius);
vec3 texColor = u_testColor.x > 0.1 ? u_testColor.xyz : texture2D(s_texColor, v_uv0).xyz;
vec3 texColor = u_dotColor.x > 0.1 ? u_dotColor.xyz : texture2D(s_texColor, v_uv0).xyz;
// lighting
// float brightness = calcBrightness(lightPos, v_wpos, v_normal);

View File

@@ -9,7 +9,7 @@ SAMPLER2D(s_texColor, 0);
SAMPLER3D(s_ditherSampler, 1);
SAMPLER2D(s_rampSampler, 2);
uniform vec4 u_time;
uniform vec4 u_testColor;
uniform vec4 u_dotColor;
uniform vec4 u_texInfo;
uniform vec4 u_baseColor;
@@ -89,6 +89,7 @@ void main()
{
vec2 uv = vec2(1.0 - v_uv0.x, v_uv0.y);
vec3 rawTex = texture2D(s_texColor, uv).xyz;
vec3 col = rawTex * u_dotColor.xyz;
float brightness = lerp(0.5, 0.9, calcBrightnessDirectional(vec3(0.5, 0.3, 1.0), v_normal));
gl_FragColor = vec4(rawTex, 1.0);
gl_FragColor = vec4(col * brightness, 1.0);
}