1#ifndef DANDELION_RENDER_GRAPHICS_INTERFACE_H
2#define DANDELION_RENDER_GRAPHICS_INTERFACE_H
9#include <Eigen/Geometry>
10#include <spdlog/spdlog.h>
84 const std::list<Light>& lights,
const Camera& camera
158 void set_pixel(
int index,
float depth,
const Eigen::Vector3f& color);
191 static Eigen::Matrix4f
MVP;
一个最简化的 Frame Buffer 。
定义 graphics_interface.h:138
void set_pixel(int index, float depth, const Eigen::Vector3f &color)
设置当前像素点的颜色
定义 render_engine.cpp:52
std::vector< float > depth_buffer
定义 graphics_interface.h:175
FrameBuffer(int width, int height)
定义 rasterizer_renderer.cpp:47
std::vector< Eigen::Vector3f > color_buffer
定义 graphics_interface.h:173
int width
定义 graphics_interface.h:145
void clear(BufferType buff)
初始化指定类型的 buffer。
定义 render_engine.cpp:42
std::vector< SpinLock > spin_locks
定义 graphics_interface.h:180
自旋锁
定义 graphics_interface.h:116
std::atomic_flag locked
定义 graphics_interface.h:127
void unlock()
定义 render_engine.cpp:37
void lock()
定义 render_engine.cpp:26
Eigen::Vector3f phong_fragment_shader(const FragmentShaderPayload &payload, const GL::Material &material, const std::list< Light > &lights, const Camera &camera)
使用 Blinn Phong 着色模型计算每个片元(像素)的颜色。
定义 render/shader.cpp:38
BufferType
用于选择 buffer 的类型
定义 graphics_interface.h:93
VertexShaderPayload vertex_shader(const VertexShaderPayload &payload)
计算顶点的各项属性几何变化。
定义 render/shader.cpp:14
表示观察点的相机,既可以用于预览视角,也可以用于渲染视角。
定义 camera.h:24
存放实现渲染管线所需的一些全局数据。
定义 graphics_interface.h:214
static volatile bool fragment_finish
定义 graphics_interface.h:229
static std::mutex vertex_queue_mutex
定义 graphics_interface.h:216
static std::queue< VertexShaderPayload > vertex_shader_output_queue
定义 graphics_interface.h:220
static std::mutex rasterizer_queue_mutex
定义 graphics_interface.h:218
static std::queue< FragmentShaderPayload > rasterizer_output_queue
定义 graphics_interface.h:222
static volatile bool vertex_finish
定义 graphics_interface.h:225
static volatile bool rasterizer_finish
定义 graphics_interface.h:227
static FrameBuffer frame_buffer
定义 graphics_interface.h:232
片元着色器的输入单位。
定义 graphics_interface.h:45
Eigen::Vector3f color
定义 graphics_interface.h:55
float depth
定义 graphics_interface.h:53
int x
定义 graphics_interface.h:51
Eigen::Vector3f world_normal
定义 graphics_interface.h:49
Eigen::Vector3f world_pos
定义 graphics_interface.h:47
顶点着色器的输入和输出单位。
定义 graphics_interface.h:27
Eigen::Vector4f world_position
定义 graphics_interface.h:29
Eigen::Vector4f viewport_position
定义 graphics_interface.h:31
Eigen::Vector3f normal
定义 graphics_interface.h:33