49 , _preRenderBatch( context.gfx(), *this )
51 std::atomic_uint loadTasks = 0u;
67 texDescriptor._textureOptions._useDDSCache =
true;
68 texDescriptor._textureOptions._outputSRGB =
false;
69 texDescriptor._textureOptions._alphaChannelTransparency =
false;
72 textureWaterCaustics.assetName(
"terrain_water_NM.jpg" );
73 textureWaterCaustics.assetLocation( Paths::g_imagesLocation );
74 textureWaterCaustics.waitForReady(
false );
77 texDescriptor._textureOptions._isNormalMap =
false;
79 noiseTexture.assetName(
"bruit_gaussien.jpg" );
80 noiseTexture.assetLocation( Paths::g_imagesLocation );
81 noiseTexture.waitForReady(
false );
85 borderTexture.assetName(
"vignette.jpeg" );
86 borderTexture.assetLocation( Paths::g_imagesLocation );
87 borderTexture.waitForReady(
false );
98 vertModule.
_variant =
"FullScreenQuad";
106 postFXShaderDescriptor.
_modules.push_back( vertModule );
107 postFXShaderDescriptor.
_modules.push_back( fragModule );
132 newWidth < 1 || newHeight < 1 )
145 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"PostFX: PrePass";
150 GFX::EnqueueCommand<GFX::PopCameraCommand>( bufferInOut );
151 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
156 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"PostFX: Apply";
164 beginRenderPassCmd._name =
"DO_POSTFX_PASS";
167 GFX::EnqueueCommand<GFX::BindPipelineCommand>( bufferInOut )->_pipeline =
_drawPipeline;
181 GFX::EnqueueCommand<GFX::SendPushConstantsCommand>( bufferInOut )->_uniformData = &
_uniformData;
195 auto cmd = GFX::EnqueueCommand<GFX::BindShaderResourcesCommand>( bufferInOut );
199 Set( binding.
_data, velocityAtt->texture(), defaultSampler );
203 Set( binding.
_data, ssrDataAtt->texture(), defaultSampler );
207 Set( binding.
_data, linDepthDataAtt->texture(), defaultSampler );
223 Set( binding.
_data, prbAtt->texture(), prbAtt->_descriptor._sampler );
225 GFX::EnqueueCommand<GFX::DrawCommand>( bufferInOut )->_drawCommands.emplace_back();
229 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
239 _noiseTimer += Time::MicrosecondsToMilliseconds<D64>( deltaTimeUSGame );
262 fadeStrength = 1.0f - fadeStrength;
265 if ( fadeStrength > 0.99 )
324 if ( waitDurationMS > 0.0 )
326 setFadeOutIn( targetColour, waitDurationMS * 0.5, waitDurationMS * 0.5, durationFadeOutMS );
332 setFadeOut( targetColour, durationFadeOutMS, waitDurationMS, [
this, durationFadeInMS]()
#define WAIT_FOR_CONDITION(...)
#define PROFILE_SCOPE_AUTO(CATEGORY)
static Camera * GetUtilityCamera(const UtilityCamera type)
const CameraSnapshot & snapshot() const noexcept
Returns the internal camera snapshot data (eye, orientation, etc)
GFXRTPool & renderTargetPool() noexcept
Pipeline * newPipeline(const PipelineDescriptor &descriptor)
Create and return a new graphics pipeline. This is only used for caching and doesn't use the object a...
const RenderStateBlock & get2DStateBlock() const noexcept
void setParam(HashType nameID, T &&value)
PlatformContext & context() noexcept
ParamHandler & paramHandler() noexcept
GFXDevice & gfx() noexcept
void setFadeOutIn(const UColour3 &targetColour, D64 durationFadeOutMS, D64 waitDurationMS)
F32 _randomNoiseCoefficient
GFX::SetCameraCommand _setCameraCmd
void update(U64 deltaTimeUSFixed, U64 deltaTimeUSApp)
bool getFilterState(const FilterType filter) const noexcept
vec2< U16 > _resolutionCache
void idle(const Configuration &config, U64 deltaTimeUSGame)
void setFadeOut(const UColour3 &targetColour, D64 durationMS, D64 waitDurationMS, DELEGATE< void > onComplete=DELEGATE< void >())
DELEGATE< void > _fadeOutComplete
void prePass(PlayerIndex idx, const CameraSnapshot &cameraSnapshot, GFX::CommandBuffer &bufferInOut)
void setFadeIn(D64 durationMS, DELEGATE< void > onComplete=DELEGATE< void >())
PreRenderBatch _preRenderBatch
Handle< Texture > _screenBorder
void apply(PlayerIndex idx, const CameraSnapshot &cameraSnapshot, GFX::CommandBuffer &bufferInOut)
F32 _randomFlashCoefficient
Handle< Texture > _underwaterTexture
PostFX(PlatformContext &context)
Handle< ShaderProgram > _postProcessingShader
RTDrawDescriptor _postFXTarget
static const char * FilterName(FilterType filter) noexcept
DELEGATE< void > _fadeInComplete
void updateResolution(U16 newWidth, U16 newHeight)
void execute(PlayerIndex idx, const CameraSnapshot &cameraSnapshot, U32 filterStack, GFX::CommandBuffer &bufferInOut)
void prePass(PlayerIndex idx, const CameraSnapshot &cameraSnapshot, U32 filterStack, GFX::CommandBuffer &bufferInOut)
void update(U64 deltaTimeUS) noexcept
RenderTargetHandle getLinearDepthRT() const noexcept
RenderTargetHandle getOutput(bool hdr) const
void reshape(U16 width, U16 height)
RTAttachment * getAttachment(RTAttachmentType type, RTColourAttachmentSlot slot=RTColourAttachmentSlot::SLOT_0) const
void set(const T *v) noexcept
set the 2 components of the vector manually using a source pointer to a (large enough) array
FORCE_INLINE T * EnqueueCommand(CommandBuffer &buffer)
constexpr Optick::Category::Type GameLogic
constexpr Optick::Category::Type Graphics
FColour4 ToFloatColour(const UColour4 &byteColour) noexcept
Handle console commands that start with a forward slash.
DELEGATE_STD< Ret, Args... > DELEGATE
FORCE_INLINE void DestroyResource(Handle< T > &handle, const bool immediate=false)
constexpr D64 EPSILON_D64
constexpr F32 to_F32(const T value)
void Set(DescriptorSetBindingData &dataInOut, ShaderBuffer *buffer, const BufferRange range) noexcept
constexpr U64 _ID(const char *const str, const U64 value=val_64_const) noexcept
DescriptorSetBinding & AddBinding(DescriptorSet &setInOut, U8 slot, U16 stageVisibilityMask)
FORCE_INLINE Handle< T > CreateResource(const ResourceDescriptor< T > &descriptor, bool &wasInCache, std::atomic_uint &taskCounter)
@ FILTER_SS_AMBIENT_OCCLUSION
static const vec4< F32 > VECTOR4_ZERO
constexpr auto to_base(const Type value) -> Type
mat4< F32 > _invProjectionMatrix
static NO_INLINE void printfn(const char *format, T &&... args)
DescriptorSetBindingData _data
CameraSnapshot _cameraSnapshot
static constexpr RTColourAttachmentSlot ALBEDO
static constexpr RTColourAttachmentSlot VELOCITY
PrimitiveTopology _primitiveTopology
Handle< ShaderProgram > _shaderProgramHandle
RenderStateBlock _stateBlock
vector< ShaderModuleDescriptor > _modules
ImageTools::ImportOptions _textureOptions
static RenderTargetID SCREEN
static RenderTargetID SSR_RESULT
PropertyDescriptor< T > _propertyDescriptor
TextureWrap _wrapU
Texture wrap mode (Or S-R-T)