2D Signed Distance Field (SDF) example.
class SDFDemoApp : public RenderApplication {
createPSFullscreenPass(
[=](PassHandle self, Renderer* r) {
r->BindShader(self, RHIShaderStageBits::Fragment, "fragMain", "data/shaders/SDF2D.spv");
r->BindPushConstant(self, RHIShaderStageBits::Fragment, 0, sizeof(float));
},
[=, this](PassHandle self, Renderer* r, RHICommandList* cmd) {
r->CmdSetPushConstant(self, cmd, RHIShaderStageBits::Fragment, 0, GetApplicationTime());
}
);
}
};
}
int main(
int argc,
char** argv) {
app.
Initialize<VulkanApplication>({ .windowTitle =
"SDF2D" });
}
int main(int argc, char **argv)
Definition ImGui.cpp:26
void OnRendererSetup() override
Set up the renderer by creating passes, resources, and other configurations.
Definition SDF2D.cpp:10
void Initialize(ApplicationInitDesc const &desc={}, Args &&... args)
Initialize the application with the specified RHI backend.
Definition Application.hpp:205
UniquePtr< Renderer > mRenderer
Definition Application.hpp:102
void RunForever()
Start the Render thread and run the application loop indefinitely, until the window is closed or the ...
Definition Application.cpp:127
For a complete list of examples, see the Examples Page.
Definition Examples.hpp:12