From 6b736e28ca1aec9057a648fe06522cbbba88ac7d Mon Sep 17 00:00:00 2001 From: dashodanger Date: Thu, 21 Nov 2024 19:13:17 -0700 Subject: [PATCH] Tweak previous render_view RGB work --- source_files/edge/r_colormap.cc | 3 --- source_files/edge/r_render.cc | 30 +++++++++++++++--------------- source_files/edge/r_shader.cc | 12 ++++++------ 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/source_files/edge/r_colormap.cc b/source_files/edge/r_colormap.cc index 6f44c45a..44941661 100644 --- a/source_files/edge/r_colormap.cc +++ b/source_files/edge/r_colormap.cc @@ -654,9 +654,6 @@ class ColormapShader : public AbstractShader { RendererVertex *dest = glvert + v_idx; - dest->rgba_color[0] *= render_view_red_multiplier; - dest->rgba_color[1] *= render_view_green_multiplier; - dest->rgba_color[2] *= render_view_blue_multiplier; dest->rgba_color[3] = alpha; HMM_Vec3 lit_pos; diff --git a/source_files/edge/r_render.cc b/source_files/edge/r_render.cc index 655d800f..8beed233 100644 --- a/source_files/edge/r_render.cc +++ b/source_files/edge/r_render.cc @@ -549,15 +549,15 @@ static void WallCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, float *rgb, HMM_Vec if (swirl_pass > 1) { - rgb[0] = 1.0 / data->R; - rgb[1] = 1.0 / data->G; - rgb[2] = 1.0 / data->B; + rgb[0] = 1.0 / data->R * render_view_red_multiplier; + rgb[1] = 1.0 / data->G * render_view_green_multiplier; + rgb[2] = 1.0 / data->B * render_view_blue_multiplier; } else { - rgb[0] = data->R; - rgb[1] = data->G; - rgb[2] = data->B; + rgb[0] = data->R * render_view_red_multiplier; + rgb[1] = data->G * render_view_green_multiplier; + rgb[2] = data->B * render_view_blue_multiplier; } float along; @@ -619,15 +619,15 @@ static void PlaneCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, float *rgb, HMM_Ve if (swirl_pass > 1) { - rgb[0] = 1.0 / data->R; - rgb[1] = 1.0 / data->G; - rgb[2] = 1.0 / data->B; + rgb[0] = 1.0 / data->R * render_view_red_multiplier; + rgb[1] = 1.0 / data->G * render_view_green_multiplier; + rgb[2] = 1.0 / data->B * render_view_blue_multiplier; } else { - rgb[0] = data->R; - rgb[1] = data->G; - rgb[2] = data->B; + rgb[0] = data->R * render_view_red_multiplier; + rgb[1] = data->G * render_view_green_multiplier; + rgb[2] = data->B * render_view_blue_multiplier; } HMM_Vec2 rxy = {{(data->tx0 + pos->X), (data->ty0 + pos->Y)}}; @@ -1695,9 +1695,9 @@ static void FloodCoordFunc(void *d, int v_idx, HMM_Vec3 *pos, float *rgb, HMM_Ve *pos = data->vertices[v_idx]; *normal = data->normal; - rgb[0] = data->R; - rgb[1] = data->G; - rgb[2] = data->B; + rgb[0] = data->R * render_view_red_multiplier; + rgb[1] = data->G * render_view_green_multiplier; + rgb[2] = data->B * render_view_blue_multiplier; float along = (view_z - data->plane_h) / (view_z - pos->Z); diff --git a/source_files/edge/r_shader.cc b/source_files/edge/r_shader.cc index 1e1788ba..7ccd3722 100644 --- a/source_files/edge/r_shader.cc +++ b/source_files/edge/r_shader.cc @@ -357,9 +357,9 @@ class dynlight_shader_c : public AbstractShader float ity = exp(-5.44 * dist * dist); - dest->rgba_color[0] = R * ity * render_view_red_multiplier; - dest->rgba_color[1] = G * ity * render_view_green_multiplier; - dest->rgba_color[2] = B * ity * render_view_blue_multiplier; + dest->rgba_color[0] = R * ity; + dest->rgba_color[1] = G * ity; + dest->rgba_color[2] = B * ity; dest->rgba_color[3] = alpha; } @@ -540,9 +540,9 @@ class plane_glow_c : public AbstractShader TexCoord(&dest->texture_coordinates[1], WhatRadius(DL), sec, &lit_pos, &dest->normal); - dest->rgba_color[0] = R * render_view_red_multiplier; - dest->rgba_color[1] = G * render_view_green_multiplier; - dest->rgba_color[2] = B * render_view_blue_multiplier; + dest->rgba_color[0] = R; + dest->rgba_color[1] = G; + dest->rgba_color[2] = B; dest->rgba_color[3] = alpha; }