This commit is contained in:
Tleety
2016-01-27 18:07:05 +01:00
parent 97cbc55223
commit 8bcafc1151
7 changed files with 44 additions and 5 deletions
-3
View File
@@ -40,9 +40,6 @@ public:
virtual void Draw(RenderFrame& rq) = 0;
virtual PickData Pick(glm::vec2 screenCord) = 0;
World* m_World; //Temp world, untill viktor merge.
protected:
Rectangle m_Resolution = Rectangle::Rectangle(1280, 720);
Rectangle m_ViewPortWidth = Rectangle::Rectangle(1280, 720);
+1
View File
@@ -11,6 +11,7 @@
<xs:include schemaLocation="Components/AABB.xsd"/>
<xs:include schemaLocation="Components/PointLight.xsd"/>
<xs:include schemaLocation="Components/DirectionalLight.xsd"/>
<xs:include schemaLocation="Components/SceneLight.xsd"/>
<xs:include schemaLocation="Components/Trigger.xsd"/>
<xs:include schemaLocation="Components/ExplosionEffect.xsd"/>
<xs:include schemaLocation="Components/Health.xsd"/>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SceneLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SceneLight.xsd">
<AmbientColor R="0.2" G="0.2" B="0.2" A="1"/>
<Visible>true</Visible>
<Gamma>2.2</Gamma>
<Exposure>1</Exposure>
</SceneLight>
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="SceneLight">
<xs:annotation>
<xs:documentation>Some settings for the scene lighting</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="AmbientColor" type="t:Color" minOccurs="0">
<xs:annotation><xs:documentation>Color of the ambient light</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="Visible" type="t:bool" minOccurs="0">
<xs:annotation><xs:documentation>Wether the ambient light should be applied or not</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="Gamma" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>Gamma correction for the scene</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="Exposure" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>The exposure of the camera</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+1
View File
@@ -31,6 +31,7 @@
<xs:element ref="c:PlayerSpawn" minOccurs="0"/>
<xs:element ref="c:Team" minOccurs="0"/>
<xs:element ref="c:DirectionalLight" minOccurs="0"/>
<xs:element ref="c:SceneLight" minOccurs="0"/>
<xs:element ref="c:UniformScale" minOccurs="0"/>
<xs:element ref="c:EditorWidget" minOccurs="0"/>
<xs:element ref="c:Lifetime" minOccurs="0"/>
@@ -22,8 +22,6 @@ void DrawColorCorrectionPass::InitializeShaderPrograms()
void DrawColorCorrectionPass::Draw(GLuint sceneTexture, GLuint bloomTexture)
{
ImGui::DragFloat("Exposure", &m_Exposure, 0.01f, 0.f, 10.f, "%.2f", 1.f);
ImGui::DragFloat("Gamma", &m_Gamma, 0.01f, 0.f, 50.f, "%.2f", 1.f);
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
GLERROR("DrawScreenQuadPass::Draw: Pre");
+10
View File
@@ -244,6 +244,16 @@ void RenderSystem::Update(double dt)
RenderScene scene;
scene.Camera = m_Camera;
scene.Viewport = Rectangle(1280, 720);
//auto cSceneLight = m_Renderer->m_World->GetComponents("SceneLight");
//if (cSceneLight != nullptr) {
// m_Gamma = (double)(*cSceneLight->begin())["Gamma"];
// m_Exposure = (double)(*cSceneLight->begin())["Exposure"];
//}
//scene.ambient
//scene.gamma
//scene.exponent
fillModels(scene.OpaqueObjects, scene.TransparentObjects);
fillPointLights(scene.PointLightJobs, m_World);
fillDirectionalLights(scene.DirectionalLightJobs, m_World);