Skip to content

Add IMaterial:SetFloat4( x, y, z, w ) #2606

@Srlion

Description

@Srlion

Details

Having this function can save performance on really simple shaders by avoiding the round trips between Lua and C++, as it will only be two trip from 8 trips.

mat:SetFloat4("$c0", 1, 1, 1, 1) -- two C calls as mat.__index is a C one

vs

-- 8 C Calls
mat:SetFloat("$c0_x", 1)
mat:SetFloat("$c0_y", 1)
mat:SetFloat("$c0_z", 1)
mat:SetFloat("$c0_w", 1)

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