Merge branch 'master' of github.com:sippeangelo/Escape-the-Dawn
This commit is contained in:
@@ -11,8 +11,11 @@ struct PointLight : Component
|
||||
{
|
||||
float Intensity;
|
||||
float MaxRange;
|
||||
float SpecularIntensity;
|
||||
Color Color;
|
||||
glm::vec3 Specular;
|
||||
glm::vec3 Diffuse;
|
||||
float constantAttenuation, linearAttenuation, quadraticAttenuation;
|
||||
float spotExponent;
|
||||
Color color;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
<ClInclude Include="World.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Fragment2.glsl" />
|
||||
<None Include="Shaders\Fragment.glsl" />
|
||||
<None Include="Shaders\Normals.frag.glsl" />
|
||||
<None Include="Shaders\Normals.geo.glsl" />
|
||||
|
||||
@@ -161,6 +161,9 @@
|
||||
<None Include="Shaders\Normals.frag.glsl">
|
||||
<Filter>Shaders</Filter>
|
||||
</None>
|
||||
<None Include="Fragment2.glsl">
|
||||
<Filter>Shaders</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Systems">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
newmtl default_body2
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/as2.jpg
|
||||
|
||||
newmtl default
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 0.27451 0.27451 0.27451
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
|
||||
newmtl default_cockpits_1_cushions
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/yx1_02_01_01_02.jpg
|
||||
|
||||
newmtl default_cockpits_1_display
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 1 1 1
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/ggt1.jpg
|
||||
|
||||
newmtl default_cockpits_joysticks
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 0 0 0
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
|
||||
newmtl default_skin
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/ahm1_01_01.jpg
|
||||
|
||||
newmtl default_cabins1glass
|
||||
d 0.65
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 0.501961 1 0
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
|
||||
newmtl default_ship_door
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/as1_02.jpg
|
||||
|
||||
newmtl default_door
|
||||
d 1
|
||||
Ns 0.75
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/as1_02.jpg
|
||||
|
||||
newmtl default_steps
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/rmp1.jpg
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
|
||||
layout(binding=0) uniform sampler2D texture;
|
||||
|
||||
const int numberOfLights = 2;
|
||||
lightSource lights[numberOfLights];
|
||||
|
||||
uniform vec4 position[numberOfLights];
|
||||
uniform vec4 specular[numberOfLights];
|
||||
uniform vec4 diffuse[numberOfLights];
|
||||
uniform float constantAttenuation[numberOfLights];
|
||||
uniform float linearAttenuation[numberOfLights];
|
||||
uniform float quadraticAttenuation[numberOfLights];
|
||||
uniform float spotExponent[numberOfLights];
|
||||
|
||||
in VertexData {
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
vec4 scene_ambient = vec4(0.2, 0.2, 0.2, 1.0);
|
||||
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
vec4 texel = texture2D(texture, Input.TextureCoord);
|
||||
|
||||
vec3 normalDirection = normalize(Normal);
|
||||
vec3 viewDirection = normalize(vec3(v_inv * vec4(0.0, 0.0, 0.0, 1.0) - Position));
|
||||
vec3 lightDirection;
|
||||
float attenuation;
|
||||
|
||||
// initialize total lighting with ambient lighting
|
||||
vec3 totalLighting = vec3(scene_ambient) * vec3(frontMaterial.ambient);
|
||||
|
||||
for (int index = 0; index < numberOfLights; index++) // for all light sources
|
||||
{
|
||||
vec3 positionToLightSource = vec3(position[index] - Position);
|
||||
float distance = length(positionToLightSource);
|
||||
lightDirection = normalize(positionToLightSource);
|
||||
|
||||
attenuation = 1.0 / (constantAttenuation[index]
|
||||
+ linearAttenuation[index] * distance
|
||||
+ quadraticAttenuation[index] * distance * distance);
|
||||
|
||||
attenuation = attenuation * pow(clampedCosine, spotExponent[index]);
|
||||
|
||||
vec3 diffuseReflection = attenuation
|
||||
* vec3(diffuse[index]) * vec3(frontMaterial.diffuse)
|
||||
* max(0.0, dot(normalDirection, lightDirection));
|
||||
|
||||
vec3 specularReflection;
|
||||
if (dot(normalDirection, lightDirection) < 0.0) // light source on the wrong side?
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0); // no specular reflection
|
||||
}
|
||||
else // light source on the right side
|
||||
{
|
||||
specularReflection = attenuation * vec3(specular[index]) * vec3(frontMaterial.specular)
|
||||
* pow(max(0.0, dot(reflect(-lightDirection, normalDirection), viewDirection)), frontMaterial.shininess);
|
||||
}
|
||||
|
||||
totalLighting = totalLighting + diffuseReflection + specularReflection;
|
||||
}
|
||||
|
||||
fragmentColor = vec4(totalLighting, 1.0) * texel;
|
||||
}
|
||||
@@ -1,7 +1,100 @@
|
||||
#include "GameWorld.h"
|
||||
|
||||
|
||||
void GameWorld::Initialize()
|
||||
{
|
||||
World::Initialize();
|
||||
|
||||
//AddSystem("LevelGenerationSystem");
|
||||
AddSystem("InputSystem");
|
||||
//AddSystem("CollisionSystem");
|
||||
//AddSystem("ParticleSystem");
|
||||
AddSystem("PlayerSystem");
|
||||
AddSystem("SoundSystem");
|
||||
AddSystem("RenderSystem");
|
||||
|
||||
std::shared_ptr<Components::Transform> transform;
|
||||
std::shared_ptr<Components::Model> model;
|
||||
std::shared_ptr<Components::PointLight> pointLight;
|
||||
std::shared_ptr<Components::Camera> camera;
|
||||
EntityID ent;
|
||||
|
||||
ent = CreateEntity();
|
||||
SetProperty(ent, "Name", std::string("Camera"));
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
AddComponent<Components::Input>(ent, "Input");
|
||||
transform->Position = glm::vec3(0.f, 2.f, 10.f);
|
||||
camera = AddComponent<Components::Camera>(ent, "Camera");
|
||||
camera->FOV = 45.f;
|
||||
camera->FarClip = 1000.f;
|
||||
camera->NearClip = 0.01f;
|
||||
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
|
||||
|
||||
// Fucking lights
|
||||
ent = CreateEntity();
|
||||
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->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->linearAttenuation = 1.f;
|
||||
pointLight->quadraticAttenuation = 0.f;
|
||||
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, 4.f, 0.f);
|
||||
transform->Position = glm::vec3(0.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(1.0, 1.0, 1.0);
|
||||
pointLight->Specular = glm::vec3(3.0, 3.0, 3.0);
|
||||
pointLight->Diffuse = glm::vec3(3.0, 0.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";
|
||||
ent = CreateEntity();
|
||||
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->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||
pointLight->Diffuse = 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();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(0.f, -4.f, 0.f);
|
||||
model = AddComponent<Components::Model>(ent, "Model");
|
||||
model->ModelFile = "plane.obj";
|
||||
|
||||
// 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();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(10.f, 0.f, 0.f);
|
||||
model = AddComponent<Components::Model>(ent, "Model");
|
||||
model->ModelFile = "ship.obj";
|
||||
}
|
||||
|
||||
void GameWorld::Update(double dt)
|
||||
{
|
||||
@@ -35,53 +128,4 @@ void GameWorld::RegisterSystems()
|
||||
m_SystemFactory.Register("PlayerSystem", [this]() { return new Systems::PlayerSystem(this); });
|
||||
m_SystemFactory.Register("SoundSystem", [this]() { return new Systems::SoundSystem(this); });
|
||||
m_SystemFactory.Register("RenderSystem", [this]() { return new Systems::RenderSystem(this, m_Renderer); });
|
||||
}
|
||||
|
||||
void GameWorld::Initialize()
|
||||
{
|
||||
World::Initialize();
|
||||
|
||||
//AddSystem("LevelGenerationSystem");
|
||||
AddSystem("InputSystem");
|
||||
//AddSystem("CollisionSystem");
|
||||
//AddSystem("ParticleSystem");
|
||||
AddSystem("PlayerSystem");
|
||||
AddSystem("SoundSystem");
|
||||
AddSystem("RenderSystem");
|
||||
|
||||
std::shared_ptr<Components::Transform> transform;
|
||||
std::shared_ptr<Components::Model> model;
|
||||
std::shared_ptr<Components::Camera> camera;
|
||||
EntityID ent;
|
||||
|
||||
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";
|
||||
auto soundEmitter = AddComponent<Components::SoundEmitter>(ent, "SoundEmitter");
|
||||
soundEmitter->Gain = 1;
|
||||
soundEmitter->MaxDistance = FLT_MAX;
|
||||
soundEmitter->ReferenceDistance = 10;
|
||||
soundEmitter->Loop = true;
|
||||
|
||||
soundEmitter->Pitch = 1;
|
||||
GetSystem<Systems::SoundSystem>("SoundSystem")->PlaySound(soundEmitter, "Sounds/hallelujah.wav");
|
||||
|
||||
|
||||
ent = CreateEntity();
|
||||
SetProperty(ent, "Name", std::string("Camera"));
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
AddComponent<Components::Input>(ent, "Input");
|
||||
transform->Position = glm::vec3(0.f, 2.f, 10.f);
|
||||
camera = AddComponent<Components::Camera>(ent, "Camera");
|
||||
camera->FOV = 45.f;
|
||||
camera->FarClip = 1000.f;
|
||||
camera->NearClip = 0.01f;
|
||||
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
|
||||
}
|
||||
|
||||
GameWorld::GameWorld(std::shared_ptr<Renderer> renderer) : m_Renderer(renderer), World()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,13 +30,15 @@
|
||||
class GameWorld : public World
|
||||
{
|
||||
public:
|
||||
GameWorld(std::shared_ptr<Renderer> renderer);
|
||||
void Initialize() override;
|
||||
GameWorld(std::shared_ptr<Renderer> renderer)
|
||||
: m_Renderer(renderer), World() { }
|
||||
|
||||
void Initialize();
|
||||
|
||||
void RegisterSystems() override;
|
||||
void RegisterComponents() override;
|
||||
|
||||
void Update(double dt) override;
|
||||
void Update(double dt) ;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Renderer> m_Renderer;
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
#ifndef GameWorld_h__
|
||||
#define GameWorld_h__
|
||||
|
||||
#include "World.h"
|
||||
#include "Renderer.h"
|
||||
|
||||
#include "Systems/CollisionSystem.h"
|
||||
#include "Systems/InputSystem.h"
|
||||
#include "Systems/LevelGenerationSystem.h"
|
||||
#include "Systems/ParticleSystem.h"
|
||||
#include "Systems/PlayerSystem.h"
|
||||
#include "Systems/RenderSystem.h"
|
||||
#include "Systems/SoundSystem.h"
|
||||
|
||||
#include "Components/Bounds.h"
|
||||
#include "Components/Camera.h"
|
||||
#include "Components/Collision.h"
|
||||
#include "Components/DirectionalLight.h"
|
||||
#include "Components/Input.h"
|
||||
#include "Components/Model.h"
|
||||
#include "Components/ParticleEmitter.h"
|
||||
#include "Components/PointLight.h"
|
||||
#include "Components/PowerUp.h"
|
||||
#include "Components/SoundEmitter.h"
|
||||
#include "Components/Sprite.h"
|
||||
#include "Components/Stat.h"
|
||||
#include "Components/Template.h"
|
||||
#include "Components/Transform.h"
|
||||
|
||||
class GameWorld : public World
|
||||
{
|
||||
public:
|
||||
GameWorld(std::shared_ptr<Renderer> renderer);
|
||||
void Initialize() override;
|
||||
|
||||
void RegisterSystems() override;
|
||||
void RegisterComponents() override;
|
||||
|
||||
void Update(double dt) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Renderer> m_Renderer;
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
GameWorld::GameWorld(std::shared_ptr<Renderer> renderer)
|
||||
: m_Renderer(renderer), World()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GameWorld::Initialize()
|
||||
{
|
||||
World::Initialize();
|
||||
|
||||
//AddSystem("LevelGenerationSystem");
|
||||
AddSystem("InputSystem");
|
||||
//AddSystem("CollisionSystem");
|
||||
//AddSystem("ParticleSystem");
|
||||
AddSystem("PlayerSystem");
|
||||
AddSystem("SoundSystem");
|
||||
AddSystem("RenderSystem");
|
||||
|
||||
std::shared_ptr<Components::Transform> transform;
|
||||
std::shared_ptr<Components::Model> model;
|
||||
std::shared_ptr<Components::PointLight> pointLight;
|
||||
std::shared_ptr<Components::Camera> camera;
|
||||
EntityID ent;
|
||||
|
||||
ent = CreateEntity();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(0.f, 4.f, 0.f);
|
||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||
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;
|
||||
|
||||
ent = CreateEntity();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(10.f, 4.f, 0.f);
|
||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||
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;
|
||||
|
||||
ent = CreateEntity();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(0.f, -4.f, 0.f);
|
||||
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
|
||||
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
|
||||
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;
|
||||
|
||||
ent = CreateEntity();
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
transform->Position = glm::vec3(10.f, 0.f, 0.f);
|
||||
model = AddComponent<Components::Model>(ent, "Model");
|
||||
model->ModelFile = "ship.obj";
|
||||
|
||||
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";
|
||||
// auto soundEmitter = AddComponent<Components::SoundEmitter>(ent, "SoundEmitter");
|
||||
// soundEmitter->Gain = 1;
|
||||
// soundEmitter->MaxDistance = FLT_MAX;
|
||||
// soundEmitter->ReferenceDistance = 10;
|
||||
// soundEmitter->Loop = true;
|
||||
// soundEmitter->ReferenceDistance = 0.1;
|
||||
// soundEmitter->Pitch = 1;
|
||||
// GetSystem<Systems::SoundSystem>("SoundSystem")->PlaySound(soundEmitter, "Sounds/hallelujah.wav");
|
||||
|
||||
ent = CreateEntity();
|
||||
SetProperty(ent, "Name", std::string("Camera"));
|
||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||
AddComponent<Components::Input>(ent, "Input");
|
||||
transform->Position = glm::vec3(0.f, 2.f, 10.f);
|
||||
camera = AddComponent<Components::Camera>(ent, "Camera");
|
||||
camera->FOV = 45.f;
|
||||
camera->FarClip = 1000.f;
|
||||
camera->NearClip = 0.01f;
|
||||
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
|
||||
}
|
||||
|
||||
void GameWorld::RegisterSystems()
|
||||
{
|
||||
//m_SystemFactory.Register("LevelGenerationSystem", [this]() { return new Systems::LevelGenerationSystem(this); });
|
||||
m_SystemFactory.Register("InputSystem", [this]() { return new Systems::InputSystem(this, m_Renderer); });
|
||||
//m_SystemFactory.Register("CollisionSystem", [this]() { return new Systems::CollisionSystem(this); });
|
||||
//m_SystemFactory.Register("ParticleSystem", [this]() { return new Systems::ParticleSystem(this); });
|
||||
m_SystemFactory.Register("PlayerSystem", [this]() { return new Systems::PlayerSystem(this); });
|
||||
m_SystemFactory.Register("SoundSystem", [this]() { return new Systems::SoundSystem(this); });
|
||||
m_SystemFactory.Register("RenderSystem", [this]() { return new Systems::RenderSystem(this, m_Renderer); });
|
||||
}
|
||||
|
||||
void GameWorld::RegisterComponents()
|
||||
{
|
||||
m_ComponentFactory.Register("Bounds", []() { return new Components::Bounds(); });
|
||||
m_ComponentFactory.Register("Camera", []() { return new Components::Camera(); });
|
||||
m_ComponentFactory.Register("Collision", []() { return new Components::Collision(); });
|
||||
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
|
||||
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
|
||||
m_ComponentFactory.Register("Model", []() { return new Components::Model(); });
|
||||
m_ComponentFactory.Register("ParticleEmitter", []() { return new Components::ParticleEmitter(); });
|
||||
m_ComponentFactory.Register("PointLight", []() { return new Components::PointLight(); });
|
||||
m_ComponentFactory.Register("PowerUp", []() { return new Components::PowerUp(); });
|
||||
m_ComponentFactory.Register("SoundEmitter", []() { return new Components::SoundEmitter(); });
|
||||
m_ComponentFactory.Register("Sprite", []() { return new Components::Sprite(); });
|
||||
m_ComponentFactory.Register("Stat", []() { return new Components::Stat(); });
|
||||
m_ComponentFactory.Register("Template", []() { return new Components::Template(); });
|
||||
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
|
||||
}
|
||||
|
||||
void GameWorld::Update(double dt)
|
||||
{
|
||||
World::Update(dt);
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> origin/master
|
||||
#endif // GameWorld_h__
|
||||
@@ -0,0 +1,150 @@
|
||||
#
|
||||
# Wavefront material file
|
||||
# Converted by the DEEP Exploration Deep Exploration 6.5 x64 6.5.0.9182
|
||||
# Right Hemisphere, LTD
|
||||
# http://www.righthemisphere.com/
|
||||
#
|
||||
|
||||
newmtl MG_MovieCycle_Body_MI
|
||||
Ka 0 0 0
|
||||
Kd 0 0 0
|
||||
Ks 1 1 1
|
||||
illum 2
|
||||
Ns 32
|
||||
map_Kd MG_MovieCycle_BodyHeadLight_EMSS.tga
|
||||
map_bump MG_MovieCycle_Body_NORM.tga
|
||||
bump MG_MovieCycle_Body_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS MG_MovieCycle_Body_SPEC.tga
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_Glass_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 0.84 0.84 0.84
|
||||
illum 2
|
||||
Ns 33.6359
|
||||
map_Kd Glass.tga
|
||||
map_bump
|
||||
bump
|
||||
map_opacity Glass.tga
|
||||
map_d Glass.tga
|
||||
refl
|
||||
map_kS
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_Tire_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 0 0 0
|
||||
illum 2
|
||||
Ns 10
|
||||
map_Kd MG_MovieCycle_Tire_EMSS.tga
|
||||
map_bump MG_MovieCycle_Tire_NORM.tga
|
||||
bump MG_MovieCycle_Tire_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_Engine_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 0 0 0
|
||||
illum 2
|
||||
Ns 10
|
||||
map_Kd MG_MovieCycle_Engine_EMSS.tga
|
||||
map_bump MG_MovieCycle_Engine_NORM.tga
|
||||
bump MG_MovieCycle_Engine_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_PlayerBody_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
illum 2
|
||||
Ns 10
|
||||
map_Kd MG_Player_Body_EMSS.tga
|
||||
map_bump MG_Player_Body_NORM.tga
|
||||
bump MG_Player_Body_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS MG_Player_Body_SPEC.tga
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_PlayerHelmet_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
illum 2
|
||||
Ns 6.27667
|
||||
map_Kd MG_Player_Helmet_EMSS.tga
|
||||
map_bump MG_Player_Helmet_NORM.tga
|
||||
bump MG_Player_Helmet_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS MG_Player_Helmet_SPEC.tga
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_PlayerDisc_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
illum 2
|
||||
Ns 10
|
||||
map_Kd MG_Player_Disc_EMSS.tga
|
||||
map_bump MG_Player_Disc_NORM.tga
|
||||
bump MG_Player_Disc_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS MG_Player_Disc_SPEC.tga
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl MG_MovieCycle_PlayerBaton_MI
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
illum 2
|
||||
Ns 10
|
||||
map_Kd MG_Player_Baton_EMSS.tga
|
||||
map_bump MG_Player_Baton_NORM.tga
|
||||
bump MG_Player_Baton_NORM.tga
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS MG_Player_Baton_SPEC.tga
|
||||
map_kA
|
||||
map_Ns
|
||||
|
||||
newmtl Explorer_Default
|
||||
Ka 0.117647 0.117647 0.117647
|
||||
Kd 0.752941 0.752941 0.752941
|
||||
Ks 0.752941 0.752941 0.752941
|
||||
illum 2
|
||||
Ns 8
|
||||
map_Kd
|
||||
map_bump
|
||||
bump
|
||||
map_opacity
|
||||
map_d
|
||||
refl
|
||||
map_kS
|
||||
map_kA
|
||||
map_Ns
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -72,6 +72,17 @@ void Renderer::Draw(double dt)
|
||||
glPolygonMode(GL_FRONT_AND_BACK, m_DrawWireframe ? GL_LINE : GL_FILL);
|
||||
DrawModels();
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debug draw normals
|
||||
if (m_DrawNormals) {
|
||||
m_ShaderProgramNormals.Bind();
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
DrawModels();
|
||||
}
|
||||
#endif
|
||||
|
||||
ModelsToRender.clear();
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debug draw normals
|
||||
if (m_DrawNormals) {
|
||||
@@ -100,10 +111,13 @@ void Renderer::DrawModels()
|
||||
glUniformMatrix4fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "MVP"), 1, GL_FALSE, glm::value_ptr(MVP));
|
||||
glUniformMatrix4fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "model"), 1, GL_FALSE, glm::value_ptr(modelData->ModelMatrix));
|
||||
glUniformMatrix4fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "view"), 1, GL_FALSE, glm::value_ptr(m_Camera->ViewMatrix()));
|
||||
glUniform3fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "lightPosition"), 1, glm::value_ptr(glm::vec3(2.0f, 4.0f, 1.0f)));
|
||||
glUniform1f(glGetUniformLocation(m_ShaderProgram.GetHandle(), "constantAttenuation"), 1.5f);
|
||||
glUniform1f(glGetUniformLocation(m_ShaderProgram.GetHandle(), "linearAttenuation"), 0.0f);
|
||||
glUniform1f(glGetUniformLocation(m_ShaderProgram.GetHandle(), "quadraticAttenuation"), 0.0f);
|
||||
glUniform3fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "position"), 3, Light_position.data());
|
||||
glUniform3fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "specular"), 3, Light_specular.data());
|
||||
glUniform3fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "diffuse"), 3, Light_diffuse.data());
|
||||
glUniform1fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "constantAttenuation"), 3, Light_constantAttenuation.data());
|
||||
glUniform1fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "linearAttenuation"), 3, Light_linearAttenuation.data());
|
||||
glUniform1fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "quadraticAttenuation"), 3, Light_quadraticAttenuation.data());
|
||||
glUniform1fv(glGetUniformLocation(m_ShaderProgram.GetHandle(), "spotExponent"), 3, Light_spotExponent.data());
|
||||
|
||||
|
||||
glBindVertexArray(model->VAO);
|
||||
@@ -133,7 +147,32 @@ void Renderer::AddModelToDraw(std::shared_ptr<Model> _model, glm::vec3 _position
|
||||
ModelsToRender.push_back(new ModelData(_model, ModelMatrix));
|
||||
}
|
||||
|
||||
//Fixa med shaders, lägga in alla verts osv.
|
||||
void Renderer::AddPointLightToDraw(
|
||||
glm::vec3 _position,
|
||||
glm::vec3 _specular,
|
||||
glm::vec3 _diffuse,
|
||||
float _constantAttenuation,
|
||||
float _linearAttenuation,
|
||||
float _quadraticAttenuation,
|
||||
float _spotExponent
|
||||
)
|
||||
{
|
||||
Light_position.push_back(_position.x);
|
||||
Light_position.push_back(_position.y);
|
||||
Light_position.push_back(_position.z);
|
||||
Light_specular.push_back(_specular.x);
|
||||
Light_specular.push_back(_specular.y);
|
||||
Light_specular.push_back(_specular.z);
|
||||
Light_diffuse.push_back(_diffuse.x);
|
||||
Light_diffuse.push_back(_diffuse.y);
|
||||
Light_diffuse.push_back(_diffuse.z);
|
||||
Light_constantAttenuation.push_back(_constantAttenuation);
|
||||
Light_linearAttenuation.push_back(_linearAttenuation);
|
||||
Light_quadraticAttenuation.push_back(_quadraticAttenuation);
|
||||
Light_spotExponent.push_back(_spotExponent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Renderer::LoadContent()
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "Camera.h"
|
||||
#include "ShaderProgram.h"
|
||||
#include "Model.h"
|
||||
#include "Components/PointLight.h"
|
||||
|
||||
class Renderer
|
||||
{
|
||||
@@ -38,6 +39,13 @@ public:
|
||||
};
|
||||
|
||||
std::vector<ModelData*> ModelsToRender;
|
||||
std::vector<float> Light_position;
|
||||
std::vector<float> Light_specular;
|
||||
std::vector<float> Light_diffuse;
|
||||
std::vector<float> Light_constantAttenuation;
|
||||
std::vector<float> Light_linearAttenuation;
|
||||
std::vector<float> Light_quadraticAttenuation;
|
||||
std::vector<float> Light_spotExponent;
|
||||
|
||||
Renderer();
|
||||
|
||||
@@ -47,6 +55,15 @@ public:
|
||||
|
||||
void AddModelToDraw(std::shared_ptr<Model> model, glm::vec3 position, glm::quat orientation);
|
||||
void AddTextToDraw();
|
||||
void AddPointLightToDraw(
|
||||
glm::vec3 _position,
|
||||
glm::vec3 _specular,
|
||||
glm::vec3 _diffuse,
|
||||
float _constantAttenuation,
|
||||
float _linearAttenuation,
|
||||
float _quadraticAttenuation,
|
||||
float _spotExponent
|
||||
);
|
||||
|
||||
void LoadContent();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
newmtl material_1
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0.121569 0.121569 0.121569
|
||||
Kd 1 1 1
|
||||
Ks 0 0 0
|
||||
Km 0
|
||||
map_Kd /Maps/snd2_01.jpg
|
||||
|
||||
newmtl material_1_mountain
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 0.501961 0.501961 0.501961
|
||||
Ks 0 0 0
|
||||
Km 0
|
||||
map_Kd /Maps/mtlm1.jpg
|
||||
|
||||
newmtl default
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 0.290196 0.282353 0.254902
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/1thr.jpg
|
||||
|
||||
newmtl default_bldgs2
|
||||
d 1
|
||||
Ns 1
|
||||
Ni 0
|
||||
Ka 0 0 0
|
||||
Kd 1 1 1
|
||||
Ks 1 1 1
|
||||
Km 0
|
||||
map_Kd /Maps/axq2.jpg
|
||||
|
||||
@@ -2,74 +2,91 @@
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
|
||||
|
||||
layout(binding=0) uniform sampler2D texture;
|
||||
|
||||
uniform vec3 lightPosition;
|
||||
uniform float constantAttenuation;
|
||||
uniform float linearAttenuation;
|
||||
uniform float quadraticAttenuation;
|
||||
const int numberOfLights = 3;
|
||||
|
||||
in VertexData {
|
||||
uniform vec3 position[numberOfLights];
|
||||
uniform vec3 specular[numberOfLights];
|
||||
uniform vec3 diffuse[numberOfLights];
|
||||
uniform float constantAttenuation[numberOfLights];
|
||||
uniform float linearAttenuation[numberOfLights];
|
||||
uniform float quadraticAttenuation[numberOfLights];
|
||||
uniform float spotExponent[numberOfLights];
|
||||
|
||||
in VertexData {
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
vec3 scene_ambient = vec3(0.5, 0.5, 0.5);
|
||||
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main() {
|
||||
|
||||
// Texture
|
||||
vec4 texel = texture2D(texture, Input.TextureCoord);
|
||||
//vec4 texel1 = texture2D(texture1, Input.TextureCoord * 32.0);
|
||||
//vec4 texel2 = texture2D(texture2, Input.TextureCoord * 100.0);
|
||||
//vec4 blend = texture2D(blendmap, Input.TextureCoord);
|
||||
|
||||
//vec4 texel = (blend.x * texel0) + (blend.y * texel1) + (blend.z * texel2);
|
||||
|
||||
//
|
||||
// Phong shading
|
||||
//
|
||||
|
||||
// Light
|
||||
//vec3 lightPosition = vec3(0, 0, 2);
|
||||
vec3 Ls = vec3(1.0, 1.0, 0.9); // Specular light
|
||||
vec3 Ld = vec3(1.0, 1.0, 0.9); // Diffuse light
|
||||
vec3 La = vec3(0.6, 0.6, 0.6); // Ambient light
|
||||
|
||||
// Object
|
||||
// Ambient light
|
||||
vec3 La = scene_ambient; // Ambient light
|
||||
vec3 Ks = vec3(0.3, 0.3, 0.3); // Specular reflectance
|
||||
vec3 Kd = vec3(1.0, 1.0, 1.0); // Diffuse reflectance
|
||||
vec3 Ka = vec3(1.0, 1.0, 1.0); // Ambient reflectance
|
||||
vec3 Is;
|
||||
vec3 Id;
|
||||
|
||||
vec3 lightPosView = vec3(view * vec4(lightPosition, 1.0));
|
||||
vec3 totalLighting = La * Ka;
|
||||
|
||||
float attenuation;
|
||||
|
||||
for(int i = 0; i < numberOfLights; i++)
|
||||
{
|
||||
// Light
|
||||
//vec3 lightPosition = vec3(0, 0, 2);
|
||||
vec3 Ls = specular[i]; // Specular light
|
||||
vec3 Ld = diffuse[i]; // Diffuse light
|
||||
|
||||
|
||||
vec3 lightPosView = vec3(view * vec4(position[i], 1.0));
|
||||
vec3 surfacePosition = vec3(model * vec4(Input.Position, 1.0));
|
||||
vec3 surfacePosView = vec3(view * vec4(surfacePosition, 1.0));
|
||||
vec3 surfaceToLight = normalize(lightPosView - surfacePosView);
|
||||
mat3 normalMatrix = transpose(inverse(mat3(view * model)));
|
||||
vec3 surfaceNormal = normalize(normalMatrix * Input.Normal);
|
||||
|
||||
float dist = length(position[i] - surfacePosition);
|
||||
|
||||
attenuation = 1.0 / (constantAttenuation[i]
|
||||
+ linearAttenuation[i] * dist
|
||||
+ quadraticAttenuation[i] * pow(dist, 2.0));
|
||||
//attenuation = attenuation * pow(clampedCosine, spotExponent[i]);
|
||||
|
||||
// Diffuse light
|
||||
float dotProd = dot(surfaceToLight, surfaceNormal);
|
||||
dotProd = max(dotProd, 0.0);
|
||||
|
||||
Id = Ld * Kd * abs(dotProd) * attenuation;
|
||||
|
||||
// Specular light
|
||||
vec3 reflection = reflect(-surfaceToLight, surfaceNormal);
|
||||
float dotSpecular = dot(reflection, normalize(-surfacePosView));
|
||||
dotSpecular = max(dotSpecular, 0.0);
|
||||
float specularFactor = pow(dotSpecular, 30.0); // Specular factor
|
||||
vec3 Is = Ls * Ks * specularFactor;
|
||||
|
||||
Is = attenuation * Ls * Ks * specularFactor;
|
||||
|
||||
// Diffuse light
|
||||
float dotProd = dot(surfaceToLight, surfaceNormal);
|
||||
dotProd = max(dotProd, 0.0);
|
||||
vec3 Id = Ld * Kd * abs(dotProd);
|
||||
|
||||
// Ambient light
|
||||
vec3 Ia = La * Ka;
|
||||
|
||||
float dist = length(lightPosition - surfacePosition);
|
||||
float attenuation = 1.0 / (constantAttenuation
|
||||
+ linearAttenuation * dist
|
||||
+ quadraticAttenuation * pow(dist, 2.0));
|
||||
|
||||
fragmentColor = vec4((Is + Id) * attenuation + Ia, 1.0) * texel;
|
||||
totalLighting = totalLighting + Id + Is;
|
||||
}
|
||||
fragmentColor = vec4(totalLighting, 1.0) * texel;
|
||||
|
||||
|
||||
//fragmentColor = vec4(Id, 1.0) * texel;
|
||||
|
||||
|
||||
@@ -27,8 +27,19 @@ void Systems::RenderSystem::UpdateEntity( double dt, EntityID entity, EntityID p
|
||||
auto model = m_CachedModels[modelComponent->ModelFile];
|
||||
m_Renderer->AddModelToDraw(model, transformComponent->Position, transformComponent->Orientation);
|
||||
}
|
||||
|
||||
// Update camera
|
||||
auto pointLightComponent = m_World->GetComponent<Components::PointLight>(entity, "PointLight");
|
||||
if (pointLightComponent != nullptr)
|
||||
{
|
||||
|
||||
m_Renderer->AddPointLightToDraw(
|
||||
transformComponent->Position,
|
||||
pointLightComponent->Specular,
|
||||
pointLightComponent->Diffuse,
|
||||
pointLightComponent->constantAttenuation,
|
||||
pointLightComponent->linearAttenuation,
|
||||
pointLightComponent->quadraticAttenuation,
|
||||
pointLightComponent->spotExponent);
|
||||
}
|
||||
auto cameraComponent = m_World->GetComponent<Components::Camera>(entity, "Camera");
|
||||
if (cameraComponent != nullptr)
|
||||
{
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "RenderSystem.h"
|
||||
#include "World.h"
|
||||
|
||||
void Systems::RenderSystem::OnComponentCreated( std::string type, std:: shared_ptr<Component> component )
|
||||
{
|
||||
if(type == "Model")
|
||||
{
|
||||
auto modelComponent = std::static_pointer_cast<Components::Model>(component);
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (m_CachedModels.find(modelComponent->ModelFile) != m_CachedModels.end()) {
|
||||
m_CachedModels[modelComponent->ModelFile] = new Model(modelComponent->ModelFile);
|
||||
}
|
||||
=======
|
||||
>>>>>>> ce6b570520794087eb98447a571578585a705ded
|
||||
}
|
||||
}
|
||||
|
||||
void Systems::RenderSystem::UpdateEntity( double dt, EntityID entity, EntityID parent )
|
||||
{
|
||||
auto modelComponent = m_World->GetComponent<Components::Model>(entity, "Model");
|
||||
if (modelComponent == nullptr)
|
||||
return;
|
||||
auto transformComponent = m_World->GetComponent<Components::Transform>(entity, "Transform");
|
||||
if (transformComponent == nullptr)
|
||||
return;
|
||||
|
||||
if (m_CachedModels.find(modelComponent->ModelFile) == m_CachedModels.end()) {
|
||||
m_CachedModels[modelComponent->ModelFile] = new Model(modelComponent->ModelFile);
|
||||
}
|
||||
Model* model = m_CachedModels[modelComponent->ModelFile];
|
||||
m_Renderer->AddModelToDraw(model, transformComponent->Position, transformComponent->Orientation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef RenderSystem_h__
|
||||
#define RenderSystem_h__
|
||||
#define RenderSystem_h__
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -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,17 @@
|
||||
# Blender v2.69 (sub 0) OBJ File: 'obstaclesandstuff.blend'
|
||||
# www.blender.org
|
||||
mtllib plane.mtl
|
||||
o Plane_Plane.001
|
||||
v 102.461288 0.778257 97.553291
|
||||
v -97.538712 0.778257 97.553291
|
||||
v 102.461288 0.778257 -102.446709
|
||||
v -97.538712 0.778257 -102.446709
|
||||
vt 0.000100 0.000100
|
||||
vt 0.999900 0.000100
|
||||
vt 0.000100 0.999900
|
||||
vt 0.999900 0.999900
|
||||
vn 0.000000 1.000000 0.000000
|
||||
usemtl Material.004
|
||||
s off
|
||||
f 2/1/1 1/2/1 4/3/1
|
||||
f 1/2/1 3/4/1 4/3/1
|
||||
@@ -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
|
||||
@@ -0,0 +1,211 @@
|
||||
# Blender v2.69 (sub 0) OBJ File: 'obstaclesandstuff.blend'
|
||||
# www.blender.org
|
||||
mtllib sphere.mtl
|
||||
o Icosphere
|
||||
v -0.000000 -0.184854 -0.000000
|
||||
v 0.133761 -0.082670 0.097182
|
||||
v -0.051091 -0.082670 0.157246
|
||||
v -0.165338 -0.082669 -0.000000
|
||||
v -0.051091 -0.082670 -0.157246
|
||||
v 0.133761 -0.082670 -0.097182
|
||||
v 0.051091 0.082670 0.157246
|
||||
v -0.133761 0.082670 0.097182
|
||||
v -0.133761 0.082670 -0.097182
|
||||
v 0.051091 0.082670 -0.157246
|
||||
v 0.165338 0.082669 -0.000000
|
||||
v -0.000000 0.184854 -0.000000
|
||||
v -0.030031 -0.157247 0.092426
|
||||
v 0.078622 -0.157247 0.057122
|
||||
v 0.048592 -0.097185 0.149549
|
||||
v 0.157245 -0.097184 -0.000000
|
||||
v 0.078622 -0.157247 -0.057122
|
||||
v -0.097183 -0.157246 -0.000000
|
||||
v -0.127214 -0.097184 0.092426
|
||||
v -0.030031 -0.157247 -0.092426
|
||||
v -0.127214 -0.097184 -0.092426
|
||||
v 0.048592 -0.097185 -0.149549
|
||||
v 0.175807 0.000000 0.057122
|
||||
v 0.175807 0.000000 -0.057122
|
||||
v -0.000000 0.000000 0.184854
|
||||
v 0.108654 0.000000 0.149550
|
||||
v -0.175807 0.000000 0.057122
|
||||
v -0.108654 0.000000 0.149550
|
||||
v -0.108654 0.000000 -0.149550
|
||||
v -0.175807 0.000000 -0.057122
|
||||
v 0.108654 0.000000 -0.149550
|
||||
v -0.000000 0.000000 -0.184854
|
||||
v 0.127214 0.097184 0.092426
|
||||
v -0.048592 0.097185 0.149549
|
||||
v -0.157245 0.097184 -0.000000
|
||||
v -0.048592 0.097185 -0.149549
|
||||
v 0.127214 0.097184 -0.092426
|
||||
v 0.030031 0.157247 0.092426
|
||||
v 0.097183 0.157246 -0.000000
|
||||
v -0.078622 0.157247 0.057122
|
||||
v -0.078622 0.157247 -0.057122
|
||||
v 0.030031 0.157247 -0.092426
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vn 0.102381 -0.943523 0.315090
|
||||
vn 0.700224 -0.661699 0.268032
|
||||
vn -0.268034 -0.943523 0.194737
|
||||
vn -0.268034 -0.943523 -0.194737
|
||||
vn 0.102381 -0.943523 -0.315090
|
||||
vn 0.904989 -0.330385 0.268031
|
||||
vn 0.024747 -0.330386 0.943521
|
||||
vn -0.889697 -0.330385 0.315095
|
||||
vn -0.574602 -0.330387 -0.748784
|
||||
vn 0.534576 -0.330386 -0.777865
|
||||
vn 0.802609 -0.125627 0.583127
|
||||
vn -0.306569 -0.125628 0.943522
|
||||
vn -0.992077 -0.125629 0.000000
|
||||
vn -0.306569 -0.125628 -0.943522
|
||||
vn 0.802609 -0.125627 -0.583127
|
||||
vn 0.408946 0.661699 0.628425
|
||||
vn -0.471300 0.661699 0.583122
|
||||
vn -0.700224 0.661699 -0.268032
|
||||
vn 0.038530 0.661699 -0.748779
|
||||
vn 0.724042 0.661695 -0.194736
|
||||
vn -0.038530 -0.661699 0.748779
|
||||
vn 0.187594 -0.794658 0.577345
|
||||
vn 0.471300 -0.661699 0.583122
|
||||
vn 0.700224 -0.661699 -0.268032
|
||||
vn 0.607060 -0.794656 0.000000
|
||||
vn 0.331304 -0.943524 0.000000
|
||||
vn -0.724042 -0.661695 0.194736
|
||||
vn -0.491119 -0.794658 0.356821
|
||||
vn -0.408946 -0.661699 0.628425
|
||||
vn -0.408946 -0.661699 -0.628425
|
||||
vn -0.491119 -0.794657 -0.356821
|
||||
vn -0.724042 -0.661695 -0.194736
|
||||
vn 0.471300 -0.661699 -0.583122
|
||||
vn 0.187594 -0.794658 -0.577345
|
||||
vn -0.038530 -0.661699 -0.748779
|
||||
vn 0.992077 0.125629 0.000000
|
||||
vn 0.982246 -0.187599 0.000000
|
||||
vn 0.904989 -0.330385 -0.268031
|
||||
vn 0.306569 0.125628 0.943522
|
||||
vn 0.303531 -0.187597 0.934171
|
||||
vn 0.534576 -0.330386 0.777865
|
||||
vn -0.802609 0.125627 0.583127
|
||||
vn -0.794655 -0.187595 0.577348
|
||||
vn -0.574602 -0.330387 0.748783
|
||||
vn -0.802609 0.125627 -0.583127
|
||||
vn -0.794655 -0.187595 -0.577348
|
||||
vn -0.889697 -0.330385 -0.315095
|
||||
vn 0.306569 0.125628 -0.943522
|
||||
vn 0.303531 -0.187597 -0.934171
|
||||
vn 0.024747 -0.330386 -0.943521
|
||||
vn 0.574602 0.330387 0.748784
|
||||
vn 0.794656 0.187595 0.577348
|
||||
vn 0.889697 0.330385 0.315095
|
||||
vn -0.534576 0.330386 0.777864
|
||||
vn -0.303531 0.187597 0.934171
|
||||
vn -0.024747 0.330386 0.943521
|
||||
vn -0.904989 0.330385 -0.268031
|
||||
vn -0.982246 0.187599 0.000000
|
||||
vn -0.904989 0.330384 0.268031
|
||||
vn -0.024747 0.330386 -0.943521
|
||||
vn -0.303531 0.187597 -0.934171
|
||||
vn -0.534576 0.330386 -0.777865
|
||||
vn 0.889697 0.330385 -0.315095
|
||||
vn 0.794655 0.187595 -0.577348
|
||||
vn 0.574602 0.330387 -0.748784
|
||||
vn 0.268034 0.943523 0.194737
|
||||
vn 0.491120 0.794657 0.356821
|
||||
vn 0.724042 0.661695 0.194736
|
||||
vn -0.102381 0.943523 0.315090
|
||||
vn -0.187594 0.794658 0.577345
|
||||
vn 0.038530 0.661699 0.748779
|
||||
vn -0.331304 0.943524 0.000000
|
||||
vn -0.607060 0.794656 0.000000
|
||||
vn -0.700224 0.661699 0.268032
|
||||
vn -0.102381 0.943524 -0.315090
|
||||
vn -0.187594 0.794658 -0.577345
|
||||
vn -0.471300 0.661699 -0.583122
|
||||
vn 0.268034 0.943523 -0.194736
|
||||
vn 0.491120 0.794657 -0.356821
|
||||
vn 0.408947 0.661699 -0.628425
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 1/1/1 14/2/1 13/3/1
|
||||
f 2/1/2 14/2/2 16/3/2
|
||||
f 1/1/3 13/2/3 18/3/3
|
||||
f 1/1/4 18/2/4 20/3/4
|
||||
f 1/1/5 20/2/5 17/3/5
|
||||
f 2/1/6 16/2/6 23/3/6
|
||||
f 3/1/7 15/2/7 25/3/7
|
||||
f 4/1/8 19/2/8 27/3/8
|
||||
f 5/1/9 21/2/9 29/3/9
|
||||
f 6/1/10 22/2/10 31/3/10
|
||||
f 2/1/11 23/2/11 26/3/11
|
||||
f 3/1/12 25/2/12 28/3/12
|
||||
f 4/1/13 27/2/13 30/3/13
|
||||
f 5/1/14 29/2/14 32/3/14
|
||||
f 6/1/15 31/2/15 24/3/15
|
||||
f 7/1/16 33/2/16 38/3/16
|
||||
f 8/1/17 34/2/17 40/3/17
|
||||
f 9/1/18 35/2/18 41/3/18
|
||||
f 10/1/19 36/2/19 42/3/19
|
||||
f 11/1/20 37/2/20 39/3/20
|
||||
f 13/1/21 15/2/21 3/3/21
|
||||
f 13/1/22 14/2/22 15/3/22
|
||||
f 14/1/23 2/2/23 15/3/23
|
||||
f 16/1/24 17/2/24 6/3/24
|
||||
f 16/1/25 14/2/25 17/3/25
|
||||
f 14/1/26 1/2/26 17/3/26
|
||||
f 18/1/27 19/2/27 4/3/27
|
||||
f 18/1/28 13/2/28 19/3/28
|
||||
f 13/1/29 3/2/29 19/3/29
|
||||
f 20/1/30 21/2/30 5/3/30
|
||||
f 20/1/31 18/2/31 21/3/31
|
||||
f 18/1/32 4/2/32 21/3/32
|
||||
f 17/1/33 22/2/33 6/3/33
|
||||
f 17/1/34 20/2/34 22/3/34
|
||||
f 20/1/35 5/2/35 22/3/35
|
||||
f 23/1/36 24/2/36 11/3/36
|
||||
f 23/1/37 16/2/37 24/3/37
|
||||
f 16/1/38 6/2/38 24/3/38
|
||||
f 25/1/39 26/2/39 7/3/39
|
||||
f 25/1/40 15/2/40 26/3/40
|
||||
f 15/1/41 2/2/41 26/3/41
|
||||
f 27/1/42 28/2/42 8/3/42
|
||||
f 27/1/43 19/2/43 28/3/43
|
||||
f 19/1/44 3/2/44 28/3/44
|
||||
f 29/1/45 30/2/45 9/3/45
|
||||
f 29/1/46 21/2/46 30/3/46
|
||||
f 21/1/47 4/2/47 30/3/47
|
||||
f 31/1/48 32/2/48 10/3/48
|
||||
f 31/1/49 22/2/49 32/3/49
|
||||
f 22/1/50 5/2/50 32/3/50
|
||||
f 26/1/51 33/2/51 7/3/51
|
||||
f 26/1/52 23/2/52 33/3/52
|
||||
f 23/1/53 11/2/53 33/3/53
|
||||
f 28/1/54 34/2/54 8/3/54
|
||||
f 28/1/55 25/2/55 34/3/55
|
||||
f 25/1/56 7/2/56 34/3/56
|
||||
f 30/1/57 35/2/57 9/3/57
|
||||
f 30/1/58 27/2/58 35/3/58
|
||||
f 27/1/59 8/2/59 35/3/59
|
||||
f 32/1/60 36/2/60 10/3/60
|
||||
f 32/1/61 29/2/61 36/3/61
|
||||
f 29/1/62 9/2/62 36/3/62
|
||||
f 24/1/63 37/2/63 11/3/63
|
||||
f 24/1/64 31/2/64 37/3/64
|
||||
f 31/1/65 10/2/65 37/3/65
|
||||
f 38/1/66 39/2/66 12/3/66
|
||||
f 38/1/67 33/2/67 39/3/67
|
||||
f 33/1/68 11/2/68 39/3/68
|
||||
f 40/1/69 38/2/69 12/3/69
|
||||
f 40/1/70 34/2/70 38/3/70
|
||||
f 34/1/71 7/2/71 38/3/71
|
||||
f 41/1/72 40/2/72 12/3/72
|
||||
f 41/1/73 35/2/73 40/3/73
|
||||
f 35/1/74 8/2/74 40/3/74
|
||||
f 42/1/75 41/2/75 12/3/75
|
||||
f 42/1/76 36/2/76 41/3/76
|
||||
f 36/1/77 9/2/77 41/3/77
|
||||
f 39/1/78 42/2/78 12/3/78
|
||||
f 39/1/79 37/2/79 42/3/79
|
||||
f 37/1/80 10/2/80 42/3/80
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,115 @@
|
||||
# Max2Mtl Version 4.0 Mar 10th, 2001
|
||||
#
|
||||
# Multi/Sub Material__10791 (9) to come
|
||||
#
|
||||
newmtl Material__46
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__47
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__48
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__49
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__50
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__51
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__52
|
||||
Ka 0.1 0.1 0.1
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.5
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__10657
|
||||
Ka 0.6 0.6 0.6
|
||||
Kd 0.6 0.6 0.6
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__10658
|
||||
Ka 0.6 0.6 0.6
|
||||
Kd 0.6 0.6 0.6
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
# Multi/Sub Material__10791 done
|
||||
#
|
||||
# Multi/Sub Material__10737 (3) to come
|
||||
#
|
||||
newmtl Material__10678
|
||||
Ka 1.0 1.0 1.0
|
||||
Kd 1.0 1.0 1.0
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__69
|
||||
Ka 0.6 0.6 0.6
|
||||
Kd 0.6 0.6 0.6
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
newmtl Material__10677
|
||||
Ka 0.6 0.6 0.6
|
||||
Kd 0.6 0.6 0.6
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
# Multi/Sub Material__10737 done
|
||||
#
|
||||
newmtl 03_-_Default
|
||||
Ka 0.5 0.5 0.5
|
||||
Kd 0.5 0.5 0.5
|
||||
Ks 0.9 0.9 0.9
|
||||
d 1.0
|
||||
Ns 0.0
|
||||
illum 2
|
||||
#
|
||||
# EOF
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user