Skip to content

EveChildCloud scales both screen-space axes using backbuffer width #38

Description

@cppctamber

Status:
Confirmed from source

Source version:
Carbon v5.0.0, commit 342fbe595b572070e09b583a03e215011f5924e9

Notes
I do not have a runnable Carbon build, so this was not reproduced at runtime.

Source
Eve/SpaceObject/Children/EveChildCloud.cpp:403-407:

unsigned w, h;
Tr2Renderer::GetBackBufferDimensions( w, h );
float x = ( box.m_max.x - box.m_min.x ) * w;
float y = ( box.m_max.y - box.m_min.y ) * w;      // :406 — w, likely should be h
float size = std::max( x, y ) / m_preTesselationLevel;

Description
Both extents are multiplied by the backbuffer width. h is fetched and never used — the only GetBackBufferDimensions call in the file.

The vertical term is converted to pixels using width rather than height, misweighting it by exactly w/h, so the tessellation level selected at :411-415 becomes aspect-ratio-dependent. The direction is not stated here because whether index buffer 0 is the finest or coarsest level is not established at this site.

Because h is an out-parameter passed by reference, it counts as used and no unused-variable warning fires.

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