InsanityBringer / PiccuEngine

Descent 3: Piccu Engine, a version of the game Descent 3 focused on quality-of-life improvements.
GNU General Public License v3.0
109 stars 7 forks source link

[REQUEST] Raise the LOD for models #27

Open Sol1vaN opened 4 months ago

Sol1vaN commented 4 months ago

Always I noticed that the LOD are incredibly low (in original descent 3: 1.4 and 1.5). and this limitation still present in PE. Check the video: https://youtu.be/t7WmK54YCkk

Can you raise this limit? But taking care of not affect the performance, obviously. 😋

Glowhyena commented 4 months ago

Yeah, that will be nice. It's distracting as well.

JeodC commented 4 months ago

The lod calculations for models is performed in renderobject.cpp around L1278. My first pass on lod changed that if statement to just remove the calculation steps:

    // Pick a lod model to use if eligible
    if (obj->lighting_render_type == LRT_STATIC || obj->lighting_render_type == LRT_GOURAUD) {
          if (obj->type == OBJ_POWERUP || obj->type == OBJ_ROBOT || obj->type == OBJ_CLUTTER) {
            model_num = obj->rtype.pobj_info.model_num; // Always use the highest detail model
          } 
      else if (obj->type == OBJ_MARKER) {
            model_num = Marker_polynum;
          } 
      else if (obj->type == OBJ_PLAYER && !(Players[obj->id].flags & (PLAYER_FLAGS_DYING | PLAYER_FLAGS_DEAD))) {
            model_num = obj->rtype.pobj_info.model_num; // Always use the highest detail model
          } 
      else {
            model_num = obj->rtype.pobj_info.model_num;
          }
      } 
    else {
            model_num = obj->rtype.pobj_info.model_num;
    }
    if (obj->type == OBJ_BUILDING && obj->flags & OF_USE_DESTROYED_POLYMODEL) {
          model_num = obj->rtype.pobj_info.model_num; // Always use the highest detail model
    }

But looking at it again while writing this, I'm questioning if this conditional is even necessary or if object models are loaded at their highest poly count at render time, thus eliminating the need for this check.