X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2F3dengfx%2Fsrc%2F3dengfx%2F3dscene.cpp;h=e2f896d1112d9a7d446f116f73255a72d07347ef;hb=162f332d3fa951c47341509086eb29d066c37590;hp=de49021baa0875454228f27dc218e2c3dcfef8ec;hpb=c836652e73bd59867e9ee0e8d6c1322623e47e1d;p=summerhack diff --git a/src/3dengfx/src/3dengfx/3dscene.cpp b/src/3dengfx/src/3dengfx/3dscene.cpp index de49021..e2f896d 100644 --- a/src/3dengfx/src/3dengfx/3dscene.cpp +++ b/src/3dengfx/src/3dengfx/3dscene.cpp @@ -532,35 +532,23 @@ bool Scene::render_all_cube_maps(unsigned long msec) const { while(iter != objects.end()) { Object *obj = *iter++; - Texture *env; Material *mat = obj->get_material_ptr(); + Texture *env = mat->get_texture(TEXTYPE_ENVMAP); + if(!env || env->get_type() != TEX_CUBE) continue; + RenderParams rp = obj->get_render_params(); if(rp.hidden) continue; // if it is marked as a non-automatically updated reflection map, skip it. - if(!mat->auto_refl) { - continue; + if(mat->auto_refl) { + if(mat->auto_refl_upd > 1 && frame_count % mat->auto_refl_upd) continue; + } else { + if(!first_render) continue; } - // if auto-reflect is set for updating every nth frame, - // and this is not one of them, skip it. - if(mat->auto_refl_upd > 1 && frame_count % mat->auto_refl_upd) { - continue; - } - - // if auto-reflect is set to update only during the first frame, - // and this is not the first frame, skip it. - if(mat->auto_refl_upd == 0 && !first_render) { - continue; - } - // ... otherwise, update the reflection in the cubemap. - if((env = mat->get_texture(TEXTYPE_ENVMAP))) { - if(env->get_type() == TEX_CUBE) { - did_some = true; - render_cube_map(obj, msec); - } - } + did_some = true; + render_cube_map(obj, msec); } return did_some;