Facepunch / garrysmod-requests

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

render.HasEnvmaps -- Return if map has any envmaps or not #1779

Open Vuthakral opened 3 years ago

Vuthakral commented 3 years ago

Details

Obviously, the name is just a suggestion for its easy-to-find relevance to what it encompasses. But basically just a function to return whether the current loaded map has any environmen cubemaps in it or not.

"What the hell use does this have?"

I want to write a material proxy that tells a material to use a map's envmap, unless it doesn't exist in which case it will pull a fallback cubemap

Kinyom commented 3 years ago

There's technically already a way to check this - it's just convoluted and requires reading the current map's .bsp file. Until this is added, take a look here at some of the checks this (poorly-written, admittedly) code I wrote does: https://pastebin.com/gh2qJwit Should just require a bit of editing.