stage1: fix background

Remove 45 degree uv rotation from the shader as it's not needed anymore.
Bring back the stretched perspective, because the background was
designed with it in mind, and looks wrong otherwise.
This commit is contained in:
Andrei Alexeyev 2021-01-03 10:04:58 +02:00
parent 7fa35409d8
commit a19ac828eb
3 changed files with 6 additions and 6 deletions

View file

@ -46,7 +46,7 @@ float warpedNoise(vec2 p) {
}
void main(void) {
vec2 uv = flip_native_to_bottomleft(texCoord - wave_offset) * rot(-pi/4);
vec2 uv = flip_native_to_bottomleft(texCoord - wave_offset);
float n = warpedNoise(uv * 4);
@ -60,7 +60,6 @@ void main(void) {
vec2 dnduv = inverse(duvdxy)*vec2(dndx,dndy)*0.15;
vec2 dnduv2 = dnduv * dnduv * 0.5;
uv = flip_native_to_bottomleft(texCoord);
uv += 0.25 * dnduv2;
uv = flip_bottomleft_to_native(uv);

View file

@ -65,6 +65,9 @@ void stage1_bg_init_fullstage(void) {
stage_3d_context.cam.near = 500;
stage_3d_context.cam.far = 10000;
// WARNING: Don't touch this unless know exactly what you're doing.
// The water positioning black magic doesn't look right without this stretching.
stage_3d_context.cam.aspect = (0.75f * VIEWPORT_W) / VIEWPORT_H;
INVOKE_TASK(animate_bg, draw_data);
}

View file

@ -163,8 +163,7 @@ static void stage1_water_draw(vec3 pos) {
}
if(pp_quality == 1) {
r_shader("stage1_water");
r_uniform_float("time", 0.5 * global.frames / (float)FPS);
r_shader_ptr(water_shader);
draw_framebuffer_tex(fbpair->front, VIEWPORT_W, VIEWPORT_H);
fbpair_swap(fbpair);
}
@ -177,8 +176,7 @@ static void stage1_water_draw(vec3 pos) {
r_framebuffer(bg_fb);
if(pp_quality > 1) {
r_shader("stage1_water");
r_uniform_float("time", 0.5 * global.frames / (float)FPS);
r_shader_ptr(water_shader);
} else {
r_shader_standard();
}