44 void setQuality(
const std::string &quality);
49 void setMode(
const std::string &mode);
51 std::string
getMode()
const {
return mode_; }
54 bool hasParam(
const std::string &
name)
const;
56 void setFloat(
const std::string &
name,
float value);
58 float getFloat(
const std::string &
name)
const;
65 float suggestScale()
const;
69 int resolutionFor(
int destSize)
const;
78 float height,
float r = 1.f,
float g = 1.f,
float b = 1.f,
97 Texture *getTemporalReadTexture()
const;
99 void endTemporalFrame();
101 glm::vec2 prepareTemporalJitter(
int width,
int height);
103 void setTemporalCamera(
const glm::vec3 &
eye,
const glm::vec3 &
target,
float fovYDeg);
105 void invalidateTemporalHistory();
107 void setTemporalViewProjection(
const glm::mat4 &viewProjection,
float nearZ,
float farZ);
109 glm::vec2 prepareTemporalObjectMotion(
const void *objectKey,
const glm::mat4 &
model);
133 Shader *getShader()
const;
136 void applyQualityDefaults();
142 void swapHistoryBuffers();
144 Shader *shaderForMode()
const;
152 std::string quality_ =
"medium";
153 std::string mode_ =
"fxaa";
155 Canvas *taaHistoryA_ =
nullptr;
156 Canvas *taaHistoryB_ =
nullptr;
157 Canvas *historyRead_ =
nullptr;
158 Canvas *historyWrite_ =
nullptr;
159 bool taaHistoryValid_ =
false;
162 uint32_t temporalFrameIndex_ = 0;
163 glm::vec2 temporalJitterNdc_{0.f};
164 glm::vec2 previousJitterNdc_{0.f};
165 glm::vec3 temporalEye_{0.f};
166 glm::vec3 temporalForward_{0.f, 0.f, -1.f};
167 float temporalFovY_ = 0.f;
168 bool temporalCameraValid_ =
false;
169 glm::mat4 temporalViewProj_{1.f};
170 glm::mat4 previousViewProj_{1.f};
171 float temporalNearZ_ = 0.1f;
172 float temporalFarZ_ = 100.f;
173 bool temporalViewValid_ =
false;
174 std::unordered_map<const void *, glm::mat4> temporalObjectHistory_;
175 std::unordered_map<const void *, glm::mat4> temporalObjectPending_;
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.