ruarai / CompilePal

A tool to assist in the compiling of source engine maps
GNU General Public License v3.0
220 stars 25 forks source link

Add parameter to build cubemaps more than once #185

Closed statecouncil closed 1 year ago

statecouncil commented 1 year ago

Is your feature request related to a problem? Please describe. TF2 (and other branches, I guess) requires reflections to be off when building cubemaps for the first time to avoid baking error textures into the vtfs. However, the buildcubemaps command can be run again (with mat_specular 1) once there are cubemaps, to add reflections. This overwrites the existing cubemap textures, so no file bloat, and adds more detail to them.

Describe the solution you'd like A parameter for the Cubemaps step that allows setting how often cubemaps should be "bounced". Default: 1.

Describe alternatives you've considered Building cubemaps manually, as described here https://tf2maps.net/threads/tutorial-building-cubemaps.16452/

Additional context This helps make large reflective surfaces more detailed and realistic, which is needed considering Source still doesn't have parallax-enhanced envmaps. Can provide comparison screenshots if required. Thank you so much for your work on CompilePal.

Exactol commented 1 year ago

I can look into this, but I'm currently freezing new feature development so I can release v28

granis48 commented 1 year ago

Adding on to this, there are situations where you might wanna run the same process more than once so adding this functionality for more/all processes could be useful for some people.

I recently compiled a map where VRAD would run out of memory when doing a -both compile so the fix was to run VRAD twice, once with -ldr and the other with -hdr which is not possible to do with just one preset in compilepal.

Exactol commented 1 year ago

After thinking about this for a bit I think the best way for a generic solution to running a step more than once would be to create a plugin thats a copy of the step. I'm not sure if a generic way can be done without doing a large refactor, and I think the use cases for it are pretty small. Doing it for specific steps shouldn't be too hard, like adding "bounces" to cubemaps, or a flag to run VRAD with hdr and ldr separately, so if you still want the feature I can look into adding it.

If you want to use the plugin method:

statecouncil commented 1 year ago

Oh yeah, I've been using the same trick to get an additional VRAD pass to work. I wasn't sure if it's that simple with Cubemaps as I figured it would simply overwrite the previous Cubemaps (without the bounce). Will test this out.

worMatty commented 1 year ago

Hi. If it's any use to you, according to the SDK wiki the game launch parameter buildcubemaps accepts an integer, and will run as many times as you specify.

statecouncil commented 1 year ago

Hi. If it's any use to you, according to the SDK wiki the game launch parameter buildcubemaps accepts an integer, and will run as many times as you specify.

Hmm, I thought the launch param didn't work correctly? I may be mistaken.

Exactol commented 1 year ago

Can you try this build? https://www.dropbox.com/s/27gwbexhqdbwmeq/Compile%20Pal%20028.1.zip?dl=0

statecouncil commented 1 year ago

Seems to be working fine. I tried it with 4 "bounces", and that's what it did. Thanks!