]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
more BufferClasses
authorPeter Schaefer <schaeferpm@gmail.com>
Thu, 14 Apr 2016 17:21:10 +0000 (19:21 +0200)
committerPeter Schaefer <schaeferpm@gmail.com>
Thu, 14 Apr 2016 17:21:10 +0000 (19:21 +0200)
23 files changed:
Weave/Graphix/Model/Model.cpp
Weave/Graphix/Model/Model.h
Weave/Graphix/Model/Plane.h
Weave/Graphix/Shader.cpp
Weave/Graphix/Textures.h
Weave/Graphix/Textures/BufferObject.cpp [new file with mode: 0644]
Weave/Graphix/Textures/BufferObject.h [new file with mode: 0644]
Weave/Graphix/Textures/Texture.cpp
Weave/Graphix/Textures/Texture.h
Weave/Graphix/Textures/fBufferObject.cpp [new file with mode: 0644]
Weave/Graphix/Textures/fBufferObject.h [new file with mode: 0644]
Weave/Graphix/Textures/rBufferObject.cpp [new file with mode: 0644]
Weave/Graphix/Textures/rBufferObject.h [new file with mode: 0644]
Weave/Graphix/Textures/tBuffer.cpp [deleted file]
Weave/Graphix/Textures/tBuffer.h [deleted file]
Weave/Graphix/Textures/tImage.cpp
Weave/Graphix/Textures/tImage.h
Weave/Scene/Scene.cpp
Weave/Scene/Scene.h
Weave/Weave.vcxproj
Weave/Weave.vcxproj.filters
shader/basicTexture_FS.hlsl
shader/lightingTexture_FS.hlsl

index c819389ad3d91611725ca59d7673f8061367239c..4a286121c8e0dbfafe21108e44a9b0aa071552d9 100644 (file)
@@ -15,6 +15,7 @@
 #include "BBox.h"\r
 #include "SkyBox.h"\r
 #include "IMetaMesh.h"\r
+#include "Plane.h"\r
 \r
 #include "../../Events.h"\r
 \r
@@ -237,6 +238,17 @@ Model* Model::getBBoxModel()
        return BoundingBox;\r
 }\r
 \r
+Model* Model::getPlaneModel()\r
+{\r
+       if (PlaneModel == nullptr)\r
+       {\r
+               PlaneModel = new Plane();\r
+               PlaneModel->bindModel();\r
+               PlaneModel->bindShader(Shader::gBasicTexture());\r
+       }\r
+       return PlaneModel;\r
+}\r
+\r
 Model* Model::getSkyBoxModel()\r
 {\r
        if (SkyBoxModel == nullptr)\r
@@ -409,6 +421,7 @@ void Model::bt_init(bool _isConvex)
 \r
 \r
 Model* Model::BoundingBox = nullptr;\r
+Model* Model::PlaneModel = nullptr;\r
 Model* Model::SkyBoxModel = nullptr;\r
 std::unordered_map<string, Model*> Model::IMetaModel;\r
 std::unordered_map<string, uint> Model::IMetaModel_count;\r
index c14756ba8679aa47ca9c360154913d2dbc0c1d4f..eb201f1dc3cf7c0be509b018ede03c92b49e9456 100644 (file)
@@ -31,6 +31,7 @@ public:
        virtual void drawBBox(const mat4& modelMat, const vec4& color = vec4(0.9f, 0.f, 0.f, 1.f)) const;\r
 \r
        static Model* getBBoxModel();\r
+       static Model* getPlaneModel();\r
        static Model* getSkyBoxModel();\r
        static Model* newIMetaModel(const std::string& modelpath,bool isConvex=true);\r
 \r
@@ -71,6 +72,7 @@ protected:
 \r
        static Model* BoundingBox;\r
        static Model* SkyBoxModel;\r
+       static Model* PlaneModel;\r
        static std::unordered_map<std::string, Model*> IMetaModel;\r
        static std::unordered_map<std::string, uint> IMetaModel_count;\r
 \r
index 90121fb639fd71d8a66ba19c1a17dfbf14688b2d..483c74bbe89524d368b98af92e67fee10dbab21f 100644 (file)
@@ -9,10 +9,12 @@ public:
        Plane();
        ~Plane();
 
-       void drawModel() const override;
 
        void bt_init(bool isConvex = true) override;
 
        std::string type2str() const override;
+
+protected:
+       void drawModel() const override;
 };
 
index 68bd179ad6edc56d6b251d7f48a0c5b6e60868d7..2a29b5e8c357961b8a0845599278ee70cd069e12 100644 (file)
@@ -200,7 +200,7 @@ GLuint Shader::loadProgram(GLuint _shader1, GLuint _shader2){
        glAttachShader(programHandle, _shader1);
        glAttachShader(programHandle, _shader2);
 
-       glBindFragDataLocation(programHandle, 0, "fragColor");
+       //glBindFragDataLocation(programHandle, 0, "fragColor");
 
        glLinkProgram(programHandle);
 
index 45f5bc05cc771b9e1504a18979bfc475bb832f85..9b981cd3bc9eb246447a2bbd20ab32141586d76e 100644 (file)
@@ -2,4 +2,5 @@
 
 #include "Textures/Texture.h"
 //#include "Textures\tImage.h"
-#include "Textures\tBuffer.h"
+#include "Textures\fBufferObject.h"
+#include "Textures\rBufferObject.h"
\ No newline at end of file
diff --git a/Weave/Graphix/Textures/BufferObject.cpp b/Weave/Graphix/Textures/BufferObject.cpp
new file mode 100644 (file)
index 0000000..f9ca1a7
--- /dev/null
@@ -0,0 +1,18 @@
+#include "BufferObject.h"
+
+#include <GL\glew.h>
+
+
+BufferObject::BufferObject()
+{
+}
+
+
+BufferObject::~BufferObject()
+{
+}
+
+BufferObject::operator unsigned int() const
+{
+       return handle;
+}
\ No newline at end of file
diff --git a/Weave/Graphix/Textures/BufferObject.h b/Weave/Graphix/Textures/BufferObject.h
new file mode 100644 (file)
index 0000000..99843cf
--- /dev/null
@@ -0,0 +1,29 @@
+#pragma once
+class BufferObject
+{
+public:
+//     BufferObject() {};
+//     virtual ~BufferObject() = 0;
+
+       virtual void bindBuffer(unsigned int width = 0, unsigned int height = 0) = 0;
+       virtual void unbindBuffer() = 0;
+       virtual void useBuffer() const = 0;
+       virtual void clearBuffer() const = 0;
+
+       virtual void updateSize(unsigned int _width, unsigned int _height) = 0;
+
+       virtual operator unsigned int() const 
+       {
+               return handle;
+       }
+
+       virtual unsigned int getTarget() const
+       {
+               return buffer_target;
+       }
+
+protected:
+       unsigned int handle;
+       unsigned int buffer_target;
+};
+
index c0cf0769827c231e9ead8526b883b9f640e114a1..2b7fc58ab8c7229b7ba0b1f1378ab1dc659aa87e 100644 (file)
@@ -65,8 +65,14 @@ Texture::operator unsigned int() const
        return handle;
 }
 
-void Texture::bindTexture()
+void Texture::bindTexture(unsigned int _width, unsigned int _height)
 {
+       if (_width != 0 && _height != 0)
+       {
+               width = _width;
+               height = _height;
+       }
+
        glBindTexture(texture_target, handle);
 
        glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
@@ -85,19 +91,18 @@ void Texture::unbindTexture()
        glGenTextures(1, &handle);
 }
 
-void Texture::useTexture() const
+void Texture::useTexture(unsigned int _unit) const
 {
 
        /* bind Texture*/
-       int unit = 0;
-       glActiveTexture(GL_TEXTURE0 + unit);
+       glActiveTexture(GL_TEXTURE0 + _unit);
        glBindTexture(texture_target, handle);
 }
 
 void Texture::updateSize(unsigned int _width, unsigned int _height)
 {
-       width = _width;
-       height = _height;
+       if (_width == 0 || _height == 0)
+               return;
 
        glBindTexture(texture_target, handle);
        glTexImage2D(texture_target, 0, texture_internal, width, height, 0, texture_format, texture_type, data);
index 3fbc9454eb501cbc61236ee1b85e99661873d7b1..5da8a95dfc7d16764f1ad71127a6533a30a2b586 100644 (file)
@@ -16,11 +16,11 @@ public:
        Texture();
        ~Texture();
 
-       virtual void bindTexture();
+       virtual void bindTexture(unsigned int width = 0, unsigned int height = 0);
        virtual void unbindTexture();
-       virtual void useTexture() const;
+       virtual void useTexture(unsigned int i=0) const;
 
-       virtual void updateSize(unsigned int width, unsigned int height);
+       virtual void updateSize(unsigned int width = 0, unsigned int height = 0);
 
        virtual operator unsigned int() const;
 
@@ -42,7 +42,7 @@ protected:
        typedef struct texStruct
        {
                unsigned int count=0;
-               tImage* ptr=nullptr;
+               tImage* ptr=NULL;
        } texHandle;
 
        static std::unordered_map<std::string, texHandle> texture_Map;
diff --git a/Weave/Graphix/Textures/fBufferObject.cpp b/Weave/Graphix/Textures/fBufferObject.cpp
new file mode 100644 (file)
index 0000000..8ab4a66
--- /dev/null
@@ -0,0 +1,114 @@
+#include "fBufferObject.h"
+
+#include <GL\glew.h>
+#include "../Shader.h"
+#include "../../Message.h"
+
+#include "Texture.h"
+#include "rBufferObject.h"
+
+
+fBufferObject::fBufferObject(unsigned int _dim, bool _rbo) 
+       : dim(_dim)
+{
+       buffer_target = GL_FRAMEBUFFER;
+
+       /*gen Buffer*/
+       glGenFramebuffers(1, &handle);
+       
+
+       /*gen Texture*/
+       textures = new Texture[_dim];
+
+       if (_rbo)
+               rBO = new rBufferObject;
+}
+
+
+fBufferObject::~fBufferObject()
+{
+       delete textures;
+
+       if (rBO != nullptr)
+               delete rBO;
+
+       glDeleteFramebuffers(1, &handle);
+}
+
+unsigned int fBufferObject::getDim() const
+{
+       return dim;
+}
+
+Texture* fBufferObject::getTexture(unsigned int i) const
+{
+       return &textures[i];
+}
+
+void fBufferObject::bindBuffer(unsigned int _width, unsigned int _height)
+{
+
+       glBindFramebuffer(buffer_target, handle);
+
+       /*Bind Texture Buffers*/
+       unsigned int* attachments = new unsigned int[dim];
+       for (unsigned int i = 0; i < dim; i++)
+       {
+               textures[i].bindTexture(_width, _height);
+               glFramebufferTexture2D(buffer_target, GL_COLOR_ATTACHMENT0 + i, textures[i].getTTarget(), textures[i], 0);
+               attachments[i] = GL_COLOR_ATTACHMENT0 + i;
+       }
+
+       /*Bind Render Buffers*/
+       if (rBO != nullptr)
+       {
+               rBO->bindBuffer(_width, _height);
+               glFramebufferRenderbuffer(buffer_target, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, *rBO);
+       }
+       
+
+       //glDrawBuffers(dim, attachments);
+       if (glCheckFramebufferStatus(buffer_target) != GL_FRAMEBUFFER_COMPLETE)
+               Message::error("fBufferObject: Framebuffer not complete!");
+
+       delete attachments;
+}
+
+void fBufferObject::unbindBuffer()
+{
+       for (unsigned int i = 0; i < dim; i++)
+       {
+               textures[i].unbindTexture();
+       }
+
+       if (rBO != nullptr)
+               rBO->unbindBuffer();
+
+       glDeleteFramebuffers(1, &handle);
+       glGenFramebuffers(1, &handle);
+
+}
+
+void fBufferObject::useBuffer() const
+{
+       glBindFramebuffer(buffer_target, handle);
+
+}
+
+void fBufferObject::clearBuffer() const
+{
+       glBindFramebuffer(buffer_target, 0);
+}
+
+void fBufferObject::updateSize(unsigned int _width, unsigned int _height)
+{
+
+       for (unsigned int i = 0; i < dim; i++)
+       {
+               textures[i].updateSize(_width, _height);
+               
+       }
+
+       if (rBO != nullptr)
+               rBO->updateSize(_width, _height);
+}
diff --git a/Weave/Graphix/Textures/fBufferObject.h b/Weave/Graphix/Textures/fBufferObject.h
new file mode 100644 (file)
index 0000000..f8fbc04
--- /dev/null
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "BufferObject.h"
+
+class Texture;
+class rBufferObject;
+
+class fBufferObject
+       : public BufferObject
+{
+public:
+       fBufferObject(unsigned int dim=1, bool rbo = true);
+       virtual ~fBufferObject();
+
+       virtual void bindBuffer(unsigned int width = 0, unsigned int height = 0) override;
+       virtual void unbindBuffer() override;   
+
+       virtual void useBuffer() const override;
+
+       virtual void clearBuffer() const override;
+
+       void updateSize(unsigned int _width, unsigned int _height);
+
+       unsigned int getDim() const;
+       Texture* getTexture(unsigned int i = 0) const;
+
+protected:
+       unsigned int dim;
+       Texture* textures = nullptr;
+
+       rBufferObject* rBO = nullptr;
+       
+};
+
diff --git a/Weave/Graphix/Textures/rBufferObject.cpp b/Weave/Graphix/Textures/rBufferObject.cpp
new file mode 100644 (file)
index 0000000..e96ffdf
--- /dev/null
@@ -0,0 +1,53 @@
+#include "rBufferObject.h"
+
+#include <GL\glew.h>
+#include "../Shader.h"
+#include "../../Message.h"
+
+
+rBufferObject::rBufferObject()
+{
+       buffer_target = GL_RENDERBUFFER;
+
+       /*gen Buffer*/
+       glGenRenderbuffers(1, &handle);
+}
+
+
+rBufferObject::~rBufferObject()
+{
+       glDeleteRenderbuffers(1, &handle);
+}
+
+void rBufferObject::bindBuffer(unsigned int _width, unsigned int _height)
+{
+       if (_width != 0 && _height != 0)
+       {
+               width = _width;
+               height = _height;
+       }
+       glBindRenderbuffer(buffer_target, handle);
+       glRenderbufferStorage(buffer_target, GL_DEPTH_COMPONENT, width, height);
+}
+
+void rBufferObject::unbindBuffer()
+{
+       glDeleteRenderbuffers(1, &handle);
+       glGenRenderbuffers(1, &handle);
+}
+
+void rBufferObject::useBuffer() const
+{
+       glBindRenderbuffer(buffer_target, handle);
+
+}
+
+void rBufferObject::clearBuffer() const
+{
+       glBindRenderbuffer(buffer_target, 0);
+}
+
+void rBufferObject::updateSize(unsigned int _width, unsigned int _height)
+{
+       bindBuffer(_width, _height);
+}
diff --git a/Weave/Graphix/Textures/rBufferObject.h b/Weave/Graphix/Textures/rBufferObject.h
new file mode 100644 (file)
index 0000000..31f07c2
--- /dev/null
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "BufferObject.h"
+
+class rBufferObject
+       : public BufferObject
+{
+public:
+       rBufferObject();
+       virtual ~rBufferObject();
+
+       virtual void bindBuffer(unsigned int width = 0, unsigned int height = 0) override;
+       virtual void unbindBuffer() override;
+
+       virtual void useBuffer() const override;
+
+       virtual void clearBuffer() const override;
+
+       void updateSize(unsigned int _width, unsigned int _height) override;
+
+protected:
+       unsigned int width=0, height = 0;
+
+};
+
diff --git a/Weave/Graphix/Textures/tBuffer.cpp b/Weave/Graphix/Textures/tBuffer.cpp
deleted file mode 100644 (file)
index b76f95f..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "tBuffer.h"
-
-#include <GL\glew.h>
-#include "../Shader.h"
-
-
-tBuffer::tBuffer(unsigned int _dim)
-{
-       buffer_target = GL_FRAMEBUFFER;
-
-       /*gen Buffer*/
-       glGenBuffers(1, &handle);
-       
-
-       /*gen Texture*/
-       textures = new Texture[_dim];
-}
-
-
-tBuffer::~tBuffer()
-{
-       delete textures;
-       glDeleteBuffers(1, &handle);
-}
-
-tBuffer::operator unsigned int() const
-{
-       return handle;
-}
-
-unsigned int tBuffer::getDim() const
-{
-       return dim;
-}
-
-Texture* tBuffer::getTexture(unsigned int i) const
-{
-       return &textures[i];
-}
-
-void tBuffer::bindBuffer()
-{
-       glBindFramebuffer(buffer_target, handle);
-       for (unsigned int i = 0; i < dim; i++)
-       {
-               textures[i].bindTexture();
-               glFramebufferTexture2D(buffer_target, GL_COLOR_ATTACHMENT0 + i, textures[i].getTTarget(), textures[i], 0);
-       }
-       
-}
-
-void tBuffer::unbindBuffer()
-{
-       for (unsigned int i = 0; i < dim; i++)
-       {
-               textures[i].unbindTexture();
-       }
-       glDeleteBuffers(1, &handle);
-       glGenBuffers(1, &handle);
-
-}
-
-void tBuffer::useBuffer() const
-{
-       glBindFramebuffer(buffer_target, handle);
-}
\ No newline at end of file
diff --git a/Weave/Graphix/Textures/tBuffer.h b/Weave/Graphix/Textures/tBuffer.h
deleted file mode 100644 (file)
index 60b5d03..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#pragma once
-#include "Texture.h"
-
-class tBuffer
-{
-public:
-       tBuffer(unsigned int dim=1);
-       virtual ~tBuffer();
-
-       virtual void bindBuffer();
-       virtual void unbindBuffer();
-       virtual void useBuffer() const;
-
-       operator unsigned int() const;
-
-       unsigned int getDim() const;
-       Texture* getTexture(unsigned int i = 0) const;
-
-       unsigned int dim;
-       Texture* textures = nullptr;
-protected:
-       unsigned int handle;
-       unsigned int buffer_target;
-
-
-       
-};
-
index 74e004ef1cbc719f90776388cf6274f2b10b93f0..9b0dea0f51f40ec1b5adf2bd11fc7dcf0dc21ec6 100644 (file)
@@ -46,7 +46,7 @@ tImage::~tImage()
        FreeImage_Unload((FIBITMAP*)data);
 }
 
