dotrix_pbr::EncodeTask -> it provides following output: type Output = gpu::Commands;
dotrix_gpu::SubmitCommands -> it takes gpu::Commands from all tasks, sorts them according to priority and executes. As an output, there will be type Output = FrameOutput that has already the ready frame texture.
The gpu::Commands are important. They cover different rendering parts:
Clear up the frame
Render skybox/skydome
Render terrain
Render all PBR objects
Optional post-processing of the 3D scene
Render overlay (UI)
Optional post-processing that will affect UI too
Each task that provides gpu::Commands also defines their priority:
encoder.finish(self.priority)
Using the priority you can affect the order of commands.
In other words, post-processing could be just a new task, that will encode appropriate commands with selected effects.
This brings us to a concept of a new dotrix_postprocess crate, that should be created as a result of this issue.
The crate will provide some data structure called PostProcess that will implement configuration for the effects.
A user can create a new task in his/her app, that will run under user-defined conditions (state, dependencies etc) with specific post-processing effect and then encode the commands with selected priority.
The only technical complication that is left to solve is double frame buffer. Current frame texture is stored in dotrix_gpu::Gpu::frame_texture. We will need to solve where we render what and when and which one we display in the end :)
Check two tasks:
type Output = gpu::Commands;
gpu::Commands
from all tasks, sorts them according to priority and executes. As an output, there will betype Output = FrameOutput
that has already the ready frame texture.The
gpu::Commands
are important. They cover different rendering parts:Each task that provides
gpu::Commands
also defines their priority:Using the priority you can affect the order of commands.
In other words, post-processing could be just a new task, that will encode appropriate commands with selected effects.
dotrix_postprocess
crate, that should be created as a result of this issue.PostProcess
that will implement configuration for the effects.The only technical complication that is left to solve is double frame buffer. Current frame texture is stored in
dotrix_gpu::Gpu::frame_texture
. We will need to solve where we render what and when and which one we display in the end :)