aber entweder wird der Buffer nicht richtig geschrieben oder gelesen...
Shader::gActive()->setUniformLocation("uPlain", 1);
Shader::gActive()->setUniformLocation("uFar", 0);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ //glDrawArrays(GL_QUADS, 0, 4);
glBindVertexArray(0);
}
#include <GL\glew.h>
#include "../../Message.h"
+#include "../Shader.h"
#include "tImage.h"
/* bind Texture*/
glActiveTexture(GL_TEXTURE0 + _unit);
glBindTexture(texture_target, handle);
+
+ Shader::gActive()->setUniformLocation("uColorTexture", _unit);
}
void Texture::updateSize(unsigned int _width, unsigned int _height)
bt_dynamics_world->setGravity(btVector3(0, YFALL_SPEED, 0));
- blur = new fBufferObject(2);
render = new fBufferObject(1);
+ blur = new fBufferObject(2,false);
+
blur->bindBuffer(Graphix::getWindowWidth(), Graphix::getWindowHeight());
render->bindBuffer(Graphix::getWindowWidth(), Graphix::getWindowHeight());
void Scene::draw() const
{
- //render->useBuffer();
+ render->useBuffer();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
viewPort.useViewPort();
//Skybox
(*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));
+ render->clearBuffer();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ Shader::gBasicTexture()->useShader();
+ //render->getTexture()->useTexture();
+ SceneObjects.front()->gTexture()->useTexture();
+ Model::getPlaneModel()->drawModel(mat4(1.f));
}
//in worldNormal;
in vec2 fUVs;
-layout(location = 0) out vec4 gl_FragColor;
+layout(location = 0) out vec4 FragColor;
uniform sampler2D uColorTexture;
void main()
{
- gl_FragColor = texture(uColorTexture, fUVs);
+ FragColor = texture(uColorTexture, fUVs);
}
\ No newline at end of file
//Fragment Shader
#version 330
+
+layout(location = 0) out vec4 FragColor;
+
uniform vec4 uFragmentColor = vec4(0.6, 0, 0, 0.6);
void main(){
- gl_FragColor = uFragmentColor;
+ FragColor = uFragmentColor;
}
in vec3 PointLightPosition1, DirectionalLightDirection1;
-layout (location = 0) out vec4 gl_FragColor;
+layout (location = 0) out vec4 FragColor;
uniform sampler2D uColorTexture;
uniform vec4 material; //vec4 in the form (ambient, point, directional, glossyness); so far it was (1, 1, 1, 3)
float squaredist1 = worldPointLightDir1.x * worldPointLightDir1.x + worldPointLightDir1.y * worldPointLightDir1.y + worldPointLightDir1.z * worldPointLightDir1.z;
- gl_FragColor = vec4(uvColor.rgb * (AmbientLightColor * material[0]
+ FragColor = vec4(uvColor.rgb * (AmbientLightColor * material[0]
+ PointLightColor1 * material[1] * (cosThetaPoint1 + pow(SpecularCosPoint1, specularConst)) / squaredist1
+ DirectionalLightColor1 * material[2] * (cosThetaDirection1 + pow(SpecularCosDirection1, specularConst))
), uvColor.a);
- //gl_FragColor = vec4((normalize(worldNormal)+1)/2, 1.0f);
- //gl_FragColor = vec4(length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, 1.0f);
+ //FragColor = vec4((normalize(worldNormal)+1)/2, 1.0f);
+ //FragColor = vec4(length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, 1.0f);
//vec3 uvColor = texture(uColorTexture, fUVs).rgb;
- //gl_FragColor = vec4(uvColor, 1.0);
+ //FragColor = vec4(uvColor, 1.0);
}