diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-06-28 19:33:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-06-30 23:45:42 +0300 |
commit | f18067aa032a35e8a6cc990b5c250567d0f4d78f (patch) | |
tree | d7521c5a487952d2f9855ba7492943a6713b0516 /source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh | |
parent | a9696f04a012ce23ef419afe489378d1ce840638 (diff) |
EEVEE-Next: Add Film and RenderBuffers module
This modules handles renderpasses allocation and filling. Also handles
blitting to viewport framebuffer and render result reading.
Changes against the old implementation:
- the filling of the renderpasses happens all at once requiring
only 1 geometry pass.
- The filtering is optimized with weights precomputed on CPU and
reuse of neighboor pixels.
- Only one accumulation buffer for renderpasses (no ping-pong).
- Accumulation happens in one pass for every passes using a single
dispatch or fullscreen triangle pass.
TAA and history reprojection is not yet implemented.
AOVs support is present but with a 16 AOV limit for now.
Cryptomatte is not yet implemented.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh b/source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh new file mode 100644 index 00000000000..8c91fed2f0f --- /dev/null +++ b/source/blender/draw/engines/eevee_next/eevee_renderbuffers.hh @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2022 Blender Foundation. + */ + +/** \file + * \ingroup eevee + * + * Render buffers are textures that are filled during a view rendering. + * Their content is then added to the accumulation buffers of the film class. + * They are short lived and can be reused when doing multi view rendering. + */ + +#pragma once + +#include "DRW_render.h" + +#include "eevee_shader_shared.hh" + +namespace blender::eevee { + +class Instance; + +class RenderBuffers { + public: + TextureFromPool depth_tx; + TextureFromPool combined_tx; + + // TextureFromPool mist_tx; /* Derived from depth_tx during accumulation. */ + TextureFromPool normal_tx; + TextureFromPool vector_tx; + TextureFromPool diffuse_light_tx; + TextureFromPool diffuse_color_tx; + TextureFromPool specular_light_tx; + TextureFromPool specular_color_tx; + TextureFromPool volume_light_tx; + TextureFromPool emission_tx; + TextureFromPool environment_tx; + TextureFromPool shadow_tx; + TextureFromPool ambient_occlusion_tx; + // TextureFromPool cryptomatte_tx; /* TODO */ + /* TODO(fclem): Use texture from pool once they support texture array. */ + Texture aov_color_tx; + Texture aov_value_tx; + + private: + Instance &inst_; + + public: + RenderBuffers(Instance &inst) : inst_(inst){}; + + void sync(); + /* Acquires (also ensures) the render buffer before rendering to them. */ + void acquire(int2 extent, void *owner); + void release(); +}; + +} // namespace blender::eevee |