Skip to content

Brush face texture x y scale (and potentially other data) should be exposed to shaders #1937

@AdamTadeusz

Description

@AdamTadeusz

Would it be possible to expose the brush face x y scale in the ShaderAPI or some other appropriate place? I'm working on a interior mapping shader where, to project a lightmap into a fake room, I need to calculate the direction vector in tangent space from a closest / strongest light origin to a projected pixel. I can calculate the vector from the light origin to a pixel on the surface of a brush and transform it into tangent space, but the vector from the texture corner to the pixel on the surface and from the texture corner to the projected pixel all have values between 0..1 as a fraction of the base texture. To convert these to hammer units, I can get the texture dimensions in the shader helper file and values of the $basetexturetransform material parameter, but the size of the texture also depends on the brush texture scale which is not available anywhere.

Image

Another reason why exposing this would benefit the modding community, Tony Sergi was working on porting a goldsrc feature to the source engine, and could not proceed because this data isn't exposed.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions