Lights Fixed.
Shadows not fixid.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -33,36 +33,55 @@ void GameWorld::Initialize()
|
|||||||
// Fucking lights
|
// Fucking lights
|
||||||
ent = CreateEntity();
|
ent = CreateEntity();
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
transform->Position = glm::vec3(0.f, 4.f, 0.f);
|
transform->Position = glm::vec3(10.f, 2.f, 5.f);
|
||||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||||
pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
|
pointLight->Diffuse = glm::vec3(1.0, 1.0, 5.0);
|
||||||
pointLight->constantAttenuation = 0.f;
|
pointLight->constantAttenuation = 0.f;
|
||||||
pointLight->linearAttenuation = 1.f;
|
pointLight->linearAttenuation = 1.f;
|
||||||
pointLight->quadraticAttenuation = 0.f;
|
pointLight->quadraticAttenuation = 0.f;
|
||||||
pointLight->spotExponent = 0.0f;
|
pointLight->spotExponent = 0.0f;
|
||||||
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
|
model->ModelFile = "sphere.obj";
|
||||||
ent = CreateEntity();
|
ent = CreateEntity();
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
transform->Position = glm::vec3(10.f, 4.f, 0.f);
|
transform->Position = glm::vec3(0.f, 2.f, 5.f);
|
||||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
pointLight->Specular = glm::vec3(3.0, 3.0, 3.0);
|
||||||
pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
|
pointLight->Diffuse = glm::vec3(3.0, 0.0, 0.0);
|
||||||
pointLight->constantAttenuation = 0.f;
|
pointLight->constantAttenuation = 0.f;
|
||||||
pointLight->linearAttenuation = 1.f;
|
pointLight->linearAttenuation = 1.f;
|
||||||
pointLight->quadraticAttenuation = 0.f;
|
pointLight->quadraticAttenuation = 0.f;
|
||||||
pointLight->spotExponent = 0.0f;
|
pointLight->spotExponent = 0.0f;
|
||||||
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
|
model->ModelFile = "sphere.obj";
|
||||||
|
ent = CreateEntity();
|
||||||
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
|
transform->Position = glm::vec3(-10.f, 2.f, 5.f);
|
||||||
|
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||||
|
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||||
|
pointLight->Diffuse = glm::vec3(0.0, 3.0, 0.0);
|
||||||
|
pointLight->constantAttenuation = 0.f;
|
||||||
|
pointLight->linearAttenuation = 1.f;
|
||||||
|
pointLight->quadraticAttenuation = 0.f;
|
||||||
|
pointLight->spotExponent = 0.0f;
|
||||||
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
|
model->ModelFile = "sphere.obj";
|
||||||
|
|
||||||
|
//ground
|
||||||
ent = CreateEntity();
|
ent = CreateEntity();
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
transform->Position = glm::vec3(0.f, -4.f, 0.f);
|
transform->Position = glm::vec3(0.f, -4.f, 0.f);
|
||||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
model->ModelFile = "plane.obj";
|
||||||
pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
|
|
||||||
pointLight->constantAttenuation = 0.f;
|
|
||||||
pointLight->linearAttenuation = 1.f;
|
|
||||||
pointLight->quadraticAttenuation = 0.f;
|
|
||||||
pointLight->spotExponent = 0.0f;
|
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
|
ent = CreateEntity();
|
||||||
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
|
transform->Position = glm::vec3(0.f, 0.f, 0.f);
|
||||||
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
|
model->ModelFile = "ship.obj";
|
||||||
|
|
||||||
ent = CreateEntity();
|
ent = CreateEntity();
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
transform->Position = glm::vec3(10.f, 0.f, 0.f);
|
transform->Position = glm::vec3(10.f, 0.f, 0.f);
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -21,7 +21,7 @@ uniform float spotExponent[numberOfLights];
|
|||||||
vec2 TextureCoord;
|
vec2 TextureCoord;
|
||||||
} Input;
|
} Input;
|
||||||
|
|
||||||
vec3 scene_ambient = vec3(0.2, 0.2, 0.2);
|
vec3 scene_ambient = vec3(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
out vec4 fragmentColor;
|
out vec4 fragmentColor;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Blender MTL File: 'obstaclesandstuff.blend'
|
||||||
|
# Material Count: 1
|
||||||
|
|
||||||
|
newmtl Material.004
|
||||||
|
Ns 96.078431
|
||||||
|
Ka 0.000000 0.000000 0.000000
|
||||||
|
Kd 0.640000 0.640000 0.640000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ni 1.000000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd ObstacleTexture.png
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Blender MTL File: 'obstaclesandstuff.blend'
|
||||||
|
# Material Count: 1
|
||||||
|
|
||||||
|
newmtl Material.001
|
||||||
|
Ns 96.078431
|
||||||
|
Ka 0.000000 0.000000 0.000000
|
||||||
|
Kd 0.640000 0.640000 0.640000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ni 1.000000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd ObstacleTexture.png
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user