You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Storing water in gbuffer and runnign extra lighting pass would be too expenssiv. So instead, when in deferred, single layer water always output the main dir light luminance into a separate 111110 texture. DF shadow is applied on that texture. DFShadow culling step is cached the first time for a given view in order to be able to reapply DFShadow later with a depth buffer containing water. This save 0.4ms on a base console. DFShadow is naturaly skipped if the directional light does not have that feature enabled. When DFShadow is executed, it is basically 0.24ms extra on a base console @ 1080p. The separated light buffer is an extra 8MB allocated when in deferred. This only works with deferred for now (forward does not run the reflection/composite pass). Render target slot assignement is a bit fuzzy but this is a mostly static setup so should be fine. And could change with Strata down the line. r.Water.SingleLayer.ShaderSupportDistanceFieldShadow is to enabled dfshadow on water for the shaders. Defaults to 1 and will only be enalbed when using deferred and when distance fields are enabled. r.Water.SingleLayer.DistanceFieldShadow is a runtime toggle of the feature (if enabled the shaders still output to the separate light render target, but that is simply discarded). Follow up: tile upsample, tile traceshadow, make it work with strata. Tested shooter and console. #rb Tiago.Costa, Kevin.Ortegren #preflight https://horde.devtools.epicgames.com/job/62457ad79f404234145cd424 [CL 19613312 by Sebastien Hillaire in ue5-main branch]
211 lines
4.7 KiB
Plaintext
211 lines
4.7 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
Definitions.usf: Defines undefined defines to 0 as Cg can't handle them.
|
|
=============================================================================*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef MATERIAL_TWOSIDED
|
|
#define MATERIAL_TWOSIDED 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_TANGENTSPACENORMAL
|
|
#define MATERIAL_TANGENTSPACENORMAL 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_TWOSIDED_SEPARATE_PASS
|
|
#define MATERIAL_TWOSIDED_SEPARATE_PASS 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_MASKED
|
|
#define MATERIALBLENDING_MASKED 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_TRANSLUCENT
|
|
#define MATERIALBLENDING_TRANSLUCENT 0
|
|
#endif
|
|
|
|
#ifndef TRANSLUCENT_SHADOW_WITH_MASKED_OPACITY
|
|
#define TRANSLUCENT_SHADOW_WITH_MASKED_OPACITY 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_ADDITIVE
|
|
#define MATERIALBLENDING_ADDITIVE 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_MODULATE
|
|
#define MATERIALBLENDING_MODULATE 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_ALPHACOMPOSITE
|
|
#define MATERIALBLENDING_ALPHACOMPOSITE 0
|
|
#endif
|
|
|
|
#ifndef MATERIALBLENDING_ALPHAHOLDOUT
|
|
#define MATERIALBLENDING_ALPHAHOLDOUT 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_OPAQUE
|
|
#define STRATA_BLENDING_OPAQUE 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_MASKED
|
|
#define STRATA_BLENDING_MASKED 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_TRANSLUCENT_GREYTRANSMITTANCE
|
|
#define STRATA_BLENDING_TRANSLUCENT_GREYTRANSMITTANCE 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_TRANSLUCENT_COLOREDTRANSMITTANCE
|
|
#define STRATA_BLENDING_TRANSLUCENT_COLOREDTRANSMITTANCE 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_COLOREDTRANSMITTANCEONLY
|
|
#define STRATA_BLENDING_COLOREDTRANSMITTANCEONLY 0
|
|
#endif
|
|
|
|
#ifndef STRATA_BLENDING_ALPHAHOLDOUT
|
|
#define STRATA_BLENDING_ALPHAHOLDOUT 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SHADINGMODEL_DEFAULT_LIT
|
|
#define MATERIAL_SHADINGMODEL_DEFAULT_LIT 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SHADINGMODEL_SUBSURFACE
|
|
#define MATERIAL_SHADINGMODEL_SUBSURFACE 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SHADINGMODEL_PREINTEGRATED_SKIN
|
|
#define MATERIAL_SHADINGMODEL_PREINTEGRATED_SKIN 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SHADINGMODEL_UNLIT
|
|
#define MATERIAL_SHADINGMODEL_UNLIT 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SHADINGMODEL_SINGLELAYERWATER
|
|
#define MATERIAL_SHADINGMODEL_SINGLELAYERWATER 0
|
|
#endif
|
|
|
|
#ifndef SINGLE_LAYER_WATER_DF_SHADOW_ENABLED
|
|
#define SINGLE_LAYER_WATER_DF_SHADOW_ENABLED 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SINGLE_SHADINGMODEL
|
|
#define MATERIAL_SINGLE_SHADINGMODEL 0
|
|
#endif
|
|
|
|
#ifndef HAS_PRIMITIVE_UNIFORM_BUFFER
|
|
#define HAS_PRIMITIVE_UNIFORM_BUFFER 0
|
|
#endif
|
|
|
|
#ifndef NEEDS_VERTEX_FACTORY_INTERPOLATION
|
|
#define NEEDS_VERTEX_FACTORY_INTERPOLATION 0
|
|
#endif
|
|
|
|
// Nanite deferred material shading
|
|
#ifndef IS_NANITE_SHADING_PASS
|
|
#define IS_NANITE_SHADING_PASS 0
|
|
#endif
|
|
|
|
// Nanite programmable rasterizer
|
|
#ifndef IS_NANITE_RASTER_PASS
|
|
#define IS_NANITE_RASTER_PASS 0
|
|
#endif
|
|
|
|
#ifndef IS_NANITE_PASS
|
|
#define IS_NANITE_PASS (IS_NANITE_SHADING_PASS || IS_NANITE_RASTER_PASS)
|
|
#endif
|
|
|
|
#ifndef USE_ANALYTIC_DERIVATIVES
|
|
#define USE_ANALYTIC_DERIVATIVES 0
|
|
#endif
|
|
|
|
#ifndef GBUFFER_HAS_VELOCITY
|
|
#define GBUFFER_HAS_VELOCITY 0
|
|
#endif
|
|
|
|
#define PC_D3D (SM6_PROFILE || SM5_PROFILE)
|
|
|
|
#ifndef NEEDS_LIGHTMAP_COORDINATE
|
|
#define NEEDS_LIGHTMAP_COORDINATE 0
|
|
#endif
|
|
|
|
#ifndef LANDSCAPE_XYOFFSET
|
|
#define LANDSCAPE_XYOFFSET 0
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SKY_ATMOSPHERE
|
|
#define MATERIAL_SKY_ATMOSPHERE 0
|
|
#endif
|
|
|
|
#ifndef BASEPASS_SKYATMOSPHERE_AERIALPERSPECTIVE
|
|
#define BASEPASS_SKYATMOSPHERE_AERIALPERSPECTIVE 0
|
|
#endif
|
|
|
|
#ifndef NUM_VF_PACKED_INTERPOLANTS
|
|
#define NUM_VF_PACKED_INTERPOLANTS 0
|
|
#endif
|
|
|
|
#ifndef REVERSEBITS
|
|
#define REVERSEBITS reversebits
|
|
#endif
|
|
|
|
#ifndef INSTANCED_STEREO
|
|
#define INSTANCED_STEREO 0
|
|
#endif
|
|
|
|
#ifndef MULTI_VIEW
|
|
#define MULTI_VIEW 0
|
|
#endif
|
|
|
|
#ifndef CLEAR_COAT_BOTTOM_NORMAL
|
|
#define CLEAR_COAT_BOTTOM_NORMAL 0
|
|
#endif
|
|
|
|
#ifndef IRIS_NORMAL
|
|
#define IRIS_NORMAL 0
|
|
#endif
|
|
|
|
#ifndef TEX_COORD_SCALE_ANALYSIS
|
|
#define TEX_COORD_SCALE_ANALYSIS 0
|
|
#endif
|
|
|
|
#ifndef LIGHTMAP_VT_ENABLED
|
|
#define LIGHTMAP_VT_ENABLED 0
|
|
#endif
|
|
|
|
#define NOEXPRESSIONOPTIMIZATIONS
|
|
|
|
#ifndef HAS_INVERTED_Z_BUFFER
|
|
#define HAS_INVERTED_Z_BUFFER 1
|
|
#endif
|
|
|
|
/** When defined sets the layer index for volumetric rendering in the vertex shader, rather than using a geometry shader */
|
|
#ifndef USING_VERTEX_SHADER_LAYER
|
|
#define USING_VERTEX_SHADER_LAYER 0
|
|
#endif
|
|
|
|
#ifndef DISABLE_FORWARD_LOCAL_LIGHTS
|
|
#define DISABLE_FORWARD_LOCAL_LIGHTS 0
|
|
#endif
|
|
|
|
#ifndef SINGLE_LAYER_WATER_SIMPLE_FORWARD
|
|
#define SINGLE_LAYER_WATER_SIMPLE_FORWARD 0
|
|
#endif
|
|
|
|
#ifndef CLOUD_LAYER_PIXEL_SHADER
|
|
#define CLOUD_LAYER_PIXEL_SHADER 0
|
|
#endif
|
|
|
|
|
|
#ifndef SUPPORTS_ANISOTROPIC_MATERIALS
|
|
#define SUPPORTS_ANISOTROPIC_MATERIALS 0
|
|
#endif
|
|
|
|
#ifndef FORCE_MATERIAL_FLOAT_FULL_PRECISION
|
|
#define FORCE_MATERIAL_FLOAT_FULL_PRECISION 0
|
|
#endif |