slightly faster bilinear interpolation #33

Merged
embeddedt merged 4 commits from rdh/celeritas:ao-better into stonecutter 2026-08-18 20:00:03 -04:00
Showing only changes of commit 5422aef329 - Show all commits
@@ -60,16 +60,15 @@ void main() {
gl_Position = u_ProjectionMatrix * u_ModelViewMatrix * vec4(position, 1.0);
// Add the light color to the vertex color, and pass the texture coordinates to the fragment shader
v_RdhFactor = _vert_rdh_factor * 2.0;
#ifdef CELERITAS_NO_LIGHTMAP
v_Color = _vert_color;
#else
vec4 lightColor = _sample_lightmap(u_LightTex, _vert_tex_light_coord);
v_Color = _vert_color * lightColor;
#endif
v_RdhFactor = _vert_rdh_factor * 2.0;
#ifndef CELERITAS_NO_LIGHTMAP
v_RdhFactor.rgb *= lightColor.rgb;
#endif
int corner = gl_VertexID & 3;
v_QuadCoord = vec2(corner >= 2 ? 1.0 : 0.0,
corner == 1 || corner == 2 ? 1.0 : 0.0);