-void tImage::bindTexture()
+void tImage::bindTexture(unsigned int _width, unsigned int _height)
 {      
        
        Texture::bindTexture();
@@ -54,15 +54,14 @@ void tImage::bindTexture()
        
 }
 
-void tImage::useTexture() const
+void tImage::useTexture(unsigned int _unit) const
 {
 
        /* bind Texture*/
-       int unit = 0;
-       glActiveTexture(GL_TEXTURE0 + unit);
+       glActiveTexture(GL_TEXTURE0 + _unit);
        glBindTexture(texture_target, handle);
 
-       Shader::gActive()->setUniformLocation("uColorTexture", unit);
+       Shader::gActive()->setUniformLocation("uColorTexture", _unit);
 
        /* bind Material*/
        Shader::gActive()->setUniformLocation("material", material);
index cbb19c45e772a7b15b608b3d4dc3d560b8ba71d9..de5ab5734f564e8a107fb3fe53d91da363a75bcd 100644 (file)
@@ -13,8 +13,8 @@ public:
        tImage(const std::string& path, const vec4& material);
        virtual ~tImage();
 
-       virtual void bindTexture() override;
-       virtual void useTexture() const override;
+       virtual void bindTexture(unsigned int width = 0, unsigned int height = 0) override;
+       virtual void useTexture(unsigned int i=0) const override;
 
        operator std::string() const;
 
index dd8dcb1f6cf594713b3bdc0a159704483026b847..b8e66336948d65e56fddfa8018e39943928f9764 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "../Graphix/Shader.h"
 #include "../Graphix/ViewPort.h"
+#include "../Graphix/Textures.h"
+#include "../Graphix/Model.h"
 
 #include "../Message.h"
 #include "../Events.h"
@@ -54,6 +56,14 @@ lookat(_lookat)
 
 
        bt_dynamics_world->setGravity(btVector3(0, YFALL_SPEED, 0));
+
+       blur = new fBufferObject(2);
+       render = new fBufferObject(1);
+
+       blur->bindBuffer(Graphix::getWindowWidth(), Graphix::getWindowHeight());
+       render->bindBuffer(Graphix::getWindowWidth(), Graphix::getWindowHeight());
+
+       render->clearBuffer();
 }
 
 
