Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Enhancement: PBR Parallax - Performance Tuning Options

Open luxeleios opened this issue 1 year ago • 1 comments

What would this enhancement be for?

Rendering

Describe your enhancement suggestion in more detail

Currently, parallax occlusion mapping works fine within the pbr shader, but it needs more options to let us tune its performance in order to make using it feasible for more than just higher end systems.

The main issue with the POM in its current state is that it is too taxing in terms of performance, which means that it is only really viable as a high end graphics setting. This puts severe restrictions on how POM can be used artistically - if used extensively and not just as an insignificant embelishment, the disparity between the image quality of those who have it on and those who have it off may be quite noticeable. The changes suggested here should give us tools to accommodate for the performance impact of POM and ensure that people with less than stellar hardware can nevertheless experience a similiar level of visual quality. These changes should also allow modders to reduce the unnecessary performance impact of certain POM usage scenarios and allow for it to be comfortably used in more situations than now.

Here are my suggestions for additional settings and parameters which would be contained inside each individual VMT, with some syntax mockups.

  • Parallax Layer Count - a setting to tune the amount of parallax layers a specific material is using. A lot of materials can get away with less, sometimes way less, layers than POM currently uses.

      `$parallaxlayercount "6"`
    
  • Parallax Distance Fade - a setting to disable the effect if a player is farther than this distance away from the surface, in units. Can act as an instance based override for a potential global setting of the same name.

      `$parallaxfadedist "500"`
    
  • Introduce a much cheaper (but still usable) alternative to parallax in the form of Bump Offset Mapping also found in Unreal, which still takes a heightmap input but has no actual layers/slices. Switch to this version of parallax via a boolean parameter. In case you do not know what I mean by Bump Offset.

      `$parallaxcheap "1"`
    
  • Parallax Quality Level - a branch of settings that would allow you to define Parallax settings for each material quality setting, high to low, similar to DX level used by entities and materials

ParallaxQualityLevel
	{
		High
		{
			$parallaxlayercount "8"
			$parallaxfadedist "2000"
		}
		Medium
		{
			$parallaxlayercount "4"
			$parallaxfadedist "1000"
		}
		Low
		{
			$parallaxcheap "1"
			$parallaxdepth"0.25"
		}

Most of these changes are about exposing shader parameters which should already exist in the code in some form , and the bump offset should also be rather straightforward to implement, judging based on how it has been done in unreal since 2005.

luxeleios avatar May 12 '24 01:05 luxeleios

This should be a thing soon; PBR is quite new, so it comes with increased GPU requirements.

Maxkatsur avatar Jul 01 '24 01:07 Maxkatsur