Skip to content

Update material uniforms by index instead of string name #948

Open
@nithinp7

Description

@nithinp7

We can use InitializeScalarParameterAndGetIndex instead of SetScalaraParamaterByInfo (similar replacement for vector paramaters) when initializing the uniforms on Unreal materials, this lets us save the uniform indices. Later, when updating the uniforms, we can use SetScalarParamaterByIndex which will be faster than updating by name. Doing so might avoid a temporary string allocation (I think) and definitely avoids an internal string lookup within Unreal.

Currently we only update uniforms for raster overlays that are changed / updated. Soon we will be updating a "dither fade percentage" uniform value regularly for dithered LOD transitions. This is not the biggest performance bottleneck, but it is a small thing worth improving when we get a chance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceImprovements to performance, including reductions in memory usage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions