Skip to content

forceLod does not reach instanced or raytracing geometry #41

Description

@cppctamber

Status:
Consitancy question.

Source version:
Carbon v5.0.0, commit 342fbe5

Notes:
Established from the code paths only as I have no runnable Carbon build, so I could not confirm the visible effect in a client.

Source
TriGeometryRes::GetLodIndexForScreenSize honours a debug override before searching:

if( m_forceLod && m_forcedLodIndex >= 0 )
{
    return int( std::min( m_forcedLodIndex, lastLod ) );
}

Description
forceLod and forcedLodIndex are editable attributes (TriGeometryRes_Blue.cpp:44). Two other sites select a LOD by screen size without consulting it : EveInstancedMeshManager::GetMeshLod (:971) and the raytracing path in EveChildInstancedMeshes (:134-141), which open-codes the search inline. Both read the same thresholds, copied verbatim from m_lods[lod]->m_maxScreenSize (EveInstancedMeshManager.cpp:250 and :312, EveChildInstancedMeshes.cpp:314).

With forceLod on, non-instanced geometry pins to forcedLodIndex while instanced and raytracing geometry keeps selecting by screen size, so the override appears not to work for instanced content. That the searches agree on everything else suggests the copies were meant to match GetLodIndexForScreenSize and just missed the override.

Related: GetMeshLod(ix, 0) and GetMeshLod(ix, 0.f) bind to different overloads with opposite meanings (LOD index 0 = best detail, screen size 0.f = worst). Both forms appear in the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions