Commit 6829ed5a authored by Sadman Kazi's avatar Sadman Kazi 🎸

Added sample level loading and better lighting

parent f089b23a
......@@ -9,5 +9,5 @@ uniform vec3 u_ambientLight;
void main () {
vec4 totalLight = vec4(u_ambientLight, 1);
fragColor = texture2D(u_diffuse, texCoord0.xy) * clamp(dot(-vec3(0,0,1), normal0), 0.0, 1.0);
fragColor = texture2D(u_diffuse, texCoord0.xy) * clamp(dot(-vec3(1,1,1), normal0), 0.2, 1.0);
}
# Blender MTL File: 'sample_level.blend'
# Material Count: 23
newmtl Green_Roof
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.309804 0.466667 0.458824
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Green_leafs
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.298039 0.529412 0.427451
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Green_leafs.017
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.298039 0.529412 0.427451
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Green_leafs.019
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.298039 0.529412 0.427451
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Green_leafs.020
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.298039 0.529412 0.427451
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Green_leafs.021
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.298039 0.529412 0.427451
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs.001
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs.006
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs.007
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs.008
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Leafs.014
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.270588 0.407843 0.400000
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Water
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.674510 0.913725 0.937255
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.001
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.006
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.007
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.008
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.022
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.024
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.025
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.026
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Wood.034
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.545098 0.356863
Ks 0.330000 0.330000 0.330000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
This diff is collapsed.
......@@ -34,8 +34,8 @@ Game::Game()
//m_mesh = new Mesh(data, sizeof(data)/sizeof(data[0]), indices, sizeof(indices)/sizeof(indices[0]));
m_mesh = new Mesh("../res/monkey.obj");
m_texture = new Texture("../res/checker_pattern.jpg");
m_mesh = new Mesh("../res/sample_level.obj");
m_texture = new Texture("../res/gray.jpg");
m_transform = new Transform();
m_camera = new Camera(glm::vec3(0.0f, 0.0f, -2.0f), 70.0f, (float)WIDTH/HEIGHT, 1.0f, 100.0f);
......@@ -43,6 +43,8 @@ Game::Game()
m_transform->setScale(glm::vec3(0.5f, 0.5f, 0.5f));
m_shader->addUniform("u_transform");
//m_shader->addUniform("u_ambientLight");
//m_shader->setUniformVec3("u_ambientLight", glm::vec3(1,1,1));
m_counter = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment