Files
FlaxEngine/Source/Engine/Graphics/Materials/MaterialShaderFeatures.h
Wojtek Figat f045b5b6b6 Merge remote-tracking branch 'origin/master' into 1.12
# Conflicts:
#	Content/Editor/Camera/M_Camera.flax
#	Content/Editor/CubeTexturePreviewMaterial.flax
#	Content/Editor/DebugMaterials/DDGIDebugProbes.flax
#	Content/Editor/DebugMaterials/SingleColor/Decal.flax
#	Content/Editor/DebugMaterials/SingleColor/Particle.flax
#	Content/Editor/DebugMaterials/SingleColor/Surface.flax
#	Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
#	Content/Editor/DebugMaterials/SingleColor/Terrain.flax
#	Content/Editor/DefaultFontMaterial.flax
#	Content/Editor/Gizmo/FoliageBrushMaterial.flax
#	Content/Editor/Gizmo/Material.flax
#	Content/Editor/Gizmo/MaterialWire.flax
#	Content/Editor/Gizmo/SelectionOutlineMaterial.flax
#	Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
#	Content/Editor/Highlight Material.flax
#	Content/Editor/Icons/IconsMaterial.flax
#	Content/Editor/IesProfilePreviewMaterial.flax
#	Content/Editor/MaterialTemplates/Features/ForwardShading.hlsl
#	Content/Editor/Particles/Particle Material Color.flax
#	Content/Editor/Particles/Smoke Material.flax
#	Content/Editor/SpriteMaterial.flax
#	Content/Editor/Terrain/Circle Brush Material.flax
#	Content/Editor/Terrain/Highlight Terrain Material.flax
#	Content/Editor/TexturePreviewMaterial.flax
#	Content/Editor/Wires Debug Material.flax
#	Content/Engine/DefaultDeformableMaterial.flax
#	Content/Engine/DefaultMaterial.flax
#	Content/Engine/DefaultRadialMenu.flax
#	Content/Engine/DefaultTerrainMaterial.flax
#	Content/Engine/SingleColorMaterial.flax
#	Content/Engine/SkyboxMaterial.flax
#	Flax.flaxproj
#	Source/Engine/Graphics/Materials/MaterialShader.h
#	Source/Engine/Graphics/Materials/MaterialShaderFeatures.cpp
#	Source/Engine/Renderer/RenderList.h
#	Source/Shaders/Reflections.shader
#	Source/Shaders/ReflectionsCommon.hlsl
#	Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
2026-02-11 00:20:38 +01:00

120 lines
3.3 KiB
C

// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "MaterialShader.h"
#include "Engine/Core/Math/Rectangle.h"
#include "Engine/Core/Types/Span.h"
#include "Engine/Renderer/GI/DynamicDiffuseGlobalIllumination.h"
#include "Engine/Renderer/GlobalSignDistanceFieldPass.h"
#include "Engine/Renderer/GI/GlobalSurfaceAtlasPass.h"
// Material shader features are plugin-based functionalities that are reusable between different material domains.
struct MaterialShaderFeature
{
#if USE_EDITOR
struct GeneratorData
{
const Char* Template;
};
#endif
};
// Material shader feature that add support for Forward shading inside the material shader.
struct ForwardShadingFeature : MaterialShaderFeature
{
enum { MaxLocalLights = 4 };
enum { SRVs = 6 };
PACK_STRUCT(struct Data {
ShaderLightData DirectionalLight;
ShaderLightData SkyLight;
ShaderEnvProbeData EnvironmentProbe;
ShaderExponentialHeightFogData ExponentialHeightFog;
ShaderVolumetricFogData VolumetricFogData;
Float3 Dummy2;
uint32 LocalLightsCount;
ShaderLightData LocalLights[MaxLocalLights];
});
static void Bind(MaterialShader::BindParameters& params, Span<byte>& cb, int32& srv);
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that add support for Deferred shading inside the material shader.
struct DeferredShadingFeature : MaterialShaderFeature
{
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds geometry hardware tessellation (using Hull and Domain shaders).
struct TessellationFeature : MaterialShaderFeature
{
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds lightmap sampling feature.
struct LightmapFeature : MaterialShaderFeature
{
enum { SRVs = 3 };
static bool Bind(MaterialShader::BindParameters& params, Span<byte>& cb, int32& srv);
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds Global Illumination sampling feature (light probes).
struct GlobalIlluminationFeature : MaterialShaderFeature
{
enum { SRVs = 3 };
PACK_STRUCT(struct Data {
DynamicDiffuseGlobalIlluminationPass::ConstantsData DDGI;
});
static bool Bind(MaterialShader::BindParameters& params, Span<byte>& cb, int32& srv);
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds SDF Reflections feature (software reflections).
struct SDFReflectionsFeature : MaterialShaderFeature
{
enum { SRVs = 7 };
PACK_STRUCT(struct Data {
GlobalSignDistanceFieldPass::ConstantsData GlobalSDF;
GlobalSurfaceAtlasPass::ConstantsData GlobalSurfaceAtlas;
});
static bool Bind(MaterialShader::BindParameters& params, Span<byte>& cb, int32& srv);
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds distortion vectors rendering pass.
struct DistortionFeature : MaterialShaderFeature
{
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};
// Material shader feature that adds motion vectors rendering pass.
struct MotionVectorsFeature : MaterialShaderFeature
{
#if USE_EDITOR
static void Generate(GeneratorData& data);
#endif
};