Facepunch / garrysmod-requests

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

$phong on Lightmappedgeneric reflects baked lights #2229

Open jolopapina opened 1 year ago

jolopapina commented 1 year ago

Details

Is it possible to make $phong on lightmappergeneric reflect baked lights as well?

piqey commented 2 months ago

Details

Is it possible to make $phong on lightmappergeneric reflect baked lights as well?

I know I can't add anything to Garry's Mod, but...

While it's not exactly phong on LightmappedGeneric, I've been doing this to get the effect I think you're looking for. A model with the same dimensions and $basetexture as the brush—just super flat, squashed onto it—but with a VertexLitGeneric version of the material using $translucent 1, $additive 1, $color2 [ 0 0 0 ]" and whatever $phong settings look best.

Here's what it looks like on the tile floors in my current mapping project:

https://github.com/user-attachments/assets/52b602bf-d7a0-4b48-9bb0-a8739e900862

Something I've found is that you do need to break up brushes into multiple models for this, as there appears to be a limit to how many light sources can affect a material shaded with phong. That is, if I made the entire floor a single model, it'd be limited to only a few light sources, rather than being able to split them into groups, increasing the total number of lights that can be included in the shading:

image

I wrote 4 here but it's probably more like 5 or 6; the point is that if it was all a single model it'd cap out and not all the light sources would be able to be displayed. This way, they can be grouped to the nearest model, allocating by proximity.