ValveSoftware / ValveSoftware/source-sdk-2013

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

Open
#1,937 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10k
Forks
3k
Avg merge
8d 11h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ShaderAPI and the brush-face texture coordinate data involved in shader access. Investigate where brush texture scale is represented and how existing shader parameters are exposed. Done means an interior-mapping shader can access the brush face x/y scale, with the appropriate shader-facing behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.