在Blender中有多个引擎,其中Eevee引擎的特性是实时渲染性能好,这个系列的文章将以分析Eevee引擎的设计方法为目的,逐步探究Blender中为渲染工作所设计的各种类的作用。
GPUBackend类是一个充分包含渲染管线资源的虚类,先看一下它的定义。
namespace blender {
namespace gpu {
class Context;
class Batch;
class DrawList;
class Fence;
class FrameBuffer;
class IndexBuf;
class PixelBuffer;
class QueryPool;
class Shader;
class Texture;
class UniformBuf;
class StorageBuf;
class VertBuf;
class GPUBackend {
public:
virtual ~GPUBackend() = default;
virtual void delete_resources() = 0;
static GPUBackend *get();
virtual void samplers_update() = 0;
virtual void compute_dispatch(int groups_x_len, int groups_y_len, int groups_z_len) = 0;
virtual void compute_dispatch_indirect(StorageBuf *indirect_buf) = 0;
virtual Context *context_alloc(void *ghost_window, void *ghost_context) = 0;
virtual Batch *batch_alloc() = 0;
virtual DrawList *drawlist_alloc(int list_length) = 0;
virtual Fence *fence_alloc() = 0;
virtual FrameBuffer *framebuffer_alloc

本文分析了Blender中Eevee引擎的设计,重点讨论了GPUBackend类在实时渲染中的作用,以及如何通过动态绑定管理OpenGL下的渲染管线资源,如GLShader和相关类的实例化过程。
最低0.47元/天 解锁文章
1478

被折叠的 条评论
为什么被折叠?