@@ -163,6 +173,7 @@ void Scene::update(float deltaT)
 
 void Scene::draw() const
 {
+       //render->useBuffer();
        viewPort.useViewPort();
 
        //Skybox
@@ -177,11 +188,16 @@ void Scene::draw() const
        }
 
        SkyBox.draw();
-
        for (auto i = SceneObjects.cbegin(); i != SceneObjects.cend(); ++i)
        {
                (*i)->draw();
        }
+
+       //render->clearBuffer();
+       //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+       //Shader::gBasicTexture()->useShader();
+       //render->getTexture(0)->useTexture(0);
+       //Model::getPlaneModel()->drawModel(mat4(1.f));
        
 }
 
index 551af96682d8b9352881d1bac04ee4aebcba00d9..5db976fb4820907dba9ecdf409689f52ef911917 100644 (file)
@@ -15,6 +15,7 @@ class SceneObject;
 class ViewPort;
 class Sky;
 class Shader;
+class fBufferObject;
 
 class Scene
 {
@@ -61,4 +62,7 @@ protected:
        btSequentialImpulseConstraintSolver* bt_solver;
        btCollisionWorld* bt_collision_world;
        btDiscreteDynamicsWorld* bt_dynamics_world;
+
+       fBufferObject* render;
+       fBufferObject* blur;
 };
