35 float ambient[3] = { 0.35f, 0.35f, 0.35f };
87 const glm::vec3& top,
const glm::vec3& bottom);
93 void drawGrid(
float size = 40.0f,
float step = 1.0f);
97 float nearPlane = 0.1f,
float farPlane = 6400.0f);
100 void applyView(
const glm::mat4& viewMatrix);
104 const glm::vec3& clearColor);
113 const glm::vec3& clearColor,
bool drawGrid,
114 const std::function<
void()>& drawObjects);
Orbit camera that revolves around a target point.
void renderScene(ViewportFBO &fbo, int w, int h, const OrbitCamera &camera, float fov, const glm::vec3 &clearColor, bool drawGrid, const std::function< void()> &drawObjects)
void applyProjection(int w, int h, float fov, float nearPlane=0.1f, float farPlane=6400.0f)
Load a perspective projection matrix.
void beginPass(ViewportFBO &fbo, int w, int h, const glm::vec3 &clearColor)
Begin an off-screen FBO render pass (resize, bind, clear).
void init()
Create GPU resources. Call once after the OpenGL context is current.
void applyLighting()
Configure OpenGL fixed-function lighting from the current state.
void drawGrid(float size=40.0f, float step=1.0f)
Draw a ground grid with highlighted centre axes.
RenderState & state() noexcept
void drawBackground(int w, int h)
Draw the background (checker or gradient) based on current state.
void drawCheckerboard(int w, int h)
Draw a tiled checkerboard pattern in screen space.
Renderer & operator=(const Renderer &)=delete
const RenderState & state() const noexcept
Renderer(const Renderer &)=delete
void shutdown()
Release GPU resources.
GLuint checkerTexture() const noexcept
void applyView(const glm::mat4 &viewMatrix)
Load a view (camera) matrix.
void endPass(ViewportFBO &fbo)
End the current FBO render pass (unbind).
void drawGradient(int w, int h, const glm::vec3 &top, const glm::vec3 &bottom)
Draw a vertical gradient quad in screen space.
Plain-data description of a single light source.
Aggregate rendering state exposed for UI binding.
Simple OpenGL framebuffer object wrapper for off-screen rendering.