[renderer] Handle transparent surfaces

Other than the view model (undecided on the approach) this has
R_RenderView pretty much pulled out of the low level renderers. With
this, I'll be able to focus on scene handling for a bit then getting
shadows and fisheye working (again for fisheye).
This commit is contained in:
Bill Currie 2022-03-18 00:14:48 +09:00
parent c05476f94b
commit 2b72506868
8 changed files with 28 additions and 2 deletions

View file

@ -111,6 +111,7 @@ typedef struct vid_render_funcs_s {
void (*render_view) (void);
void (*draw_entities) (struct entqueue_s *queue);
void (*draw_particles) (struct psystem_s *psystem);
void (*draw_transparent) (void);
void (*set_2d) (int scaled);
void (*end_frame) (void);

View file

@ -320,7 +320,6 @@ R_RenderScene (void)
gl_R_DrawWorld (); // adds static entities to the list
S_ExtraUpdate (); // don't let sound get messed up if going slow
gl_R_RenderDlights ();
gl_R_DrawWaterSurfaces ();
R_DrawViewModel ();
gl_Fog_DisableGFog ();

View file

@ -172,7 +172,6 @@ glsl_R_RenderView (void)
R_SetupView ();
glsl_R_DrawWorld ();
glsl_R_DrawSky ();
glsl_R_DrawWaterSurfaces ();
R_DrawViewModel ();
}

View file

@ -212,6 +212,7 @@ SCR_UpdateScreen (transform_t *camera, double realtime, SCR_Func *scr_funcs)
r_funcs->render_view ();
r_funcs->draw_entities (r_ent_queue);
r_funcs->draw_particles (&r_psystem);
r_funcs->draw_transparent ();
r_funcs->set_2d (0);
view_draw (r_data->scr_view);
r_funcs->set_2d (1);

View file

@ -262,6 +262,12 @@ gl_render_view (void)
gl_R_RenderView ();
}
static void
gl_draw_transparent (void)
{
gl_R_DrawWaterSurfaces ();
}
static void
gl_set_2d (int scaled)
{
@ -330,6 +336,7 @@ vid_render_funcs_t gl_vid_render_funcs = {
gl_render_view,
gl_R_RenderEntities,
gl_R_DrawParticles,
gl_draw_transparent,
gl_set_2d,
gl_end_frame,
&model_funcs

View file

@ -220,6 +220,12 @@ glsl_render_view (void)
glsl_R_RenderView ();
}
static void
glsl_draw_transparent (void)
{
glsl_R_DrawWaterSurfaces ();
}
static void
glsl_set_2d (int scaled)
{
@ -274,6 +280,7 @@ vid_render_funcs_t glsl_vid_render_funcs = {
glsl_render_view,
glsl_R_RenderEntities,
glsl_R_DrawParticles,
glsl_draw_transparent,
glsl_set_2d,
glsl_end_frame,
&model_funcs

View file

@ -144,6 +144,11 @@ sw_render_view (void)
R_RenderView ();
}
static void
sw_draw_transparent (void)
{
}
static void
sw_set_2d (int scaled)
{
@ -218,6 +223,7 @@ vid_render_funcs_t sw_vid_render_funcs = {
sw_render_view,
R_DrawEntitiesOnList,
R_DrawParticles,
sw_draw_transparent,
sw_set_2d,
sw_end_frame,
&model_funcs

View file

@ -303,6 +303,11 @@ vulkan_draw_particles (struct psystem_s *psystem)
{
}
static void
vulkan_draw_transparent (void)
{
}
static void
vulkan_set_2d (int scaled)
{
@ -688,6 +693,7 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
vulkan_render_view,
vulkan_draw_entities,
vulkan_draw_particles,
vulkan_draw_transparent,
vulkan_set_2d,
vulkan_end_frame,
&model_funcs