void render_map_liquid_transparent(void) { int n; map_liquid_type *liq; // common setup glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_DEPTH_TEST); glDepthMask(GL_FALSE); // draw transparent liquids for (n=0;n!=view.render->draw_list.count;n++) { if (view.render->draw_list.items[n].type==view_render_type_liquid) { liq=&map.liquid.liquids[view.render->draw_list.items[n].idx]; if (liquid_is_transparent(liq)) { liquid_render_liquid(liq); } } } glDisable(GL_BLEND); glDepthMask(GL_TRUE); }
void render_map_liquid_transparent(int tick) { int n; map_liquid_type *liq; // setup view gl_3D_view(); gl_3D_rotate(&view.render->camera.pnt,&view.render->camera.ang); gl_setup_project(); // setup drawing glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_NOTEQUAL,0); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glDepthMask(GL_FALSE); // draw transparent liquids for (n=0;n!=view.render->draw_list.count;n++) { if (view.render->draw_list.items[n].type==view_render_type_liquid) { liq=&map.liquid.liquids[view.render->draw_list.items[n].idx]; if (liquid_is_transparent(liq)) { liquid_render_liquid(tick,liq); } } } }
void render_map_liquid_opaque(void) { int n; map_liquid_type *liq; // common setup glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); // draw opaque liquids for (n=0;n!=view.render->draw_list.count;n++) { if (view.render->draw_list.items[n].type==view_render_type_liquid) { liq=&map.liquid.liquids[view.render->draw_list.items[n].idx]; if (!liquid_is_transparent(liq)) { liquid_render_liquid(liq); } } } }