gfx: scene_render cleanup

main
Dominik Madarász 2024-04-12 19:53:46 +02:00
parent fd6b9ef639
commit b01ac27fca
3 changed files with 9 additions and 78 deletions

View File

@ -375859,24 +375859,12 @@ light_t* scene_index_light(unsigned light_index) {
return &last_scene->lights[light_index];
}
void scene_render(int flags) {
camera_t *cam = camera_get_active();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
if(flags & SCENE_BACKGROUND) {
if(last_scene->skybox.program) {
skybox_push_state(&last_scene->skybox, cam->proj, cam->view);
glDisable(GL_DEPTH_TEST);
// glDepthFunc(GL_LESS);
// glActiveTexture(GL_TEXTURE0);
// (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
// glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
mesh_render(&last_scene->skybox.geometry);
skybox_pop_state();
}
@ -375884,15 +375872,6 @@ void scene_render(int flags) {
ddraw_flush();
}
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
// @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both
(flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
// @todo alpha mode
// @todo texture mode
if( flags & SCENE_FOREGROUND ) {
bool do_relighting = 0;
for (unsigned j = 0; j < array_count(last_scene->lights); ++j) {
@ -375950,8 +375929,6 @@ void scene_render(int flags) {
}
glBindVertexArray(0);
}
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
#line 0

View File

@ -499,24 +499,12 @@ light_t* scene_index_light(unsigned light_index) {
return &last_scene->lights[light_index];
}
void scene_render(int flags) {
camera_t *cam = camera_get_active();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
if(flags & SCENE_BACKGROUND) {
if(last_scene->skybox.program) {
skybox_push_state(&last_scene->skybox, cam->proj, cam->view);
glDisable(GL_DEPTH_TEST);
// glDepthFunc(GL_LESS);
// glActiveTexture(GL_TEXTURE0);
// (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
// glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
mesh_render(&last_scene->skybox.geometry);
skybox_pop_state();
}
@ -524,15 +512,6 @@ void scene_render(int flags) {
ddraw_flush();
}
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
// @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both
(flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
// @todo alpha mode
// @todo texture mode
if( flags & SCENE_FOREGROUND ) {
bool do_relighting = 0;
for (unsigned j = 0; j < array_count(last_scene->lights); ++j) {
@ -590,6 +569,4 @@ void scene_render(int flags) {
}
glBindVertexArray(0);
}
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}

View File

@ -22946,24 +22946,12 @@ light_t* scene_index_light(unsigned light_index) {
return &last_scene->lights[light_index];
}
void scene_render(int flags) {
camera_t *cam = camera_get_active();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
if(flags & SCENE_BACKGROUND) {
if(last_scene->skybox.program) {
skybox_push_state(&last_scene->skybox, cam->proj, cam->view);
glDisable(GL_DEPTH_TEST);
// glDepthFunc(GL_LESS);
// glActiveTexture(GL_TEXTURE0);
// (flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
// glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
mesh_render(&last_scene->skybox.geometry);
skybox_pop_state();
}
@ -22971,15 +22959,6 @@ void scene_render(int flags) {
ddraw_flush();
}
glDepthFunc(GL_LESS);
glActiveTexture(GL_TEXTURE0);
// @fixme: CW ok for one-sided rendering. CCW ok for FXs. we need both
(flags & SCENE_CULLFACE ? glEnable : glDisable)(GL_CULL_FACE); glCullFace(GL_BACK); glFrontFace(GL_CCW);
glPolygonMode( GL_FRONT_AND_BACK, flags & SCENE_WIREFRAME ? GL_LINE : GL_FILL );
// @todo alpha mode
// @todo texture mode
if( flags & SCENE_FOREGROUND ) {
bool do_relighting = 0;
for (unsigned j = 0; j < array_count(last_scene->lights); ++j) {
@ -23037,8 +23016,6 @@ void scene_render(int flags) {
}
glBindVertexArray(0);
}
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
#line 0