summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowStenciller.h
blob: 460fa6885828c832eea29c696f9df47636512c7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include "config/types.h"
#include "gfx/gl/program.h"
#include "gfx/models/mesh.h"
#include "glArrays.h"

class ShadowStenciller {
public:
	ShadowStenciller();

	[[nodiscard]]
	static glTexture createStencilTexture(GLsizei width, GLsizei height);
	void renderStencil(const glTexture &, const MeshBase &, const RelativePosition3D & mins,
			const RelativePosition3D & maxs) const;

private:
	glFrameBuffer fbo;
	Program shadowCaster;
	Program::UniformLocation viewProjectionLoc {shadowCaster, "viewProjection"};
};