Initial work on texture arrays
This commit is contained in:
@@ -8,10 +8,12 @@ class BufferResource
|
||||
{
|
||||
public:
|
||||
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment);
|
||||
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment, GLuint layers);
|
||||
|
||||
GLuint* m_ResourceHandle;
|
||||
GLenum m_ResourceType;
|
||||
GLenum m_Attachment;
|
||||
GLuint m_Layers;
|
||||
private:
|
||||
|
||||
};
|
||||
@@ -22,6 +24,9 @@ class ResourceType : public BufferResource
|
||||
public:
|
||||
ResourceType(GLuint* resourceHandle, GLenum attachment)
|
||||
: BufferResource(resourceHandle, RESOURCETYPE, attachment) { }
|
||||
|
||||
ResourceType(GLuint* resourceHandle, GLenum attachment, GLuint layers)
|
||||
: BufferResource(resourceHandle, RESOURCETYPE, attachment, layers) { }
|
||||
};
|
||||
|
||||
class Texture2D : public ResourceType<GL_TEXTURE_2D>
|
||||
@@ -43,6 +48,15 @@ public:
|
||||
~RenderBuffer();
|
||||
};
|
||||
|
||||
class Texture2DArray : public ResourceType<GL_TEXTURE_2D_ARRAY>
|
||||
{
|
||||
public:
|
||||
Texture2DArray(GLuint* resourceHandle, GLenum attachment, GLuint layers)
|
||||
: ResourceType(resourceHandle, attachment, layers) { };
|
||||
|
||||
~Texture2DArray();
|
||||
};
|
||||
|
||||
class FrameBuffer
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
void ClearBuffer();
|
||||
void Draw(RenderScene& scene);
|
||||
|
||||
GLuint DepthMap(int level) const { return m_DepthMap[level]; }
|
||||
//GLuint DepthMap(int level) const { return m_DepthMap[level]; }
|
||||
GLuint DepthMap() const { return m_DepthMap; }
|
||||
std::array<glm::mat4, MAX_SPLITS> LightP() const { return m_LightProjection; }
|
||||
std::array<glm::mat4, MAX_SPLITS> LightV() const { return m_LightView; }
|
||||
std::array<float, MAX_SPLITS> FarDistance() const { return { m_shadowFrusta[0].FarClip, m_shadowFrusta[1].FarClip, m_shadowFrusta[2].FarClip, m_shadowFrusta[3].FarClip }; }
|
||||
@@ -55,8 +56,10 @@ private:
|
||||
EventBroker* m_EventBroker;
|
||||
const IRenderer* m_Renderer;
|
||||
|
||||
std::array<GLuint, MAX_SPLITS> m_DepthMap;
|
||||
std::array<FrameBuffer, MAX_SPLITS> m_DepthBuffer;
|
||||
//std::array<GLuint, MAX_SPLITS> m_DepthMap;
|
||||
//std::array<FrameBuffer, MAX_SPLITS> m_DepthBuffer;
|
||||
GLuint m_DepthMap;
|
||||
FrameBuffer m_DepthBuffer;
|
||||
|
||||
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
||||
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
||||
|
||||
Reference in New Issue
Block a user