From: Peter Schaefer Date: Thu, 14 Apr 2016 10:20:10 +0000 (+0200) Subject: Effect Blur(AccBuffer) umbenannt X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=1b9f97babd3db2d3da16ec530e731d72b3fedee6;p=cgue_weave.git Effect Blur(AccBuffer) umbenannt Texturen aufgeteilt in Buffer & Image --- diff --git a/Weave/Events.cpp b/Weave/Events.cpp index d156113..e19a331 100644 --- a/Weave/Events.cpp +++ b/Weave/Events.cpp @@ -139,7 +139,7 @@ void Events::KeyDown(int _key) break; case SDLK_LSHIFT: timeshift = true; - Graphix::enableEffects(EF_MOTION_BLUR); + Graphix::enableEffects(EF_MOTION_BLUR_ACC); break; default: break; @@ -152,7 +152,7 @@ void Events::KeyUp(int _key) { case SDLK_LSHIFT: timeshift = false; - Graphix::disableEffects(EF_MOTION_BLUR); + Graphix::disableEffects(EF_MOTION_BLUR_ACC); break; default: break; diff --git a/Weave/Game.cpp b/Weave/Game.cpp index 1778c4b..ca049e7 100644 --- a/Weave/Game.cpp +++ b/Weave/Game.cpp @@ -15,7 +15,7 @@ #include "Graphix\Shader.h" #include "Graphix\Graphix.h" -#include "Graphix\Texture.h" +#include "Graphix\Textures.h" #include "Fps.h" #include "Events.h" diff --git a/Weave/Graphix/Graphix.cpp b/Weave/Graphix/Graphix.cpp index 4db3355..530973c 100644 --- a/Weave/Graphix/Graphix.cpp +++ b/Weave/Graphix/Graphix.cpp @@ -67,6 +67,7 @@ void Graphix::updateEffects() void Graphix::init() { + /*SDL INIT*/ if (SDL_Init(sdlFlags) != 0) { Message::error((string)"SDL_Init: " + SDL_GetError()); @@ -93,6 +94,10 @@ void Graphix::init() sdl_glcontext = SDL_GL_CreateContext(sdl_window); + SDL_ShowCursor(SDL_DISABLE); + + + /*OpenGL INIT*/ GLenum err = glewInit(); if (err != GLEW_OK) { @@ -124,7 +129,6 @@ void Graphix::init() } #endif - SDL_ShowCursor(SDL_DISABLE); glEnable(GL_DEPTH_TEST); @@ -204,7 +208,8 @@ void Graphix::hideMouse(bool _enable) void Graphix::clear() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - if (testEffect(EF_MOTION_BLUR)) + + if (testEffect(EF_MOTION_BLUR_ACC)) { glAccum(GL_RETURN, MOTION_BLUR_INTENS); glClear(GL_ACCUM_BUFFER_BIT); @@ -216,8 +221,9 @@ void Graphix::clear() void Graphix::swap() { - if (testEffect(EF_MOTION_BLUR)) + if (testEffect(EF_MOTION_BLUR_ACC)) glAccum(GL_ACCUM, MOTION_BLUR_COEFF); + SDL_GL_SwapWindow(sdl_window); } diff --git a/Weave/Graphix/Graphix.h b/Weave/Graphix/Graphix.h index 337482d..7d10ff4 100644 --- a/Weave/Graphix/Graphix.h +++ b/Weave/Graphix/Graphix.h @@ -9,7 +9,7 @@ enum Effects { EF_NOTHING = 0, - EF_MOTION_BLUR = BIT(1), + EF_MOTION_BLUR_ACC = BIT(1), EF_TRANSPARENCY = BIT(2), EF_BLOOM = BIT(3) }; diff --git a/Weave/Graphix/Model.h b/Weave/Graphix/Model.h index d786d9a..6fbfc1f 100644 --- a/Weave/Graphix/Model.h +++ b/Weave/Graphix/Model.h @@ -4,3 +4,4 @@ //#include "Model\IMetaMesh.h" //#include "Model\SkyBox.h" //#include "Model\BBox.h" +#include "Model\Plane.h" diff --git a/Weave/Graphix/Model/Plane.cpp b/Weave/Graphix/Model/Plane.cpp index f967b4c..300bc25 100644 --- a/Weave/Graphix/Model/Plane.cpp +++ b/Weave/Graphix/Model/Plane.cpp @@ -32,15 +32,16 @@ void Plane::drawModel() const useModel(mat4(1.f)); Shader::gActive()->setUniformLocation("uPlain", 1); + Shader::gActive()->setUniformLocation("uFar", 0); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glDrawArrays(GL_QUADS, 0, 4); glBindVertexArray(0); } void Plane::bt_init(bool isConvex) { if(bt_collision_shape==nullptr) - bt_collision_shape = new btBoxShape(btVector3(.5f, .5f, .001f)); + bt_collision_shape = new btBoxShape(btVector3(.5f, .5f, .01f)); } diff --git a/Weave/Graphix/Model/SkyBox.cpp b/Weave/Graphix/Model/SkyBox.cpp index a3f5e23..64f9919 100644 --- a/Weave/Graphix/Model/SkyBox.cpp +++ b/Weave/Graphix/Model/SkyBox.cpp @@ -38,6 +38,7 @@ void SkyBox::drawModel(const mat4& _modelMat) const useModel(_modelMat); + Shader::gActive()->setUniformLocation("uPlain", 0); Shader::gActive()->setUniformLocation("uFar", 1); Model::drawModel(); diff --git a/Weave/Graphix/Texture.cpp b/Weave/Graphix/Texture.cpp deleted file mode 100644 index 5f57fcb..0000000 --- a/Weave/Graphix/Texture.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include "Texture.h" -#include -#include "FreeImage.h" -#include -#include "../GLM.h" - -#include "../Message.h" -#include "Graphix.h" -#include "Shader.h" - -using std::string; -using std::unordered_map; - - -Texture::Texture(const string& _path, const vec4& _material) : path(_path), handle(-1), TEXTURE_TYPE(-1), material(_material) -{ - //Message::info("Error from before?"); - //Graphix::getGlError(); - //Message::info("Do some Stuff"); - - - texHandle& t_ptr = texture_Map[_path]; - - if (t_ptr.handle >= 0) - { - handle = t_ptr.handle; - return; - } - - glGenTextures(1, &handle); - - auto path_type = path.substr(path.find_last_of("_")+1); - path_type = path_type.substr(0, path_type.find_first_of(".")); - - if (path_type == "CUBE") - { - TEXTURE_TYPE = GL_TEXTURE_CUBE_MAP; - } - else if (path_type == "2D") - { - TEXTURE_TYPE = GL_TEXTURE_2D; - } - else - { - Message::info("Texture : Undefined Type, was set to default (2D)"); - TEXTURE_TYPE = GL_TEXTURE_2D; - } - glBindTexture(TEXTURE_TYPE, handle); - - FREE_IMAGE_FORMAT format = FreeImage_GetFileType(("../textures/" + path).c_str());//Automatocally detects the format - if (format == FIF_UNKNOWN) - { - Message::error("Texture: Couldn't detect texture file format."); - } - FIBITMAP* data = FreeImage_Load(format, ("../textures/" + path).c_str()); - if (!data) - { - Message::error("Texture: Couldn't read texture file."); - } - - //FIBITMAP* temp = data; - data = FreeImage_ConvertTo32Bits(data); - if (!data) - { - Message::error("Texture: Couldn't convert texture file to bit format."); - } - //FreeImage_Unload(temp); - - unsigned int width = FreeImage_GetWidth(data); - unsigned int height = FreeImage_GetHeight(data); - - //unsigned int width, height; - - //FIBITMAP *data = FreeImage_Load(FIF_PNG, path.c_str(), PNG_DEFAULT); - //Graphix::getGlError(); -// if (TEXTURE_TYPE == GL_TEXTURE_2D) - { - glTexImage2D(TEXTURE_TYPE, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid*)FreeImage_GetBits(data)); - //Message::info("TexImage"); - //Graphix::getGlError(); - //Message::info("Other Stuff"); - glGenerateMipmap(TEXTURE_TYPE); - } -// else if (TEXTURE_TYPE == GL_TEXTURE_CUBE_MAP) - - - glTexParameteri(TEXTURE_TYPE, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(TEXTURE_TYPE, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - if (TEXTURE_TYPE == -1) - { - glTexParameteri(TEXTURE_TYPE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(TEXTURE_TYPE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(TEXTURE_TYPE, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - } - - t_ptr.handle = handle; - //Graphix::getGlError(); - //Message::info("Done"); - -} - -Texture::~Texture() -{ - glDeleteTextures(1, &handle); -} - -Texture* Texture::newTexture(const string& _path, const vec4& _material) -{ - texHandle& t_ptr = texture_Map[_path]; - - if (t_ptr.ptr == nullptr) - { - t_ptr.ptr = new Texture(_path, _material); - } - - ++t_ptr.count; - - return t_ptr.ptr; -} - -void Texture::deleteTexture(const string& _path) -{ - texHandle& t_ptr = texture_Map[_path]; - - if (t_ptr.ptr == nullptr) - { - Message::warning("deleteTexture: " + _path + " doesn't exist."); - return; - } - - --t_ptr.count; - - if (!t_ptr.count) - { - delete t_ptr.ptr; - texture_Map.erase(_path); - } -} - -void Texture::useTexture() const -{ - - /* bind Texture*/ - int unit = 0; - glActiveTexture(GL_TEXTURE0 + unit); - glBindTexture(TEXTURE_TYPE, handle); - - Shader::gActive()->setUniformLocation("uColorTexture", unit); - - /* bind Material*/ - Shader::gActive()->setUniformLocation("material", material); -} - -Texture::operator string() const -{ - return path; -} - -unordered_map Texture::texture_Map; \ No newline at end of file diff --git a/Weave/Graphix/Texture.h b/Weave/Graphix/Texture.h deleted file mode 100644 index d6968a8..0000000 --- a/Weave/Graphix/Texture.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "../GLM.h" - -#include -#include - -class Texture -{ -public: - static Texture* newTexture(const std::string& path, const vec4& material); - static void deleteTexture(const std::string& path); - - virtual void useTexture() const; - - operator std::string() const; - -private: - Texture(const std::string& path, const vec4& material); - ~Texture(); - - unsigned int handle; - std::string path; - unsigned int TEXTURE_TYPE; - - typedef struct texStruct - { - int handle=-1; - unsigned int count=0; - Texture* ptr=nullptr; - } texHandle; - - vec4 material; - - static std::unordered_map texture_Map; -}; \ No newline at end of file diff --git a/Weave/Graphix/Textures.h b/Weave/Graphix/Textures.h new file mode 100644 index 0000000..45f5bc0 --- /dev/null +++ b/Weave/Graphix/Textures.h @@ -0,0 +1,5 @@ +#pragma once + +#include "Textures/Texture.h" +//#include "Textures\tImage.h" +#include "Textures\tBuffer.h" diff --git a/Weave/Graphix/Textures/Texture.cpp b/Weave/Graphix/Textures/Texture.cpp new file mode 100644 index 0000000..c0cf076 --- /dev/null +++ b/Weave/Graphix/Textures/Texture.cpp @@ -0,0 +1,108 @@ +#include "Texture.h" +#include + +#include "../../Message.h" + +#include "tImage.h" + +using std::string; +using std::unordered_map; + + +Texture::Texture() + : texture_internal(GL_RGB16F), texture_format(GL_RGB),texture_target(GL_TEXTURE_2D),texture_type(GL_FLOAT) +{ + glGenTextures(1, &handle); +} + +Texture::~Texture() +{ + glDeleteTextures(1, &handle); +} + +Texture* Texture::newTImage(const string& _path, const vec4& _material) +{ + texHandle& t_ptr = texture_Map[_path]; + + if (t_ptr.ptr == nullptr) + { + t_ptr.ptr = new tImage(_path, _material); + handle_Map[t_ptr.ptr->handle] = &t_ptr; + } + + ++t_ptr.count; + + return t_ptr.ptr; +} + +void Texture::deleteTImage(unsigned int _handle) +{ + texHandle& t_ptr = *handle_Map[_handle]; + + if (t_ptr.ptr == nullptr) + { + Message::warning("deleteTexture: Image doesn't exist."); + return; + } + + --t_ptr.count; + + if (!t_ptr.count) + { + texture_Map.erase(*t_ptr.ptr); + //delete t_ptr.ptr; + } +} + +unsigned int Texture::getTTarget() const +{ + return texture_target; +} + + +Texture::operator unsigned int() const +{ + return handle; +} + +void Texture::bindTexture() +{ + glBindTexture(texture_target, handle); + + glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + //glTexParameteri(texture_target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + glTexImage2D(texture_target, 0, texture_internal, width, height, 0, texture_format, texture_type, data); +} + +void Texture::unbindTexture() +{ + glDeleteTextures(1, &handle); + glGenTextures(1, &handle); +} + +void Texture::useTexture() const +{ + + /* bind Texture*/ + int unit = 0; + glActiveTexture(GL_TEXTURE0 + unit); + glBindTexture(texture_target, handle); +} + +void Texture::updateSize(unsigned int _width, unsigned int _height) +{ + width = _width; + height = _height; + + glBindTexture(texture_target, handle); + glTexImage2D(texture_target, 0, texture_internal, width, height, 0, texture_format, texture_type, data); +} + + +unordered_map Texture::texture_Map; +unordered_map Texture::handle_Map; \ No newline at end of file diff --git a/Weave/Graphix/Textures/Texture.h b/Weave/Graphix/Textures/Texture.h new file mode 100644 index 0000000..3fbc945 --- /dev/null +++ b/Weave/Graphix/Textures/Texture.h @@ -0,0 +1,50 @@ +#pragma once + +#include "../../GLM.h" + +#include +#include + +class tImage; + +class Texture +{ +public: + static Texture* newTImage(const std::string& path, const vec4& material); + static void deleteTImage(const unsigned int handle); + + Texture(); + ~Texture(); + + virtual void bindTexture(); + virtual void unbindTexture(); + virtual void useTexture() const; + + virtual void updateSize(unsigned int width, unsigned int height); + + virtual operator unsigned int() const; + + unsigned int getTTarget() const; + +protected: + unsigned int handle; + + unsigned int texture_target; + unsigned int texture_internal; + unsigned int texture_format; + unsigned int texture_type; + + void* data = nullptr; + + unsigned int width = 0, height = 0; + + + typedef struct texStruct + { + unsigned int count=0; + tImage* ptr=nullptr; + } texHandle; + + static std::unordered_map texture_Map; + static std::unordered_map handle_Map; +}; \ No newline at end of file diff --git a/Weave/Graphix/Textures/tBuffer.cpp b/Weave/Graphix/Textures/tBuffer.cpp new file mode 100644 index 0000000..b76f95f --- /dev/null +++ b/Weave/Graphix/Textures/tBuffer.cpp @@ -0,0 +1,66 @@ +#include "tBuffer.h" + +#include +#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 new file mode 100644 index 0000000..60b5d03 --- /dev/null +++ b/Weave/Graphix/Textures/tBuffer.h @@ -0,0 +1,28 @@ +#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; + + + +}; + diff --git a/Weave/Graphix/Textures/tImage.cpp b/Weave/Graphix/Textures/tImage.cpp new file mode 100644 index 0000000..74e004e --- /dev/null +++ b/Weave/Graphix/Textures/tImage.cpp @@ -0,0 +1,97 @@ +#include "tImage.h" + +#include +#include "../Shader.h" +#include "FreeImage.h" + + +#include "../../Message.h" + +using std::string; + +tImage::tImage(const string& _path, const vec4& _material) : path(_path), material(_material) +{ + auto path_type = _path.substr(_path.find_last_of("_") + 1); + path_type = path_type.substr(0, path_type.find_first_of(".")); + + if (path_type == "CUBE") + { + texture_target = GL_TEXTURE_CUBE_MAP; + } + else if (path_type == "2D") + { + texture_target = GL_TEXTURE_2D; + } + else + { + Message::info("Texture : Undefined Type, was set to default (2D)"); + } + + format = FreeImage_GetFileType(("../textures/" + _path).c_str()); + if (format == FIF_UNKNOWN) + { + Message::error("Texture: Couldn't detect texture file format."); + } + + texture_internal = GL_RGBA8; + texture_format = GL_BGRA; + texture_type = GL_UNSIGNED_BYTE; + + loadImage(path); +} + + +tImage::~tImage() +{ + FreeImage_Unload((FIBITMAP*)data); +} + +void tImage::bindTexture() +{ + + Texture::bindTexture(); + glGenerateMipmap(texture_target); + +} + +void tImage::useTexture() const +{ + + /* bind Texture*/ + int unit = 0; + glActiveTexture(GL_TEXTURE0 + unit); + glBindTexture(texture_target, handle); + + Shader::gActive()->setUniformLocation("uColorTexture", unit); + + /* bind Material*/ + Shader::gActive()->setUniformLocation("material", material); +} + + +void tImage::loadImage(const std::string & _path) +{ + + FIBITMAP* data = FreeImage_Load(format, ("../textures/" + path).c_str()); + if (!data) + { + Message::error("Texture: Couldn't read texture file."); + } + + data = FreeImage_ConvertTo32Bits(data); + if (!data) + { + Message::error("Texture: Couldn't convert texture file to bit format."); + } + + width = FreeImage_GetWidth(data); + height = FreeImage_GetHeight(data); + + Texture::data = (GLvoid*)FreeImage_GetBits(data); +} + + +tImage::operator std::string() const +{ + return path; +} \ No newline at end of file diff --git a/Weave/Graphix/Textures/tImage.h b/Weave/Graphix/Textures/tImage.h new file mode 100644 index 0000000..cbb19c4 --- /dev/null +++ b/Weave/Graphix/Textures/tImage.h @@ -0,0 +1,29 @@ +#pragma once +#include "Texture.h" + +#include "../../GLM.h" +#include + +enum FREE_IMAGE_FORMAT; + +class tImage : + public Texture +{ +public: + tImage(const std::string& path, const vec4& material); + virtual ~tImage(); + + virtual void bindTexture() override; + virtual void useTexture() const override; + + operator std::string() const; + +protected: + void loadImage(const std::string& path); + + vec4 material; + + std::string path; + FREE_IMAGE_FORMAT format; +}; + diff --git a/Weave/Scene/EventBox.cpp b/Weave/Scene/EventBox.cpp index ab47b88..6b272cc 100644 --- a/Weave/Scene/EventBox.cpp +++ b/Weave/Scene/EventBox.cpp @@ -5,7 +5,7 @@ #include "../Graphix/Model.h" #include "../Events.h" -#include "../Graphix/Texture.h" +#include "../Graphix/Textures.h" #include "../Message.h" diff --git a/Weave/Scene/SceneObject.cpp b/Weave/Scene/SceneObject.cpp index c3c1fb9..b807e0f 100644 --- a/Weave/Scene/SceneObject.cpp +++ b/Weave/Scene/SceneObject.cpp @@ -9,7 +9,7 @@ #include "../Graphix/Graphix.h" #include "../Graphix/Shader.h" -#include "../Graphix/Texture.h" +#include "../Graphix/Textures.h" #include "../Graphix/Model.h" #include "../Message.h" @@ -75,7 +75,11 @@ move_delta(0) } if (texturepath != "") - texture = Texture::newTexture(texturepath, _material); + { + texture = Texture::newTImage(texturepath, _material); + texture->bindTexture(); + } + if (texturepath == "model_duck_2D.png") { @@ -148,16 +152,21 @@ move_delta(0) //Graphix::getGlError(); //modelID = _shader->getUniformLocation("modelMat"); if (texturepath != "") - texture = Texture::newTexture(texturepath, _material); + { + texture = Texture::newTImage(texturepath, _material); + texture->bindTexture(); + } + //Message::info("Creating SkyBox Shader"); //Graphix::getGlError(); if (texturepath == "model_duck_2D.png") { collide_group = COL_ENEMY; - collision = Model::getBBoxModel(); } + collision = Model::getBBoxModel(); + model->bindModel(); model->bindShader(shader); //Message::info("Binding Shader"); @@ -184,7 +193,7 @@ SceneObject::~SceneObject() if (texture!=nullptr) - Texture::deleteTexture(*texture); + Texture::deleteTImage(*texture); if (newModel) { diff --git a/Weave/Scene/Sky.cpp b/Weave/Scene/Sky.cpp index 5e4459a..859ac74 100644 --- a/Weave/Scene/Sky.cpp +++ b/Weave/Scene/Sky.cpp @@ -2,7 +2,7 @@ #include "../Graphix/Shader.h" #include "../Graphix/Model.h" -#include "../Graphix/Texture.h" +#include "../Graphix/Textures.h" #include "../GLM.h" diff --git a/Weave/Weave.vcxproj b/Weave/Weave.vcxproj index 2f71aa7..9f707bf 100644 --- a/Weave/Weave.vcxproj +++ b/Weave/Weave.vcxproj @@ -106,18 +106,20 @@ + + - + @@ -137,6 +139,9 @@ + + + @@ -144,11 +149,11 @@ - + diff --git a/Weave/Weave.vcxproj.filters b/Weave/Weave.vcxproj.filters index d96246b..540faaf 100644 --- a/Weave/Weave.vcxproj.filters +++ b/Weave/Weave.vcxproj.filters @@ -33,9 +33,6 @@ Source Files - - Source Files - Source Files @@ -93,6 +90,15 @@ Source Files + + Source Files + + + Source Files + + + Source Files + @@ -113,9 +119,6 @@ Header Files - - Header Files - Header Files @@ -182,5 +185,17 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/shader/blur_FS.hlsl b/shader/blur_FS.hlsl index ce74b5c..acbcedd 100644 --- a/shader/blur_FS.hlsl +++ b/shader/blur_FS.hlsl @@ -5,7 +5,7 @@ in vec2 fUVs; out vec4 gl_FragColor; uniform sampler2D u_texture; -uniform bool uHorizontal; +uniform bool uHorizontal = true; uniform bool uSymetric = true; uniform float weight[5] = float[](0.2270270270, 0.1945945946, 0.1216216216, 0.0540540541, 0.0162162162);