Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
PostProcessPipeline.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
13#pragma once
14
15#include "../../core/Types.hpp"
17#include "../../math/Math.hpp"
21
22#include <glm/glm.hpp>
23#include <algorithm>
24#include <cmath>
25#include <string>
26#include <vector>
27#include <unordered_map>
28#include <memory>
29
30namespace esengine {
31
32class GfxDevice;
33class RenderContext;
34class Shader;
35class VoxelGI;
36class DynamicGI;
37
38namespace resource {
39 class ResourceManager;
40}
41
50enum class OutputTransform : u8 {
51 None = 0,
52 ACES = 1,
53 Neutral = 2,
54};
55
60 std::string name;
62 bool enabled = true;
63 std::unordered_map<std::string, f32> floatUniforms;
64 std::unordered_map<std::string, glm::vec4> vec4Uniforms;
69 std::vector<std::pair<std::string, u32>> textureUniforms;
70
73 bool temporal = false;
77 bool feedback = false;
80
84 f32 scale = 1.0f;
85
89 bool continuesEffect = false;
90
94 std::vector<std::pair<std::string, rg::ResourceId>> earlierInputs;
95
99 bool isCompute = false;
100 bool usesComputeDepth = false;
102 std::string nativeKind;
103 std::vector<std::string> computeParams;
106
110 std::vector<u8> paramBytes;
114 bool paramDirty = true;
115};
116
126public:
135 resource::ResourceManager& resourceManager, rg::RenderGraph& graph);
136
144 resource::ResourceManager& resourceManager);
146
149
153 void init(u32 width, u32 height);
154
158 void shutdown();
159
163 void resize(u32 width, u32 height);
164
171 u32 addPass(const std::string& name, resource::ShaderHandle shader);
183 u32 addComputePass(const std::string& name, const std::string& wgsl, const std::vector<std::string>& params,
184 u32 workgroupX, u32 workgroupY);
189 u32 addNativePass(const std::string& name, const std::string& kind);
191 bool supportsCompute() const;
193 void setRequestedSamples(u32 samples);
197 u32 sceneSamples() const { return scene_samples_; }
199 u32 requestedSamples() const { return requested_samples_; }
201 void setPassScale(const std::string& passName, f32 scale);
203 void setPassContinuesEffect(const std::string& passName);
204
205
206
207
211 void setPassUniformFloat(const std::string& passName, const std::string& uniform, f32 value);
212
217 void setPassTexture(const std::string& passName, const std::string& uniform, u32 glTextureId);
218
222 void setPassUniformVec4(const std::string& passName, const std::string& uniform, const glm::vec4& value);
223
227 u32 getPassCount() const { return static_cast<u32>(passes_.size()); }
228
232 const PostProcessPass* getPass(u32 index) const;
233
237 const PostProcessPass* getPass(const std::string& name) const;
238
245 void begin(const f32* clearColor = nullptr);
246
249 rg::ResourceId sceneResource() const { return inFrame_ ? sceneResource_ : rg::kNoResource; }
251 void setSelectionMask(rg::ResourceId mask) { selectionMask_ = mask; }
256
258 void declareChain();
260 void chainDone();
261
270 bool temporalActive();
271
279 bool cameraMotionWanted();
280
282 rg::TargetDesc grabTarget() const { return chainTarget(/*withDepth=*/false); }
283
287 void grabScene(bool marked = true);
288
291 bool canGrabDepth();
294 rg::TargetDesc desc = chainTarget(/*withDepth=*/false);
296 return desc;
297 }
298
299 void grabDepth();
300
311 bool sceneCoverageWanted();
312
314 void trackView(const glm::mat4& viewProjection, u64 key);
315
322 bool velocityWanted();
323
326 glm::vec2 jitter{0.0f};
327 glm::mat4 previous{1.0f};
329 glm::vec2 previousJitter{0.0f};
330 };
331
333 TemporalView peekTemporalView(const glm::mat4& viewProjection, u64 key) const;
334
343
350 bool coverWanted();
352 f32 coverRange();
354 f32 coverBias();
358 void setCoverMatrix(const glm::mat4& viewProjection) { cover_matrix_ = viewProjection; }
359 u32 coverTargetId() const { return cover_serial_; }
360
369 bool sceneHasGBuffer() const { return inFrame_ && scene_gbuffer_; }
370
378 void setEnvironmentTexture(u32 glTextureId) { environment_texture_ = glTextureId; }
379
387 shadow_texture_ = glTextureId;
388 shadow_resource_ = resource;
389 }
390
398 glm::vec2 beginTemporalView(const glm::mat4& viewProjection, u64 key);
399
403 bool isInitialized() const { return initialized_; }
404
411 bool isEngaged() const {
412 // `initialized_` leads, and that is load-bearing: init refuses when the
413 // blit shader will not compile, so a chain that cannot present degrades
414 // to drawing straight at the surface rather than to a black frame.
415 return initialized_ && ((!bypass_ && !passes_.empty()) || linear_output_
416 || output_transform_ != OutputTransform::None
418 || view_exposure_ != 0.0f
419 || presentScales() || present_required_ || compute_needs_depth_ || selection_wanted_);
420 }
421
430 bool presentScales() const {
431 return output_vp_w_ > 0 && output_vp_h_ > 0
432 && (output_vp_w_ != width_ || output_vp_h_ != height_);
433 }
434
444 void setComputeNeedsDepth(bool needs) { compute_needs_depth_ = needs; }
445 void setPresentRequired(bool required) { present_required_ = required; }
447 void setSelectionWanted(bool wanted) { selection_wanted_ = wanted; }
448
457 void setPresentOver(bool over) { present_over_ = over; }
458
459 void setBackgroundSky(bool drawn) { background_sky_ = drawn; }
460
471 bool presentUpscales() const {
472 return presentScales() && width_ > 0 && height_ > 0 && !presentIsWholeMultiple()
473 && (output_vp_w_ > width_ || output_vp_h_ > height_);
474 }
475
477 if (!presentScales() || width_ == 0 || height_ == 0) return false;
478 if (output_vp_w_ % width_ || output_vp_h_ % height_) return false;
479 return output_vp_w_ / width_ == output_vp_h_ / height_;
480 }
481
490 void setBypass(bool bypass) { bypass_ = bypass; }
491
497 void setLinearOutput(bool linear) { linear_output_ = linear; }
498
506 const HdrFormatDecision& hdrFormat() const { return frame_format_; }
507
517 void setSceneNeedsDepth(bool needs) { scene_needs_depth_ = needs; }
518 bool linearOutput() const { return linear_output_; }
519
527 void setOutputTransform(OutputTransform transform) { output_transform_ = transform; }
537 void setDisplayLut(u32 glTexture, f32 amount) {
538 display_lut_texture_ = glTexture;
539 display_lut_amount_ = std::isfinite(amount) ? std::clamp(amount, 0.0f, 1.0f) : 0.0f;
540 }
541 bool displayLutActive() const { return display_lut_texture_ != 0 && display_lut_amount_ > 0.0f; }
544 void setViewExposure(f32 ev);
545 OutputTransform outputTransform() const { return output_transform_; }
546
553 void clearPasses();
554
559
563 void setOutputViewport(u32 x, u32 y, u32 w, u32 h);
564
568 void beginScreenCapture();
569
573 void endScreenCapture();
574
578 void executeScreenPasses();
579
583 u32 addScreenPass(const std::string& name, resource::ShaderHandle shader);
584
588 void clearScreenPasses();
589
593 void setScreenPassUniformFloat(const std::string& passName, const std::string& uniform, f32 value);
594
598 void setScreenPassUniformVec4(const std::string& passName, const std::string& uniform, const glm::vec4& value);
599
603 u32 getScreenPassCount() const { return static_cast<u32>(screenPasses_.size()); }
604
608 bool isScreenCaptureActive() const { return screenCaptureActive_; }
609
615
622 void requestSkyCapture(const std::string& passName, u32 width, u32 height);
625 void encodeRgbm();
630 const std::vector<u8>& skyCapturePixels() const { return sky_capture_.pixels; }
631
638 const PostProcessPass* cloudShadowCaster(f32& extentKm, f32& unitsPerKm) const;
646 void drawCloudShadow(const glm::mat4& inverse, const glm::vec4& rect, const rg::PassContext& ctx);
649 glm::vec4 bakeSun() const;
650 bool drawProjectedMaterial(u32 material, u32 instances, u32 scratch, const glm::vec4& sun,
651 const glm::vec4& receiverWindow, TextureHandle receiverDepth, TextureHandle movingDepth);
652 bool drawMaterialThrough(u32 material, u32 shader, const std::vector<std::pair<std::string, glm::vec4>>& overrides, u32 scratch);
653 bool canDrawMaterialOver(u32 material);
654 bool drawMaterialOver(u32 material);
655
656private:
657 PostProcessPass* findPass(const std::string& name);
660 void declareSkyCapture(const PostProcessPass& pass, rg::ResourceId input, rg::ResourceId effectInput);
662 GfxPixelFormat interFormat() const;
663 void commitFormat();
665 rg::TargetDesc chainTarget(bool withDepth) const;
666 rg::TargetDesc blitSourceTarget(bool withDepth) const;
667 void ensureGraph();
668 void ensureScreenQuad();
669 void drawScreenQuad();
671 void applyPassPipeline(const Shader& shader, bool over = false, bool additive = false);
672 void renderPass(PostProcessPass& pass, const rg::PassContext& ctx);
674 void computePass(PostProcessPass& pass, const rg::PassContext& ctx);
676 bool runnable(const PostProcessPass& pass) const;
679 bool programPending(const PostProcessPass& pass) const;
682 std::unordered_map<std::string, ComputeHandle> compute_cache_;
685 std::unordered_map<u64, Unique<VoxelGI>> voxel_gis_;
686 std::unordered_map<u64, Unique<DynamicGI>> dynamic_gis_;
688 BufferHandle compute_view_ubo_ = BufferHandle::Invalid;
691 void runChain(std::vector<PostProcessPass>& passes, rg::ResourceId scene);
694 void blitPass();
696 resource::ShaderHandle outputShader();
698 resource::ShaderHandle blitVariant(bool upscale, OutputTransform transform, bool lut);
700 void bindBlitInputs(const resource::ShaderHandle& shader);
702 resource::ShaderHandle compileBlit(const std::vector<std::string>& features);
704 void releasePassResources(PostProcessPass& pass);
713 BufferHandle takeParamUbo(u32 bytes, const void* data);
714 void dropSpareParamUbos();
715 struct SpareParamUbo { BufferHandle handle; u32 bytes; u32 clears; };
716 std::vector<SpareParamUbo> spare_param_ubos_;
717
718 GfxDevice& device_;
719 RenderContext& context_;
720 resource::ResourceManager& resourceManager_;
721
723 rg::RenderGraph* graph_ = nullptr;
725 rg::RenderGraph* frameGraph_ = nullptr;
726 Unique<rg::RenderGraph> ownedGraph_;
728 BufferHandle projected_triangle_indices_ = BufferHandle::Invalid;
729 BufferHandle screen_quad_vbo_ = BufferHandle::Invalid;
730 resource::ShaderHandle blitShader_;
733 std::unordered_map<u32, resource::ShaderHandle> blitVariants_;
734 u32 display_lut_texture_ = 0;
735 f32 display_lut_amount_ = 0.0f;
737 BufferHandle blitParamUbo_ = BufferHandle::Invalid;
738 f32 blitParamAmount_ = -1.0f;
739 resource::ShaderHandle copyShader_;
741 resource::ShaderHandle exactCopyShader_;
742 resource::ShaderHandle copyDepthShader_;
744 resource::ShaderHandle outlineShader_;
745 resource::ShaderHandle outlineGroundShader_;
746 rg::ResourceId selectionMask_ = rg::kNoResource;
747
748 std::vector<PostProcessPass> passes_;
749 u32 width_ = 0;
750 u32 height_ = 0;
751 bool initialized_ = false;
752 bool inFrame_ = false;
753 bool bypass_ = false;
754 bool linear_output_ = false;
756 HdrFormatDecision frame_format_{};
758 GfxPixelFormat screenFBOFormat_ = GfxPixelFormat::RGBA8;
759 bool scene_needs_depth_ = false;
762 u32 requested_samples_ = 4;
765 u32 scene_samples_ = 1;
766 void applySampleRequest();
767 OutputTransform output_transform_ = OutputTransform::None;
768 f32 view_exposure_ = 0.0f;
770 rg::ResourceId sceneResource_ = rg::kNoResource;
772
774 u32 output_vp_x_ = 0;
775 u32 output_vp_y_ = 0;
776 bool present_required_ = false;
777 bool present_over_ = false;
778 bool background_sky_ = false;
779 bool compute_needs_depth_ = false;
780 bool selection_wanted_ = false;
781 u32 output_vp_w_ = 0;
782 u32 output_vp_h_ = 0;
783
785 struct TemporalState {
786 glm::mat4 current{1.0f};
787 glm::mat4 previous{1.0f};
789 glm::dvec3 origin{0.0};
791 glm::vec2 jitter{0.0f};
792 u32 frame = 0;
795 u32 writtenFrame = 0;
796 Unique<Framebuffer> history[2];
797 u32 readIndex = 0;
798 bool valid = false;
799 u32 width = 0;
800 u32 height = 0;
802 };
803 std::unordered_map<u64, TemporalState> temporal_;
804 u64 temporalKey_ = 0;
805 bool passIsTemporal(const PostProcessPass& pass);
806 bool passUsesLights(const PostProcessPass& pass);
808 bool passesWantGBuffer();
809 bool scene_gbuffer_ = false;
810 u32 environment_texture_ = 0;
811 u32 shadow_texture_ = 0;
812 rg::ResourceId shadow_resource_ = rg::kNoResource;
814 Unique<Framebuffer> cover_fbo_;
815 u32 cover_serial_ = 0;
816 rg::ResourceId cover_resource_ = rg::kNoResource;
818 struct SkyCapture {
819 enum class State : u8 { Idle, Requested, Drawn, Reading };
820 State state = State::Idle;
821 std::string pass;
822 u32 width = 64;
823 u32 height = 32;
824 Unique<Framebuffer> target;
825 PostProcessPass copy;
827 std::vector<u8> pixels;
828 };
829 SkyCapture sky_capture_;
831 PostProcessPass cloud_shadow_copy_;
833 bool drawing_cloud_shadow_ = false;
834 resource::ShaderHandle rgbmShader_;
835 bool cover_active_ = false;
836 glm::mat4 cover_matrix_{1.0f};
837 Unique<Framebuffer> velocity_fbo_;
838 rg::ResourceId velocity_resource_ = rg::kNoResource;
839 bool velocity_active_ = false;
840 bool passHasTexture(const PostProcessPass& pass, const char* name);
842 bool passDrawsCover(const PostProcessPass& pass);
844 TemporalState* prepareHistory(TemporalState& state, u32 w, u32 h, GfxPixelFormat format);
846 bool passIsHighPrecision(const PostProcessPass& pass);
848 std::unordered_map<u64, TemporalState> feedback_;
849 u64 feedbackKey(const std::string& passName) const;
850
851 Unique<Framebuffer> screenFBO_;
852 bool screenFBOCreated_ = false;
853 bool screenCaptureActive_ = false;
854 std::vector<PostProcessPass> screenPasses_;
855
856 PostProcessPass* findScreenPass(const std::string& name);
857 void ensureScreenFBO();
858};
859
860} // namespace esengine
GPU framebuffer abstraction for render-to-texture.
Type-safe resource handle system.
What a linear project ASKED its intermediates to be, and what the device let them be.
Math utilities and GLM configuration for ESEngine.
Full-screen passes as a declared graph: what each one reads, what it writes, and at what size — the g...
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
Definition GfxDevice.hpp:75
PostProcessPipeline(const PostProcessPipeline &)=delete
void setPassContinuesEffect(const std::string &passName)
Mark passName as a later pass of the effect the pass before it began.
void setOutputTransform(OutputTransform transform)
The curve the final pass applies to scene values.
void setPassUniformVec4(const std::string &passName, const std::string &uniform, const glm::vec4 &value)
Sets a vec4 uniform for a pass.
void setPresentOver(bool over)
This camera keeps the colour under it: its present composites over the target by coverage.
void executeScreenPasses()
Executes screen-level post-process passes on captured output.
PostProcessPipeline & operator=(const PostProcessPipeline &)=delete
bool velocityWanted()
Whether an enabled pass reads how far each moving surface travelled (u_velocity).
void resize(u32 width, u32 height)
Resizes the framebuffers.
bool isScreenCaptureActive() const
Checks if screen capture is active.
void clearScreenPasses()
Clears all screen-level passes.
void setShadowAtlas(u32 glTextureId, rg::ResourceId resource)
The frame's shadow atlas, for an effect that asks whether a point of air is in the sun (#pragma light...
f32 coverRange()
How far from the camera, in world units, that map reaches each way (the effect's u_shelterRange).
PostProcessPipeline(GfxDevice &device, RenderContext &context, resource::ResourceManager &resourceManager, rg::RenderGraph &graph)
Builds a pipeline that declares its chains onto the FRAME's graph.
void setComputeNeedsDepth(bool needs)
The caller has decided this frame needs a present.
u32 addComputePass(const std::string &name, const std::string &wgsl, const std::vector< std::string > &params, u32 workgroupX, u32 workgroupY)
Adds a pass that is a compute shader over the picture instead of a draw.
void begin(const f32 *clearColor=nullptr)
Begins rendering to the pipeline.
u32 addNativePass(const std::string &name, const std::string &kind)
Adds a pass the engine implements itself: "voxelGI" (see VoxelGI). Its parameters are set like any pa...
const PostProcessPass * getPass(u32 index) const
Gets a pass by index.
bool isEngaged() const
Whether the scene goes through the graph or straight to the surface.
void setCoverMatrix(const glm::mat4 &viewProjection)
The matrix the map was drawn through, for the effect to put a world point in it.
void drawCloudShadow(const glm::mat4 &inverse, const glm::vec4 &rect, const rg::PassContext &ctx)
Draws the caster's cloud shadow into the tile at rect of the bound target: what of the sun is left in...
const PostProcessPass * cloudShadowCaster(f32 &extentKm, f32 &unitsPerKm) const
The sky that casts the sun's cloud shadow this frame, how far its map reaches each way in kilometres,...
u32 getPassCount() const
Gets the pass count.
bool temporalActive()
Whether this frame's chain holds a temporal effect.
glm::vec2 beginTemporalView(const glm::mat4 &viewProjection, u64 key)
Starts a frame of the temporal view key, and answers how far to shift it.
void setScreenPassUniformFloat(const std::string &passName, const std::string &uniform, f32 value)
Sets a float uniform for a screen-level pass.
void setLinearOutput(bool linear)
Linear-light mode: sRGB-format intermediates (hardware linear blending) and an always-engaged capture...
bool coverWanted()
Whether an enabled pass reads what stands over each place (u_rainCover).
void setSelectionMask(rg::ResourceId mask)
The editor's selection mask for this chain (RenderFrame::declareSelectionMask): outlined after the la...
u32 getScreenPassCount() const
Gets the screen pass count.
rg::ResourceId declareCover(u32 size)
The map's target for this frame, declared in the graph (kNoResource when it cannot be made).
void setScreenPassUniformVec4(const std::string &passName, const std::string &uniform, const glm::vec4 &value)
Sets a vec4 uniform for a screen-level pass.
void setEnvironmentTexture(u32 glTextureId)
The frame's environment atlas, for an effect that reflects it (u_environment).
bool drawProjectedMaterial(u32 material, u32 instances, u32 scratch, const glm::vec4 &sun, const glm::vec4 &receiverWindow, TextureHandle receiverDepth, TextureHandle movingDepth)
FramebufferHandle currentSceneFBO() const
The surface the scene is currently rendering into: the screen-capture FBO when the screen stack is li...
void setOutputTarget(FramebufferHandle target)
Sets the output target for the final blit (Default = screen).
void setSelectionWanted(bool wanted)
An editor selection is outlined this frame: a screen effect, so the scene is drawn where its depth ca...
void clearPasses()
Checks if bypass mode is enabled.
TemporalView peekTemporalView(const glm::mat4 &viewProjection, u64 key) const
bool presentScales() const
Whether the chain's own size differs from the rect it lands in.
void setPassUniformFloat(const std::string &passName, const std::string &uniform, f32 value)
Sets a float uniform for a pass.
const HdrFormatDecision & hdrFormat() const
What this frame's intermediates were asked to be and allowed to be.
const std::vector< u8 > & skyCapturePixels() const
The captured pixels, RGBA8, rows bottom-up as every readback lands. Valid after poll answered 1.
bool presentUpscales() const
Whether the present is a whole-multiple upscale of the chain.
void beginScreenCapture()
Begins screen-level capture (all camera output goes into screen FBO).
void drawSelectionOutline(TextureHandle mask)
The selection's outline over what the bound target holds, from its mask. Blended over; the caller set...
rg::ResourceId declareVelocity()
The motion pass's target for this frame, declared in the graph (kNoResource when it cannot be made).
void requestSkyCapture(const std::string &passName, u32 width, u32 height)
Draws pass passName once more, next frame, into a width x height RGBA8 target with its float param u_...
void trackView(const glm::mat4 &viewProjection, u64 key)
Records this frame's camera as the view key's current one, and last frame's as its previous....
rg::TargetDesc grabTarget() const
The shape of the copy of the opaque scene a refractive surface reads: the chain's own,...
void setPassScale(const std::string &passName, f32 scale)
Draw passName at scale of the chain size (clamped to (0, 1]).
bool sceneHasGBuffer() const
Whether this frame's scene target carries a second attachment for the surface's material.
void shutdown()
Shuts down and releases resources.
u32 requestedSamples() const
What was asked for, before the ceiling.
bool drawMaterialThrough(u32 material, u32 shader, const std::vector< std::pair< std::string, glm::vec4 > > &overrides, u32 scratch)
rg::TargetDesc grabDepthTarget()
The shape of the copy of the opaque scene's depth: how far each pixel is from the eye,...
u32 addPass(const std::string &name, resource::ShaderHandle shader)
Adds a post-processing pass.
bool sceneCoverageWanted()
Whether the scene is to be cleared to nothing (all four channels zero) so that its alpha says how muc...
u32 addScreenPass(const std::string &name, resource::ShaderHandle shader)
Adds a screen-level post-process pass.
OutputTransform outputTransform() const
bool isInitialized() const
Checks if pipeline is initialized.
void encodeRgbm()
Draws the texture on unit 0 into the bound target as RGBM over 8 (alpha 0 kept for nothing drawn): a ...
bool cameraMotionWanted()
Whether an enabled pass that keeps no history reads the previous camera (u_prevViewProjection0).
i32 pollSkyCapture()
0 = not yet, 1 = the pixels are ready (skyCapturePixels), 2 = none was asked for or it failed....
void setRequestedSamples(u32 samples)
The project's multisampling request; 1 = off. Clamped by the device.
bool supportsCompute() const
Whether passes added with addComputePass run on this device.
void setPassTexture(const std::string &passName, const std::string &uniform, u32 glTextureId)
Binds a texture to a pass's sampler uniform (unit 2 upward, in registration order)....
void setDisplayLut(u32 glTexture, f32 amount)
A graded look the final pass applies to the picture as the display will show it.
f32 coverBias()
The bias the drawing effect reads the map with (its u_shelterBias), for a pass that only borrows the ...
void init(u32 width, u32 height)
Initializes the pipeline with given dimensions.
void setOutputViewport(u32 x, u32 y, u32 w, u32 h)
Sets the output viewport for the final blit.
void drawSelectionGround(TextureHandle depth)
The selection mask's ground, into the bound mask target: the scene's depth in g, nothing covered.
void endScreenCapture()
Ends screen-level capture.
void setSceneNeedsDepth(bool needs)
Whether the scene target needs a depth attachment.
void setBypass(bool bypass)
Skip the EFFECTS, not the chain.
void grabDepth()
Draws, into the target being drawn, the distance to the opaque scene at every pixel (the scene's dept...
GPU shader program for rendering.
Definition Shader.hpp:86
Central manager for GPU resources.
Handle< esengine::Shader > ShaderHandle
Handle to a shader resource.
Definition Handle.hpp:214
constexpr ResourceId kNoResource
FramebufferHandle
Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted.
Definition GfxEnums.hpp:41
std::int32_t i32
Signed 32-bit integer.
Definition Types.hpp:54
std::uint64_t u64
Unsigned 64-bit integer.
Definition Types.hpp:47
OutputTransform
What the last pass of a chain does to scene values on the way out.
@ ACES
Narkowicz ACES filmic curve, for a scene that carries HDR radiance.
@ None
Encode only. Values above 1 clip, which is what LDR content means.
@ Neutral
Khronos PBR Neutral: hue and saturation survive, highlights roll off.
ComputeHandle
A compute program (GfxDevice::createCompute); only a device that supportsCompute() issues one.
Definition GfxEnums.hpp:39
std::unique_ptr< T > Unique
Unique ownership smart pointer.
Definition Types.hpp:75
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
std::uint8_t u8
Unsigned 8-bit integer.
Definition Types.hpp:41
static EstellaContext & ctx()
ReadbackHandle
An in-flight framebuffer readback (GfxDevice::requestReadback).
Definition GfxEnums.hpp:43
float f32
32-bit floating point
Definition Types.hpp:59
The format decision one frame committed to.
Definition HdrFormat.hpp:67
Post-processing pass configuration.
resource::ShaderHandle shader
std::unordered_map< std::string, f32 > floatUniforms
u32 paramUboBytes
The size paramUbo was made with: what lets the next chain's pass of the same size take it over.
std::string nativeKind
A pass the engine implements itself, in compute passes of its own (see VoxelGI): its name,...
std::vector< std::pair< std::string, u32 > > textureUniforms
u64 historyKey
Which remembered state the pass uses, resolved when the chain is declared.
std::vector< std::pair< std::string, rg::ResourceId > > earlierInputs
std::vector< std::string > computeParams
std::unordered_map< std::string, glm::vec4 > vec4Uniforms
What a temporal view would be given by its NEXT begin: the sub-pixel shift and last frame's camera.
glm::vec2 previousJitter
The shift the previous frame was drawn with.
Shape of a target the graph allocates.