Begin clean-up
This commit is contained in:
@@ -19,7 +19,6 @@ struct DirectionalLightJob : RenderJob
|
|||||||
Direction = glm::vec4(0,0,-1,0) * glm::inverse(Orientation);
|
Direction = glm::vec4(0,0,-1,0) * glm::inverse(Orientation);
|
||||||
Color = (glm::vec4)directionalLightComponent["Color"];
|
Color = (glm::vec4)directionalLightComponent["Color"];
|
||||||
Intensity = (double)directionalLightComponent["Intensity"];
|
Intensity = (double)directionalLightComponent["Intensity"];
|
||||||
//TextureAlphaShadows = (bool)directionalLightComponent["TextureAlphaShadows"];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
glm::quat Orientation;
|
glm::quat Orientation;
|
||||||
|
|||||||
@@ -8,12 +8,10 @@ class BufferResource
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment);
|
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment);
|
||||||
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment, GLuint layers);
|
|
||||||
|
|
||||||
GLuint* m_ResourceHandle;
|
GLuint* m_ResourceHandle;
|
||||||
GLenum m_ResourceType;
|
GLenum m_ResourceType;
|
||||||
GLenum m_Attachment;
|
GLenum m_Attachment;
|
||||||
GLuint m_Layers;
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -24,9 +22,6 @@ class ResourceType : public BufferResource
|
|||||||
public:
|
public:
|
||||||
ResourceType(GLuint* resourceHandle, GLenum attachment)
|
ResourceType(GLuint* resourceHandle, GLenum attachment)
|
||||||
: BufferResource(resourceHandle, RESOURCETYPE, attachment) { }
|
: BufferResource(resourceHandle, RESOURCETYPE, attachment) { }
|
||||||
|
|
||||||
ResourceType(GLuint* resourceHandle, GLenum attachment, GLuint layers)
|
|
||||||
: BufferResource(resourceHandle, RESOURCETYPE, attachment, layers) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Texture2D : public ResourceType<GL_TEXTURE_2D>
|
class Texture2D : public ResourceType<GL_TEXTURE_2D>
|
||||||
@@ -48,15 +43,6 @@ public:
|
|||||||
~RenderBuffer();
|
~RenderBuffer();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Texture2DArray : public ResourceType<GL_TEXTURE_2D_ARRAY>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Texture2DArray(GLuint* resourceHandle, GLenum attachment, GLuint layers)
|
|
||||||
: ResourceType(resourceHandle, attachment, layers) { };
|
|
||||||
|
|
||||||
~Texture2DArray();
|
|
||||||
};
|
|
||||||
|
|
||||||
class FrameBuffer
|
class FrameBuffer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
GLuint DepthMap() const { return m_DepthMap; }
|
GLuint DepthMap() const { return m_DepthMap; }
|
||||||
std::array<glm::mat4, MAX_SPLITS> LightP() const { return m_LightProjection; }
|
std::array<glm::mat4, MAX_SPLITS> LightP() const { return m_LightProjection; }
|
||||||
std::array<glm::mat4, MAX_SPLITS> LightV() const { return m_LightView; }
|
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 }; }
|
std::array<float, MAX_SPLITS> FarDistance() const { std::array<float, MAX_SPLITS> f; for (int i = 0; i < MAX_SPLITS; i++) f[i] = m_shadowFrusta[i].FarClip; return f; }
|
||||||
int CurrentNrOfSplits() const { return m_CurrentNrOfSplits; }
|
int CurrentNrOfSplits() const { return m_CurrentNrOfSplits; }
|
||||||
|
|
||||||
void SetSplitWeight(float split_weight) { m_SplitWeight = split_weight; };
|
void SetSplitWeight(float split_weight) { m_SplitWeight = split_weight; };
|
||||||
|
|||||||
@@ -2,6 +2,5 @@
|
|||||||
<DirectionalLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DirectionalLight.xsd">
|
<DirectionalLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DirectionalLight.xsd">
|
||||||
<Color R="1" G="1" B="1" A="1"/>
|
<Color R="1" G="1" B="1" A="1"/>
|
||||||
<Intensity>0.8</Intensity>
|
<Intensity>0.8</Intensity>
|
||||||
<!--<TextureAlphaShadows>false</TextureAlphaShadows>-->
|
|
||||||
<Visible>true</Visible>
|
<Visible>true</Visible>
|
||||||
</DirectionalLight>
|
</DirectionalLight>
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="Color" type="t:Color" minOccurs="0"/>
|
<xs:element name="Color" type="t:Color" minOccurs="0"/>
|
||||||
<xs:element name="Intensity" type="t:double" minOccurs="0"/>
|
<xs:element name="Intensity" type="t:double" minOccurs="0"/>
|
||||||
<!--<xs:element name="TextureAlphaShadows" type="t:bool" minOccurs="0"/>-->
|
|
||||||
<xs:element name="Visible" type="t:bool" minOccurs="0"/>
|
<xs:element name="Visible" type="t:bool" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|||||||
@@ -9,14 +9,6 @@ BufferResource::BufferResource(GLuint* resourceHandle, GLenum resourceType, GLen
|
|||||||
m_Attachment = attachment;
|
m_Attachment = attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferResource::BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment, GLuint layers)
|
|
||||||
{
|
|
||||||
m_ResourceHandle = resourceHandle;
|
|
||||||
m_ResourceType = resourceType;
|
|
||||||
m_Attachment = attachment;
|
|
||||||
m_Layers = layers;
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture2D::~Texture2D()
|
Texture2D::~Texture2D()
|
||||||
{
|
{
|
||||||
if (m_ResourceHandle != 0) {
|
if (m_ResourceHandle != 0) {
|
||||||
@@ -24,13 +16,6 @@ Texture2D::~Texture2D()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture2DArray::~Texture2DArray()
|
|
||||||
{
|
|
||||||
if (m_ResourceHandle != 0) {
|
|
||||||
glDeleteTextures(1, m_ResourceHandle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderBuffer::~RenderBuffer()
|
RenderBuffer::~RenderBuffer()
|
||||||
{
|
{
|
||||||
if (m_ResourceHandle != 0) {
|
if (m_ResourceHandle != 0) {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ void ShadowPass::InitializeFrameBuffers()
|
|||||||
glTexParameterfv(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BORDER_COLOR, glm::vec4(1.f).data);
|
glTexParameterfv(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BORDER_COLOR, glm::vec4(1.f).data);
|
||||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||||
|
|
||||||
m_DepthBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2DArray(&m_DepthMap, GL_DEPTH_ATTACHMENT, m_CurrentNrOfSplits)));
|
m_DepthBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_DepthMap, GL_DEPTH_ATTACHMENT)));
|
||||||
m_DepthBuffer.Generate();
|
m_DepthBuffer.Generate();
|
||||||
|
|
||||||
GLERROR("depthMap failed END");
|
GLERROR("depthMap failed END");
|
||||||
|
|||||||
Reference in New Issue
Block a user