Facepunch / garrysmod-requests

Feature requests for Garry's Mod
85 stars 24 forks source link

$envmaplightscale for models and brushes #1939

Open TiberiumFusion opened 2 years ago

TiberiumFusion commented 2 years ago

This is a very useful Alien Swarm addition for brushes. It was later extended in CSGO to models using VertexLitGeneric.

$envmaplightscale is one method for solving the (really ugly) issue of envmap brushes and models displaying their specular reflections at constant brightness, even when the ambient light level is scaled. This is most noticeable when using day/night cycle addons, or when simply carrying a reflective prop into a dark room that (incorrectly) uses a outdoor cubemap (i.e. the thousands of maps that don't use env_cubemap entities).

Technically, it is extremely simple, cheap as dirt, and should fit without problems into the existing ps2x and ps30 shader combos. Alien Swarm packs $envmaplightscale into the POM shader params, which don't exist in gmod (or do they?), but it should be trivial to fit in another param for this. The VertexLitGeneric implementation might be more complicated. I don't have the csgo sdk so I don't know.

I am only filing this request since rubat has added csgo features to gmod in the past. Since he has proven he has some kind of access to the csgo sdk, it seems like this request could be easy as copy and paste.

robotboy655 commented 1 year ago

Partially fulfilled, for LightmappedGeneric shader.