Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
PostProcessBindings.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#pragma once
4
5
6#include "../core/Types.hpp"
7#include <string>
8
9namespace esengine {
10
11bool postprocess_init(u32 width, u32 height);
13void postprocess_resize(u32 width, u32 height);
14u32 postprocess_addPass(const std::string& name, u32 shaderHandle);
20u32 postprocess_addComputePass(const std::string& name, const std::string& wgsl, const std::string& params,
21 u32 workgroupX, u32 workgroupY);
28u32 postprocess_addNativePass(const std::string& name, const std::string& kind);
34bool postprocess_setGIScene(uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfCount, uintptr_t instancesPtr, u32 instanceCount,
35 uintptr_t pixelsPtr, u32 pixelCount);
41bool postprocess_updateGIField(uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfOffset, u32 sdfCount);
50
59i32 postprocess_hdrFormat(uintptr_t outPtr);
60
66void postprocess_setPassScale(const std::string& passName, f32 scale);
68void postprocess_setPassContinuesEffect(const std::string& passName);
70void postprocess_requestSkyCapture(const std::string& passName, u32 width, u32 height);
74bool postprocess_takeSkyCapture(uintptr_t dst, u32 bytes);
76u32 postprocess_giStats(uintptr_t dst, u32 capacity);
77void postprocess_setUniformFloat(const std::string& passName,
78 const std::string& uniform, f32 value);
79void postprocess_setPassTexture(const std::string& passName,
80 const std::string& uniform, u32 textureHandle);
81void postprocess_setUniformVec4(const std::string& passName,
82 const std::string& uniform,
83 f32 x, f32 y, f32 z, f32 w);
87void postprocess_setBypass(bool bypass);
91void postprocess_setDisplayLut(u32 textureHandle, f32 amount);
99
103u32 postprocess_addScreenPass(const std::string& name, u32 shaderHandle);
105void postprocess_setScreenUniformFloat(const std::string& passName,
106 const std::string& uniform, f32 value);
107void postprocess_setScreenUniformVec4(const std::string& passName,
108 const std::string& uniform,
109 f32 x, f32 y, f32 z, f32 w);
110
111} // namespace esengine
112
Core type definitions and utilities for ESEngine.
std::int32_t i32
Signed 32-bit integer.
Definition Types.hpp:54
bool postprocess_init(u32 width, u32 height)
void postprocess_setUniformVec4(const std::string &passName, const std::string &uniform, f32 x, f32 y, f32 z, f32 w)
void postprocess_clearScreenPasses()
u32 postprocess_maxMsaaSamples()
void postprocess_setBypass(bool bypass)
void postprocess_setMsaaSamples(u32 samples)
void postprocess_shutdown()
void postprocess_setPassTexture(const std::string &passName, const std::string &uniform, u32 textureHandle)
void postprocess_end()
void postprocess_setUniformFloat(const std::string &passName, const std::string &uniform, f32 value)
void postprocess_begin()
void postprocess_setPresentRequired(bool required)
void postprocess_setPassScale(const std::string &passName, f32 scale)
u32 postprocess_giStats(uintptr_t dst, u32 capacity)
i32 postprocess_hdrFormat(uintptr_t outPtr)
The format decision the last frame COMMITTED to, into four floats at outPtr: requested,...
bool postprocess_takeSkyCapture(uintptr_t dst, u32 bytes)
void postprocess_resize(u32 width, u32 height)
void postprocess_setOutputTransform(u32 transform)
bool postprocess_updateGIField(uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfOffset, u32 sdfCount)
Updates the scene the dynamic GI traces after the camera moved: the header, and sdfCount floats of th...
void postprocess_setScreenUniformVec4(const std::string &passName, const std::string &uniform, f32 x, f32 y, f32 z, f32 w)
u32 postprocess_effectiveMsaaSamples()
i32 postprocess_pollSkyCapture()
std::string postprocess_hdrFormatNames()
The last committed decision as words: "requested|effective|reason". Empty before a frame has committe...
void postprocess_requestSkyCapture(const std::string &passName, u32 width, u32 height)
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
void postprocess_executeScreenPasses()
void postprocess_setOutputViewport(u32 x, u32 y, u32 w, u32 h)
void postprocess_setDisplayLut(u32 textureHandle, f32 amount)
bool postprocess_setGIScene(uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfCount, uintptr_t instancesPtr, u32 instanceCount, uintptr_t pixelsPtr, u32 pixelCount)
Hands the dynamic GI the scene it traces: the header, the distance field, the instances and the card ...
void postprocess_beginScreenCapture()
void postprocess_setScreenUniformFloat(const std::string &passName, const std::string &uniform, f32 value)
void postprocess_clearPasses()
u32 postprocess_addPass(const std::string &name, u32 shaderHandle)
u32 postprocess_addNativePass(const std::string &name, const std::string &kind)
Adds a pass the engine implements itself ("voxelGI"); its parameters are set by name like any pass's.
void postprocess_endScreenCapture()
void postprocess_setPassContinuesEffect(const std::string &passName)
bool postprocess_isInitialized()
void postprocess_setViewExposure(f32 ev)
u32 postprocess_addScreenPass(const std::string &name, u32 shaderHandle)
float f32
32-bit floating point
Definition Types.hpp:59
bool postprocess_supportsCompute()
Whether compute passes run on this device: WebGPU yes, WebGL2 no.
u32 postprocess_addComputePass(const std::string &name, const std::string &wgsl, const std::string &params, u32 workgroupX, u32 workgroupY)
Adds a pass that is a WGSL compute shader over the picture (see PostProcessPipeline::addComputePass).