Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Enhancement: Support Parallax Corrected Cubemaps on `prop_static`

Open Equalizer5118 opened this issue 1 year ago • 4 comments

What would this enhancement be for?

Entity

Describe your enhancement suggestion in more detail

As I currently understand how parallax corrected cubemaps work, VBSP patches any materials with $envmap env_cubemap by replacing env_cubemap with the name of the nearest generated cubemap. The reason this doesnt work with static props are because, iirc, they are switched on the fly in-game, a system used by all props. For me, I don't see why this needs to be done for static props as they, as the name implies, are static. It would make more sense to me to have VBSP patch materials for each instance of the prop_static found to replace the $envmap param with their own respective closest cubemap, which would by extension allow for parallax Corrected cubemaps to then be supported on static props.

To the end user, the process should be no different than pcc on world brushes. However, there should likely be a key value for prop_static that would allow material patching, which should be disabled by default. It could look like this:

Enable Material Patching (enablepatching) < bool >        Allows VBSP to patch this prop's materials, which allows for Parallax Corrected Cubemaps to be attached to this prop at the cost of increased file size.

Equalizer5118 avatar Feb 25 '24 19:02 Equalizer5118

Does your model's material have bumpmap specified? Parallax correction won't work on materials with $bumpmap specified (I've only tested this on LightmappedGeneric, but I believe it also applies to the VertexLitGeneric shader)

TheEnderek0 avatar Mar 02 '24 19:03 TheEnderek0

It does, however parallax cubemaps have worked on LMG materials and PBR materials with $bumpmap specified for me in the past.

Also, after looking at the shader parameter list JJ provided me a couple of months back, I see no params that exist for parallax correction. Specifically, the param $envmapparallax exists on LMG, however that parameter does not exist on VLG.

Equalizer5118 avatar Mar 02 '24 21:03 Equalizer5118

Nevermind my comment, I've just had a problem with parallax corrected cubemaps, but it turns out my normal map was just broken

TheEnderek0 avatar Mar 02 '24 21:03 TheEnderek0