shader\basicTexture_VS.hlsl = shader\basicTexture_VS.hlsl
shader\lightingTexture_FS.hlsl = shader\lightingTexture_FS.hlsl
shader\perspective_VS.hlsl = shader\perspective_VS.hlsl
- shader\skybox_color_FS.hlsl = shader\skybox_color_FS.hlsl
- shader\skybox_FS.hlsl = shader\skybox_FS.hlsl
shader\skybox_VS.hlsl = shader\skybox_VS.hlsl
+ shader\skyplane_color_FS.hlsl = shader\skyplane_color_FS.hlsl
+ shader\skyplane_FS.hlsl = shader\skyplane_FS.hlsl
+ shader\skyplane_VS.hlsl = shader\skyplane_VS.hlsl
EndProjectSection
EndProject
Global
// load LVL
- SceneObject* tmp_world = new SceneObject(shader1, scale(vec3(2.5f,1.f,2.5f)), vec4(4.0f, 1.0f, 1.0f, 2.0f), "level_test.dae", "model_levelTest_2D.png");
+ SceneObject* tmp_world = new SceneObject(shader1, scale(vec3(2.5f,1.f,2.5f)), vec4(4.0f, 1.0f, 1.0f, 2.0f), "level_test.dae", "model_levelTest_2D.jpg");
tmp_world->ignore = true;
current_world->addObject(tmp_world);
//current_world->addObject(new SceneObject(shader1, translate(vec3(-3.f, .4f, 0.f))*scale(vec3(3.f)), "cow/cow.dae", "model_cow_2D.jpg"));
current_world->addObject(new SceneObject(shader1, translate(vec3(-3.f, .4f, 0.f))*scale(vec3(.32f)), vec4(3.0f, 0.5f, 0.4f, 1.5f), "duck.dae", "model_duck_2D.png"));
current_world->addObject(new SceneObject(shader1, translate(vec3(-5.f, .4f, 0.f))*scale(vec3(.32f)), vec4(3.0f, 3.f, 0.4f, 1.5f), "duck.dae", "model_duck_2D.png"));
+ current_world->addObject(new SceneObject(shader1, translate(vec3(-5.f, 3.f, 0.f))*scale(vec3(.32f)), vec4(3.0f, 3.f, 0.4f, 1.5f), "SkyBox.dae", "model_SkyBox_2D.jpg"));
current_world->addObject(new EventBox(translate(vec3(3.f, .4f, 0.f)),EB_LOSTZONE));
current_world->addObject(new EventBox(translate(vec3(3.f, .4f, -15.f)), EB_WINZONE));
#include "IMesh.h"
#include <GL/glew.h>
-#include <assimp/Importer.hpp>
-#include <assimp/scene.h>
-#include <assimp/postprocess.h>
+
#include "../../GLM.h"
root->getBBmm(min, max);
updateBB(min, max);
#else
- updateBB(numvertices, vertex);
+ updateBB(numvertices, vertex,modelMat);
#endif
genBuffer(vertexBuffer, numvertices * 3 * sizeof(float), (void*)vertex);
//
//}
-
-bool IMesh::import(const string& _modelpath, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index, uint _mindex) const
-{
- Assimp::Importer importer;
-
- const aiScene* scene = importer.ReadFile("../models/" + _modelpath, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType); //aiProcess_PreTransformVertices
- if (!scene)
- {
- Message::error("The file " + _modelpath + " couldn't be read.\n" + importer.GetErrorString());
- return false;
- }
-
- if (!scene->HasMeshes() || scene->mNumMeshes <= _mindex)
- {
- Message::error("The file " + _modelpath + " doesn't contain any nodes.");
- return false;
- }
-
- return import(scene->mMeshes[_mindex], numvertices, numfaces, vertex, uvs, normals, index);
-}
-
-bool IMesh::import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index) const
-{
-
- numvertices = mesh->mNumVertices;
- numfaces = mesh->mNumFaces;
- vertex = new float[numvertices * 3];
- uvs = new float[numvertices * 2];
- index = new uint[numfaces * 3];
- normals = new float[numvertices * 3];
- //aiFace* faces = mesh->mFaces;
-
-
- //load vertices from Mesh
- for (uint i = 0; i < numvertices; i++)
- {
- vertex[3 * i] = mesh->mVertices[i].x;
- vertex[3 * i + 1] = mesh->mVertices[i].y;
- vertex[3 * i + 2] = mesh->mVertices[i].z;
- }
-
- //load UVs from Mesh
- for (uint i = 0; i < numvertices; i++)
- {
- uvs[2 * i] = mesh->mTextureCoords[0][i].x;//[i]->x;
- uvs[2 * i + 1] = mesh->mTextureCoords[0][i].y;//[i]->y;
- }
-
- //load indices from Mesh
- for (uint i = 0; i < numfaces; i++)
- {
- index[3 * i] = mesh->mFaces[i].mIndices[0];
- index[3 * i + 1] = mesh->mFaces[i].mIndices[1];
- index[3 * i + 2] = mesh->mFaces[i].mIndices[2];
- }
-
- //load normals from Mesh
- for (uint i = 0; i < numvertices; i++)
- {
- normals[3 * i] = mesh->mNormals[i].x;
- normals[3 * i + 1] = mesh->mNormals[i].y;
- normals[3 * i + 2] = mesh->mNormals[i].z;
- }
-
- return true;
-}
-
Overlap IMesh::checkColS2O(const mat4& _mMat, const Model* _model, const mat4& _modelMat) const
{
//Outer BBox
//catch if list has only two elements => 2 LEAFS
if (_triList.size() == 2)
return new Node(center, size, _triList.front(), _triList.back());
+ if (_triList.size() == 3)
+ {
+ vec3 nC, nS;
+ list<Node*> tmpList = _triList;
+ Node* tmpNode = tmpList.front();
+ tmpList.pop_front();
+ getPSfromNodeList(nC, nS, tmpList);
+
+ return new Node(center, size, tmpNode, buildMeshTree(tmpList, nC, nS));
+ }
//find longest dist
vec3 sort = sortVec3(size);
class Shader;
class Texture;
-struct aiMesh;
class IMesh : public Model
{
float *vertex = nullptr, *normals = nullptr, *uvs = nullptr;
uint *index = nullptr;
- // Mesh Speichern?
- bool import(const std::string& modelpath, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index , uint mindex = 0) const;
- bool import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index) const;
-
-
Node* root;
#include "../Graphix.h"
+#include <assimp/Importer.hpp>
+#include <assimp/scene.h>
+#include <assimp/postprocess.h>
+
#include "BBox.h"
#include "SkyBox.h"
#include "IMetaMesh.h"
return 1;
}
+
+bool Model::import(const string& _modelpath, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index, uint _mindex)
+{
+ Assimp::Importer importer;
+
+ const aiScene* scene = importer.ReadFile("../models/" + _modelpath, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType); //aiProcess_PreTransformVertices
+ if (!scene)
+ {
+ Message::error("The file " + _modelpath + " couldn't be read.\n" + importer.GetErrorString());
+ return false;
+ }
+
+ if (!scene->HasMeshes() || scene->mNumMeshes <= _mindex)
+ {
+ Message::error("The file " + _modelpath + " doesn't contain any nodes.");
+ return false;
+ }
+
+ return import(scene->mMeshes[_mindex], numvertices, numfaces, vertex, uvs, normals, index);
+}
+
+bool Model::import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index)
+{
+
+ numvertices = mesh->mNumVertices;
+ numfaces = mesh->mNumFaces;
+ vertex = new float[numvertices * 3];
+ uvs = new float[numvertices * 2];
+ index = new uint[numfaces * 3];
+ normals = new float[numvertices * 3];
+ //aiFace* faces = mesh->mFaces;
+
+
+ //load vertices from Mesh
+ for (uint i = 0; i < numvertices; i++)
+ {
+ vertex[3 * i] = mesh->mVertices[i].x;
+ vertex[3 * i + 1] = mesh->mVertices[i].y;
+ vertex[3 * i + 2] = mesh->mVertices[i].z;
+ }
+
+ //load UVs from Mesh
+ for (uint i = 0; i < numvertices; i++)
+ {
+ uvs[2 * i] = mesh->mTextureCoords[0][i].x;//[i]->x;
+ uvs[2 * i + 1] = mesh->mTextureCoords[0][i].y;//[i]->y;
+ }
+
+ //load indices from Mesh
+ for (uint i = 0; i < numfaces; i++)
+ {
+ index[3 * i] = mesh->mFaces[i].mIndices[0];
+ index[3 * i + 1] = mesh->mFaces[i].mIndices[1];
+ index[3 * i + 2] = mesh->mFaces[i].mIndices[2];
+ }
+
+ //load normals from Mesh
+ for (uint i = 0; i < numvertices; i++)
+ {
+ normals[3 * i] = mesh->mNormals[i].x;
+ normals[3 * i + 1] = mesh->mNormals[i].y;
+ normals[3 * i + 2] = mesh->mNormals[i].z;
+ }
+
+ return true;
+}
+
+
Model* Model::BoundingBox = nullptr;
Model* Model::SkyBoxModel = nullptr;
std::unordered_map<string, Model*> Model::IMetaModel;
class Shader;
class Texture;
class Overlap;
+struct aiMesh;
typedef unsigned int uint;
const vec3 normal;
};
+
+ // Mesh Speichern?
+ static bool import(const std::string& modelpath, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index, uint mindex = 0);
+ static bool import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index);
+
protected:
Model();
virtual ~Model();
#include "GL/glew.h"
#include "../Graphix.h"
#include "../../GLM.h"
+#include "../Shader.h"
SkyBox::SkyBox()
numvertices = 4;
numfaces = 2;
- float vertex[] { -1.f, - 1.f, 0.f, 1.f, - 1.f, 0.f, - 1.f, 1.f, 0.f, 1.f, 1.f, 0.f };
- uint index[] { 1,3,2,0,1,2};
+ float *vertex = nullptr, *normals = nullptr, *uvs = nullptr;
+ uint *index = nullptr;
- //import("skybox.dae", numvertices, numfaces, vertex, uvs, normals, index, 0);
+ //float vertex[] { -1.f, - 1.f, 0.f, 1.f, - 1.f, 0.f, - 1.f, 1.f, 0.f, 1.f, 1.f, 0.f };
+ //uint index[] { 1,3,2,0,1,2};
+
+ import("SkyBox.dae", numvertices, numfaces, vertex, uvs, normals, index, 0);
genBuffer(vertexBuffer, numvertices * 3 * sizeof(float), (void*)vertex);
+ //genBuffer(normalBuffer, numvertices * 3 * sizeof(float), (void*)normals);
+ genBuffer(uvBuffer, numvertices * 2 * sizeof(float), (void*)uvs);
genBuffer(indexBuffer, numfaces * 3 * sizeof(uint), (void*)index);
-// delete vertex, index;
+ delete vertex, index, normals, uvs;
}
void SkyBox::drawModel(Shader* _shader, Texture* _texture, const mat4& _modelMat) const
{
- glDisable(GL_DEPTH_TEST);
+ //_shader->useShader();
+ //GLint OldCullFaceMode;
+ //glGetIntegerv(GL_CULL_FACE_MODE, &OldCullFaceMode);
+ GLint OldDepthFuncMode;
+ glGetIntegerv(GL_DEPTH_FUNC, &OldDepthFuncMode);
+ //glCullFace(GL_FRONT);
+ glDepthFunc(GL_LEQUAL);
+ //glDisable(GL_DEPTH_TEST);
Model::drawModel(_shader, _texture, _modelMat);
- glEnable(GL_DEPTH_TEST);
+ //glEnable(GL_DEPTH_TEST);
+ //glCullFace(OldCullFaceMode);
+ glDepthFunc(OldDepthFuncMode);
}
-void SkyBox::useModelMat(const mat4& _model, Shader* _shader) const
-{
-}
+//void SkyBox::useModelMat(const mat4& _model, Shader* _shader) const
+//{
+//}
-void SkyBox::useTexture(Texture* _texture, Shader* _shader) const
-{
-}
+//void SkyBox::useTexture(Texture* _texture, Shader* _shader) const
+//{
+//}
void SkyBox::drawBBox(const mat4& _modelMat, const vec4& _color) const
{
void drawModel(Shader* shader, Texture* texture, const mat4& modelMat) const override;
//uncommend following lines to use default Loaders
- void useModelMat(const mat4& model, Shader* shader) const override;
- void useTexture(Texture* texture, Shader* shader) const override;
+ //void useModelMat(const mat4& model, Shader* shader) const override;
+ //void useTexture(Texture* texture, Shader* shader) const override;
void drawBBox(const mat4& modelMat, const vec4& color = vec4(0.f)) const override;
operator std::string() const override;
};
-
using std::unordered_map;
-
Texture::Texture(const string& _path, const vec4& _material) : path(_path), handle(-1), TEXTURE_TYPE(-1), material(_material)
{
//Message::info("Error from before?");
viewPort.bindView(*i, lookat->getPosition() + vec3(0.0f, 1.0f, 0.0f));
}
- SkyBox.draw();
-
for (auto i = SceneObjects.cbegin(); i != SceneObjects.cend(); ++i)
{
(*i)->draw();
}
+ SkyBox.draw();
}
void Scene::addObject(SceneObject* _add)
#include "../GLM.h"
-Sky::Sky() : SceneObject(new Shader("skybox_VS.hlsl","skybox_color_FS.hlsl"), mat4(1.f), vec4(1.f), Model::getSkyBoxModel(), "")
-{
+Sky::Sky() : SceneObject(new Shader("skybox_VS.hlsl","basicTexture_FS.hlsl"), scale(vec3(20.f)), vec4(1.f), Model::getSkyBoxModel(), "model_skybox_2D.jpg")
+{
+ modelMat[3][3] = 0;
}
<author>Blender User</author>
<authoring_tool>Blender 2.73.0 commit date:2015-01-20, commit time:18:16, hash:bbf09d9</authoring_tool>
</contributor>
- <created>2015-04-21T11:48:56</created>
- <modified>2015-04-21T11:48:56</modified>
+ <created>2015-05-12T23:50:25</created>
+ <modified>2015-05-12T23:50:25</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images/>
+ <library_effects>
+ <effect id="Material-effect">
+ <profile_COMMON>
+ <technique sid="common">
+ <phong>
+ <emission>
+ <color sid="emission">0 0 0 1</color>
+ </emission>
+ <ambient>
+ <color sid="ambient">0 0 0 1</color>
+ </ambient>
+ <diffuse>
+ <color sid="diffuse">0.64 0.64 0.64 1</color>
+ </diffuse>
+ <specular>
+ <color sid="specular">0.5 0.5 0.5 1</color>
+ </specular>
+ <shininess>
+ <float sid="shininess">50</float>
+ </shininess>
+ <index_of_refraction>
+ <float sid="index_of_refraction">1</float>
+ </index_of_refraction>
+ </phong>
+ </technique>
+ </profile_COMMON>
+ </effect>
+ </library_effects>
+ <library_materials>
+ <material id="Material-material" name="Material">
+ <instance_effect url="#Material-effect"/>
+ </material>
+ </library_materials>
<library_geometries>
- <geometry id="Plane-mesh" name="Plane">
+ <geometry id="Cube-mesh" name="Cube">
<mesh>
- <source id="Plane-mesh-positions">
- <float_array id="Plane-mesh-positions-array" count="12">-1 -1 0 1 -1 0 -1 1 0 1 1 0</float_array>
+ <source id="Cube-mesh-positions">
+ <float_array id="Cube-mesh-positions-array" count="24">-1 -1.000001 -0.9999997 -1 -0.9999994 1 -1 1.000001 0.9999992 -1 0.9999993 -1.000001 1 -1.000001 -0.9999989 0.9999999 -0.9999988 1.000001 1 1.000001 0.9999992 1 0.9999998 -1</float_array>
<technique_common>
- <accessor source="#Plane-mesh-positions-array" count="4" stride="3">
+ <accessor source="#Cube-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
- <source id="Plane-mesh-normals">
- <float_array id="Plane-mesh-normals-array" count="6">0 0 1 0 0 1</float_array>
+ <source id="Cube-mesh-normals">
+ <float_array id="Cube-mesh-normals-array" count="36">1 0 0 -1 0 0 -2.98023e-7 1 -1.13249e-6 0 -1.01328e-6 -1 2.38418e-7 -1 7.7486e-7 -2.38419e-7 6.55651e-7 1 1 0 0 -1 0 -1.19209e-7 2.38419e-7 1 -5.96046e-7 3.57628e-7 -6.55651e-7 -1 1.19209e-7 -1 6.55651e-7 -3.57628e-7 7.7486e-7 1</float_array>
<technique_common>
- <accessor source="#Plane-mesh-normals-array" count="2" stride="3">
+ <accessor source="#Cube-mesh-normals-array" count="12" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
- <source id="Plane-mesh-map-0">
- <float_array id="Plane-mesh-map-0-array" count="12">0.9999001 9.998e-5 0.9999001 0.9999001 9.998e-5 0.9999001 1.0004e-4 9.998e-5 0.9999001 9.998e-5 9.998e-5 0.9999001</float_array>
+ <source id="Cube-mesh-map-0">
+ <float_array id="Cube-mesh-map-0-array" count="72">0.496875 0.668125 0.246875 0.668125 0.246875 0.338125 0.996875 0.3381249 0.996875 0.668125 0.746875 0.668125 0.246875 0.338125 0.2468749 0.008125007 0.4968749 0.008125007 0.246875 0.668125 -0.003124952 0.6681251 -0.003124952 0.3381251 0.246875 0.668125 0.496875 0.668125 0.4968751 0.998125 0.746875 0.668125 0.496875 0.668125 0.496875 0.338125 0.496875 0.338125 0.496875 0.668125 0.246875 0.338125 0.746875 0.338125 0.996875 0.3381249 0.746875 0.668125 0.496875 0.338125 0.246875 0.338125 0.4968749 0.008125007 0.246875 0.338125 0.246875 0.668125 -0.003124952 0.3381251 0.2468751 0.9981251 0.246875 0.668125 0.4968751 0.998125 0.746875 0.338125 0.746875 0.668125 0.496875 0.338125</float_array>
<technique_common>
- <accessor source="#Plane-mesh-map-0-array" count="6" stride="2">
+ <accessor source="#Cube-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
- <vertices id="Plane-mesh-vertices">
- <input semantic="POSITION" source="#Plane-mesh-positions"/>
+ <vertices id="Cube-mesh-vertices">
+ <input semantic="POSITION" source="#Cube-mesh-positions"/>
</vertices>
- <polylist count="2">
- <input semantic="VERTEX" source="#Plane-mesh-vertices" offset="0"/>
- <input semantic="NORMAL" source="#Plane-mesh-normals" offset="1"/>
- <input semantic="TEXCOORD" source="#Plane-mesh-map-0" offset="2" set="0"/>
- <vcount>3 3 </vcount>
- <p>1 0 0 3 0 1 2 0 2 0 1 3 1 1 4 2 1 5</p>
+ <polylist material="Material-material" count="12">
+ <input semantic="VERTEX" source="#Cube-mesh-vertices" offset="0"/>
+ <input semantic="NORMAL" source="#Cube-mesh-normals" offset="1"/>
+ <input semantic="TEXCOORD" source="#Cube-mesh-map-0" offset="2" set="0"/>
+ <vcount>3 3 3 3 3 3 3 3 3 3 3 3 </vcount>
+ <p>3 0 0 2 0 1 1 0 2 5 1 3 6 1 4 7 1 5 1 2 6 5 2 7 4 2 8 2 3 9 6 3 10 5 3 11 2 4 12 3 4 13 7 4 14 7 5 15 3 5 16 0 5 17 0 6 18 3 6 19 1 6 20 4 7 21 5 7 22 7 7 23 0 8 24 1 8 25 4 8 26 1 9 27 2 9 28 5 9 29 6 10 30 2 10 31 7 10 32 4 11 33 7 11 34 0 11 35</p>
</polylist>
</mesh>
</geometry>
<library_controllers/>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
- <node id="Plane" name="Plane" type="NODE">
- <matrix sid="transform">2 0 0 0 0 -8.74228e-8 -2 0 0 2 -8.74228e-8 0 0 0 0 1</matrix>
- <instance_geometry url="#Plane-mesh"/>
+ <node id="Cube" name="Cube" type="NODE">
+ <matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
+ <instance_geometry url="#Cube-mesh">
+ <bind_material>
+ <technique_common>
+ <instance_material symbol="Material-material" target="#Material-material"/>
+ </technique_common>
+ </bind_material>
+ </instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
out vec3 PointLightPosition1, DirectionalLightDirection1;
//uniform vec3 PointLightPosition1, DirectionalLightDirection1;
-uniform mat4 uProjection, uView, uModel;
+uniform mat4 uProjection, uView, uModel=mat4(1.f);
uniform int uEnableBloom = 1;
uniform int uEnableTransp = 1;
+++ /dev/null
-//Fragment Shader
-#version 330
-uniform samplerCube uColorTexture;
-
-smooth in vec3 eyeDirection;
-out vec4 FragmentColor;
-
-void main(){
- FragmentColor = texture(uColorTexture, eyeDirection);
-}
//Vertex Shader
#version 330
-in vec3 aPosition;
+in vec3 aNormal, aPosition;
+in vec2 aUV;
-uniform mat4 uInvProjection;
-uniform mat4 uModel;
-uniform mat4 uView;
+out vec2 fUVs;
-smooth out vec3 eyeDirection;
+uniform mat4 uProjection, uView, uModel=mat4(1.f);
-void main() {
-// mat4 invProjection = inverse(uProjection);
- mat3 invModelview = transpose(mat3(uView));
- vec3 unprojected = (uInvProjection * vec4(aPosition, 1)).xyz;
- eyeDirection = invModelview * unprojected;
- //eyeDirection = unprojected;
- //eyeDirection = aPosition;
+void main()
+{
- gl_Position = vec4(aPosition,1);
+ fUVs = aUV;
+ gl_Position = (uProjection * uView * uModel * vec4(aPosition, 1.f)).xyww;
}
\ No newline at end of file
+++ /dev/null
-//Fragment Shader
-#version 330
-
-smooth in vec3 eyeDirection;
-out vec4 FragmentColor;
-
-void main(){
- FragmentColor = vec4((eyeDirection+vec3(2.f))/4, 0.5);
-}
--- /dev/null
+//Fragment Shader
+#version 330
+uniform samplerCube uColorTexture;
+
+smooth in vec3 eyeDirection;
+out vec4 FragmentColor;
+
+void main(){
+ FragmentColor = texture(uColorTexture, eyeDirection);
+}
--- /dev/null
+//Vertex Shader
+#version 330
+
+in vec3 aPosition;
+
+uniform mat4 uInvProjection;
+uniform mat4 uModel;
+uniform mat4 uView;
+
+smooth out vec3 eyeDirection;
+
+void main() {
+// mat4 invProjection = inverse(uProjection);
+ mat3 invModelview = transpose(mat3(uView));
+ vec3 unprojected = (uInvProjection * vec4(aPosition, 1)).xyz;
+ eyeDirection = invModelview * unprojected;
+ //eyeDirection = unprojected;
+ //eyeDirection = aPosition;
+
+ gl_Position = vec4(aPosition,1);
+}
\ No newline at end of file
--- /dev/null
+//Fragment Shader
+#version 330
+
+smooth in vec3 eyeDirection;
+out vec4 FragmentColor;
+
+void main(){
+ FragmentColor = vec4((eyeDirection+vec3(2.f))/4, 0.5);
+}