bWaterUsesSimpleForwardShading

bWaterUsesSimpleForwardShading

#Overview

name: bWaterUsesSimpleForwardShading

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bWaterUsesSimpleForwardShading is to indicate whether the water rendering system uses a simple forward shading technique on a specific shader platform.

This setting variable is primarily used in the RHI (Rendering Hardware Interface) module of Unreal Engine. It’s part of the FGenericDataDrivenShaderPlatformInfo class, which provides information about shader platform capabilities.

The value of this variable is set during the parsing of data-driven shader information, as seen in the ParseDataDrivenShaderInfo function in DataDrivenShaderPlatformInfo.cpp. It’s likely populated from a configuration file or platform-specific data.

This variable interacts with other shader platform capability flags within the FGenericDataDrivenShaderPlatformInfo class, such as bSupportsHairStrandGeometry, bSupportsDOFHybridScattering, and others.

Developers must be aware that this variable is platform-specific and its value may change depending on the target shader platform. It’s used to determine the rendering approach for water surfaces, potentially affecting performance and visual quality.

Best practices when using this variable include:

  1. Always check its value using the provided static function GetWaterUsesSimpleForwardShading() rather than accessing the variable directly.
  2. Consider the implications of simple forward shading for water on performance and visual quality when developing water-related rendering features.
  3. Test water rendering on different platforms to ensure correct behavior based on this setting.
  4. Be aware that changing this setting might require adjustments to water shaders and rendering pipelines.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:105, section: [ShaderPlatform VULKAN_SM5_ANDROID]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:267

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_INT_HELPER(NumberOfComputeThreads);

	GET_SECTION_BOOL_HELPER(bWaterUsesSimpleForwardShading);
	GET_SECTION_BOOL_HELPER(bSupportsHairStrandGeometry);
	GET_SECTION_BOOL_HELPER(bSupportsDOFHybridScattering);
	GET_SECTION_BOOL_HELPER(bNeedsExtraMobileFrames);
	GET_SECTION_BOOL_HELPER(bSupportsHZBOcclusion);
	GET_SECTION_BOOL_HELPER(bSupportsWaterIndirectDraw);
	GET_SECTION_BOOL_HELPER(bSupportsAsyncPipelineCompilation);

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:90

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsVariableRateShading : 1;
	uint32 NumberOfComputeThreads : 10;
	uint32 bWaterUsesSimpleForwardShading : 1;
	uint32 bSupportsHairStrandGeometry : 1;
	uint32 bSupportsDOFHybridScattering : 1;
	uint32 bNeedsExtraMobileFrames : 1;
	uint32 bSupportsHZBOcclusion : 1;
	uint32 bSupportsWaterIndirectDraw : 1;
	uint32 bSupportsAsyncPipelineCompilation : 1;

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:623

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetWaterUsesSimpleForwardShading

Source code excerpt:

	{
		check(IsValid(Platform));
		return Infos[Platform].bWaterUsesSimpleForwardShading;
	}

	static FORCEINLINE_DEBUGGABLE const bool GetSupportsHairStrandGeometry(const FStaticShaderPlatform Platform)
	{
		check(IsValid(Platform));
		return Infos[Platform].bSupportsHairStrandGeometry;