Facepunch / garrysmod-requests

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

HDR static prop lightmaps (RGBA16161616f PPL/`-dumppropmaps` PFM files) #2464

Open piqey opened 1 week ago

piqey commented 1 week ago

Details

Source SDK 2013 Multiplayer (and Garry's Mod) support static prop lightmaps in the form of RGB888 (24-bit SDR) PPL files. According to the VDC Wiki's page on VertexLitGeneric's $lightmap VMT parameter:

image

VRAD ought to be modified to compile static prop lightmaps to RGBA16161616f to support HDR lighting for maps that use it as most already do.

If Garry's Mod supports conditional statements in VMT files like I believe it does, VRAD could generate both LDR and HDR lightmaps for static props, swapping between them depending on which lighting mode is loaded at runtime. An example VMT could look something like this (untested):

"VertexLitGeneric"
{
    $basetexture            "mybasetexture"

    $lightmap                "lightmap/path"
    "HDR?$lightmap"    "lightmap/path_hdr"
}

Will reference issues #2109, #517 and #2441 for posterity.

piqey commented 5 days ago

Come to think of it, I'm starting to think PPL may not use custom-generated/BSP-packed VMT files to mount like env_cubemaps do on brush faces, so the syntax above may be completely useless for any situation other than manually including lightmaps via those dumped via vrad.exe executed with -dumppropmaps (RGBA16161616f lightmaps would need to be dumped as .pfm instead as .tga I believe).