Merge remote-tracking branch 'origin/master' into 1.11
# Conflicts: # Content/Editor/DebugMaterials/DDGIDebugProbes.flax # Source/Editor/Windows/OutputLogWindow.cs # Source/Engine/Level/Actor.cpp
This commit is contained in:
@@ -156,8 +156,8 @@ public:
|
||||
/// </summary>
|
||||
GPUTextureView* Input = nullptr;
|
||||
|
||||
BindParameters(::GPUContext* context, const ::RenderContext& renderContext);
|
||||
BindParameters(::GPUContext* context, const ::RenderContext& renderContext, const ::DrawCall& drawCall, bool instanced = false);
|
||||
FLAXENGINE_API BindParameters(::GPUContext* context, const ::RenderContext& renderContext);
|
||||
FLAXENGINE_API BindParameters(::GPUContext* context, const ::RenderContext& renderContext, const ::DrawCall& drawCall, bool instanced = false);
|
||||
|
||||
// Per-view shared constant buffer (see ViewData in MaterialCommon.hlsl).
|
||||
static GPUConstantBuffer* PerViewConstants;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "MaterialShaderFeatures.h"
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include "Engine/Graphics/RenderBuffers.h"
|
||||
#include "Engine/Graphics/Textures/GPUTexture.h"
|
||||
#include "Engine/Renderer/RenderList.h"
|
||||
#include "Engine/Renderer/ShadowsPass.h"
|
||||
@@ -24,18 +25,27 @@ void ForwardShadingFeature::Bind(MaterialShader::BindParameters& params, Span<by
|
||||
const int32 skyLightShaderRegisterIndex = srv + 1;
|
||||
const int32 shadowsBufferRegisterIndex = srv + 2;
|
||||
const int32 shadowMapShaderRegisterIndex = srv + 3;
|
||||
const int32 volumetricFogTextureRegisterIndex = srv + 4;
|
||||
const bool canUseShadow = view.Pass != DrawPass::Depth;
|
||||
|
||||
// Set fog input
|
||||
GPUTextureView* volumetricFogTexture = nullptr;
|
||||
if (cache->Fog)
|
||||
{
|
||||
cache->Fog->GetExponentialHeightFogData(view, data.ExponentialHeightFog);
|
||||
VolumetricFogOptions volumetricFog;
|
||||
cache->Fog->GetVolumetricFogOptions(volumetricFog);
|
||||
if (volumetricFog.UseVolumetricFog() && params.RenderContext.Buffers->VolumetricFog)
|
||||
volumetricFogTexture = params.RenderContext.Buffers->VolumetricFog->ViewVolume();
|
||||
else
|
||||
data.ExponentialHeightFog.VolumetricFogMaxDistance = -1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.ExponentialHeightFog.FogMinOpacity = 1.0f;
|
||||
data.ExponentialHeightFog.ApplyDirectionalInscattering = 0.0f;
|
||||
}
|
||||
params.GPUContext->BindSR(volumetricFogTextureRegisterIndex, volumetricFogTexture);
|
||||
|
||||
// Set directional light input
|
||||
if (cache->DirectionalLights.HasItems())
|
||||
|
||||
@@ -25,7 +25,7 @@ struct ForwardShadingFeature : MaterialShaderFeature
|
||||
{
|
||||
enum { MaxLocalLights = 4 };
|
||||
|
||||
enum { SRVs = 4 };
|
||||
enum { SRVs = 5 };
|
||||
|
||||
PACK_STRUCT(struct Data
|
||||
{
|
||||
|
||||
@@ -372,6 +372,8 @@ bool MaterialSlotEntry::UsesProperties() const
|
||||
Opacity.TextureIndex != -1 ||
|
||||
Math::NotNearEqual(Roughness.Value, 0.5f) ||
|
||||
Roughness.TextureIndex != -1 ||
|
||||
Math::NotNearEqual(Metalness.Value, 0.5f) ||
|
||||
Metalness.TextureIndex != -1 ||
|
||||
Normals.TextureIndex != -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,14 +327,23 @@ struct FLAXENGINE_API MaterialSlotEntry
|
||||
{
|
||||
float Value = 0.5f;
|
||||
int32 TextureIndex = -1;
|
||||
uint8 Channel = 0;
|
||||
} Roughness;
|
||||
|
||||
struct
|
||||
{
|
||||
float Value = 0.0f;
|
||||
int32 TextureIndex = -1;
|
||||
uint8 Channel = 0;
|
||||
} Metalness;
|
||||
|
||||
struct
|
||||
{
|
||||
int32 TextureIndex = -1;
|
||||
} Normals;
|
||||
|
||||
bool TwoSided = false;
|
||||
bool Wireframe = false;
|
||||
|
||||
bool UsesProperties() const;
|
||||
static float ShininessToRoughness(float shininess);
|
||||
|
||||
Reference in New Issue
Block a user