index 9f707bf4aa1258cf1888cb633091a4ecb56fff2e..c8cb897fad5148aa41e74cc5d6c99991cebe21df 100644 (file)
     <ClCompile Include="Graphix\Model\Plane.cpp" />\r
     <ClCompile Include="Graphix\Model\SkyBox.cpp" />\r
     <ClCompile Include="Graphix\PointLight.cpp" />\r
-    <ClCompile Include="Graphix\Textures\tBuffer.cpp" />\r
+    <ClCompile Include="Graphix\Textures\fBufferObject.cpp" />\r
+    <ClCompile Include="Graphix\Textures\rBufferObject.cpp" />\r
     <ClCompile Include="Graphix\Textures\Texture.cpp" />\r
     <ClCompile Include="Scene\EventBox.cpp" />\r
     <ClCompile Include="Scene\Level.cpp" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="Average.h" />\r
+    <ClInclude Include="Graphix\Textures\BufferObject.h" />\r
     <ClInclude Include="Graphix\Debug.h" />\r
     <ClInclude Include="Graphix\Model.h" />\r
     <ClInclude Include="Events.h" />\r
     <ClInclude Include="Graphix\Model\SkyBox.h" />\r
     <ClInclude Include="Graphix\PointLight.h" />\r
     <ClInclude Include="Graphix\Textures.h" />\r
-    <ClInclude Include="Graphix\Textures\tBuffer.h" />\r
+    <ClInclude Include="Graphix\Textures\fBufferObject.h" />\r
+    <ClInclude Include="Graphix\Textures\rBufferObject.h" />\r
     <ClInclude Include="Graphix\Textures\Texture.h" />\r
     <ClInclude Include="Scene.h" />\r
     <ClInclude Include="Scene\EventBox.h" />\r
index 540faafd9421522d17a62da71bd5328277a481f8..90fa55c172607fed0fc0308b54e24d081e06ecc4 100644 (file)
     <ClCompile Include="Graphix\Textures\tImage.cpp">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="Graphix\Textures\tBuffer.cpp">\r
+    <ClCompile Include="Graphix\Textures\fBufferObject.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Graphix\Textures\rBufferObject.cpp">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
     <ClInclude Include="Graphix\Textures\tImage.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="Graphix\Textures\tBuffer.h">\r
+    <ClInclude Include="Graphix\Textures\BufferObject.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Graphix\Textures\fBufferObject.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Graphix\Textures\rBufferObject.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
index 132e13f5160e478871687576188e88c2dbcd408f..db0e01d01a632205ad9772db9902aa93d37ff453 100644 (file)
@@ -1,8 +1,10 @@
 //Fragment Shader
-#version 330
+#version 330 core
 //in worldNormal;
 in vec2 fUVs;
 
+layout(location = 0) out vec4 gl_FragColor;
+
 uniform sampler2D uColorTexture;
  
 void main()
index 501ee9221c309da1e3b90e680be88e32d86774e2..4b7f56a7d5cc01051be825948493ef4bafb843f0 100644 (file)
@@ -5,6 +5,8 @@ in vec2 fUVs;
 
 in vec3 PointLightPosition1, DirectionalLightDirection1;
 
+layout (location = 0) out vec4 gl_FragColor;
+
 uniform sampler2D uColorTexture;
 uniform vec4 material;                                 //vec4 in the form (ambient, point, directional, glossyness); so far it was (1, 1, 1, 3)