Skip to content
Snippets Groups Projects
Commit ed8b404b authored by iaminadequate's avatar iaminadequate
Browse files

changing lighting for walls

parent 94c40b89
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ vec3 PointLight(
// Diffussion Decides intensity of scattered light.
vec3 N = normalize(norm);
vec3 light_dir = normalize(position - vec3(model * vert_position));
float diffusion = max(0.0, dot(N, light_dir));
float diffusion = max(0.5, dot(N, light_dir));
vec3 diffuse = diffusion * intensities;
// Specularity Adds a strong lightspot in middle of light.
......
......@@ -8,50 +8,95 @@
// HARDCODED VALUES IN CODE - POSSIBLY MAKE THEM READ FROM FILE IN THE FUTURE.
// Just short term solution so that we can easily print something to screen.
// Declared globally in "constants.h"
GLfloat vertices[] = {
-0.5f, -0.5f, -0.5f,
GLfloat vertices[] = { // Vert. coords
-0.5f, -0.5f, -0.5f, //Back Face
0.5f, -0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
-0.5f, 0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, -0.5f, 0.5f, //Front Face
0.5f, -0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f, //Left Face
-0.5f, 0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f, //Right Face
0.5f, 0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, -0.5f, //Bottom Face
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, 0.5f,
0.5f, -0.5f, 0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, 0.5f, -0.5f,
-0.5f, 0.5f, -0.5f, //Top Face
0.5f, 0.5f, -0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, -0.5f,
};
GLfloat normal[] = {
GLfloat normal[] = { //NEW NORMALS (14/4-2020)
0.0f, 0.0f, -1.0f, //Back Face
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, 1.0f, //Front Face
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
-1.0f, 0.0f, 0.0f, //Left Face
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f, //Right Face
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f, //Bottom Face
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f, //top face
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
};
/*GLfloat normal[] = { // Old WRONG normals....
-0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
......@@ -93,8 +138,8 @@ GLfloat normal[] = {
0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, -0.5f,
};
GLfloat uvCoordinates[] = {
};*/
GLfloat uvCoordinates[] = { //Tex. coords
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 1.0f,
......
......@@ -82,7 +82,7 @@ void game::run() {
* pacman.move is before renderer.loadMap because the pacman object contains the "view" camera angle DATA and renderer.loadMap() uses it to portray the actual angle in shader
*/
model.draw({});
// model.draw({});
pacman.move(myWindow.window, deltaTime, &loader);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment