Closed ilexp closed 7 years ago
Id
field can be used to identify these relative pivots.Id
field to each pass, so they can be identified without relying on direct references.Note: Consider renaming RenderPass to RenderStep, since pass is a term that is usually used in the context of rendering an object in multiple stages.
Note: Consider going one step further and make the rendering setup itself (by default, it's "foreach Camera") configurable.
Note: Consider re-introducing Camera viewports, so each Camera can define the (relative) region to render to. In addition, each rendering step should allow to specify a viewport rect relative to the Camera viewport.
Note: Consider allowing a Camera to specify a base rendertarget that will be used whenever the rendering step would render to screen.
Note: Consider how the editor / Camera Views would interact with the new setup. Does it make sense to allow users to specify a Rendering and / or Camera Setup to use for every Camera View?
Note: Consider allowing to configure a rendering step as to whether the RenderTarget to bind should be auto-resized to the TargetResolution before rendering. This could be the default setting, while it would still be possible to assert that the Resource-specified size should be used.
RenderSetup
Resource and RenderStep
class.RenderSetup
Resources.Camera
class and dependencies.Camera
as outlined above using a before / after ID ordering and hardcoded special IDs for first and last.DualityAppData
.RenderSetup
API to allow overriding custom scene rendering code.master
branch to help with the common "resize X to fit Y" problem.viewportRect
parameter that is passed all over works properly, especially with regard to Y position and height. Would it make sense to replace it with a Point2 outputSize
?InputResize
setting to RenderStep
that specifies how a given input will be scaled in order to fit the expected output size.DualityApp.TargetResolution
.viewportRect
parameter passed to rendering methods in Camera and to DrawDevice via property will only adjust the target viewport, stretching the image that is rendered.viewportRect
parameter works properly, especially with regard to Y position and height.TargetResolution
where it can be avoided.Camera.RenderPickingMap
to match its active rendering setup's screen space transformations.
DrawDevice.ViewportRect
is now properly translated to OpenGL coordinates in the backend, so viewports on that level are fully supported now.DrawDevice.TargetSize
property that defined the size of the rendered image, i.e. the one that is used for generating the projection matrices. It is now decoupled from ViewportRect
, so adjusting the viewport stretches and scales the rendered content as expected.Camera
render API to specify viewport and target image size via separate parameters.Camera.RenderPickingMap
to match its active rendering setup's final target-to-screen transformations.
DualityAppData
settings that can be used to maintain a fixed image size across multiple resolutions by auto-adjusting the viewport rect.TargetRect
property which acts as issue #433 intended.extract-render-setup-wip
to develop-3.0
.Done. Closing this.
Summary
Right now, every Camera instance has its own configuration of rendering passes. The only viable way to share them among different Cameras is using a Prefab, which may have side effects that are not intended or wanted by the user. Sharing rendering setups is the default case, so it should be easy and straight-forward.
Workaround
Analysis