Skip to content
Snippets Groups Projects
Commit 29426ba7 authored by Jonas Johan Solsvik's avatar Jonas Johan Solsvik
Browse files

house is rendering without shader

parent e1cf107f
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,7 @@ configure_directory(${SRCDIR}/assets/shaders ${BINDIR}/assets/shaders)
configure_directory(${SRCDIR}/assets/models ${BINDIR}/assets/models)
configure_directory(${SRCDIR}/assets/textures ${BINDIR}/assets/textures)
configure_directory(${SRCDIR}/assets/objs/cube ${BINDIR}/assets/objs/cube)
configure_directory(${SRCDIR}/assets/objs/house ${BINDIR}/assets/objs/house)
configure_directory(${SRCDIR}/assets/objs/moriknob ${BINDIR}/assets/objs/moriknob)
configure_directory(${SRCDIR}/assets/objs/rungholt ${BINDIR}/assets/objs/rungholt)
configure_file(${SRCDIR}/tool/discover.py ${BINDIR}/tool/discover.py COPYONLY)
......
cameras: 1
camera: mainCam
position: 0 0 -20
rotation: 0 0 0
velocity: 0 0 0
angleVelocity: 0 0 0
mode: orbital
fov: 90
nearClip: 0.1
farClip: 800
entities: 1
entity: skybox
model: obj/house
position: 0 0 0
rotation: 0 0 0
scale: 1 1 1
velocity: 0 0 0
angleVelocity: 0 0 0
pointlights: 3
pointlight: sunLight
position: 0 0 0
velocity: 0 0 0
intensities: 0.98 0.58 0
falloff: 1.0 0.00025 0.0012
pointlight: moonLight
position: 0 0 0
velocity: 0 0 0
intensities: 1 0 0
falloff: 1.0 0.03125 0.0625
pointlight: moonMoonLight
position: 0 0 0
velocity: 0 0 0
intensities: 0 1 0
falloff: 1.0 0.03125 0.0625
hasSun: 1
dirlight: distantSunLight
rotation: 0 0 0
angleVelocity: 0 0 0
intensities: 0.222 0.432 0.534
relations: 0
GLVersionMajor: 4
GLVersionMinor: 1
WinWidth: 800
WinHeight: 600
WinName: Assignment 2 - Cube
ClearColor: 0.4 0.4 0.5 1.0
FOV: 88.0
MaxFOV: 88.2
MinFOV: 87.97
ZoomSensitivity: 0.0
LookSensitivity: 0.084
PanSensitivity: 0.3
NearClip: 0.1
FarClip: 100.0
CameraOffset: -70
PythonPath: python3
TexturesFolder: assets/textures
ShadersFolder: assets/shaders
MaterialsFolder: assets/materials
ModelsFolder: assets/models
ScenesFolder: assets/scenes
ObjsFolder: assets/objs
MAX_LIGHTS: 8
......@@ -23,6 +23,7 @@ ShadersFolder: assets/shaders
MaterialsFolder: assets/materials
ModelsFolder: assets/models
ScenesFolder: assets/scenes
ObjsFolder: assets/docs
MAX_LIGHTS: 8
......
......@@ -19,7 +19,7 @@ struct Vertex
{
GLfloat x,y,z;
GLint n;
GLushort u,v;
GLushort u=0,v=0;
GLubyte r=255,g=255,b=255,a=255;
};
......
......@@ -149,7 +149,6 @@ auto ModelSystem::makeModel(const C::Tag& tag, const std::string& modelString, M
}
// Construct mesh, buffer ElementBuffer data to GPU
auto meshID = newModel.m_meshes.size();
auto newMesh = newModel.m_meshes.emplace_back(
Mesh{
meshTag,
......@@ -256,7 +255,6 @@ auto ModelSystem::loadOBJ(const tinyobj::attrib_t& attributes,
using u8 = std::uint8_t;
using u64 = std::uint64_t;
using s64 = std::int64_t;
std::vector<Vertex> overkillVertices;
......@@ -301,7 +299,7 @@ auto ModelSystem::loadOBJ(const tinyobj::attrib_t& attributes,
const s8 NormalStride = 3;
const s8 TextureStride = 2;
auto v = Vertex{
auto vert = Vertex{
attributes.vertices[indexSet.vertex_index * VertexStride + 0],
attributes.vertices[indexSet.vertex_index * VertexStride + 1],
attributes.vertices[indexSet.vertex_index * VertexStride + 2],
......@@ -313,11 +311,11 @@ auto ModelSystem::loadOBJ(const tinyobj::attrib_t& attributes,
if (indexSet.texcoord_index != -1)
{
v.u = static_cast<GLushort>(65535U * attributes.texcoords[indexSet.texcoord_index * TextureStride + 0]);
v.v = static_cast<GLushort>(65535U * attributes.texcoords[indexSet.texcoord_index * TextureStride + 1]);
vert.u = static_cast<GLushort>(65535U * attributes.texcoords[indexSet.texcoord_index * TextureStride + 0]);
vert.v = static_cast<GLushort>(65535U * attributes.texcoords[indexSet.texcoord_index * TextureStride + 1]);
}
overkillVertices.push_back(v);
overkillVertices.push_back(vert);
return overkillVertices.size() - 1;
};
......@@ -367,7 +365,6 @@ auto ModelSystem::loadOBJ(const tinyobj::attrib_t& attributes,
auto indiciesCount = overkillTriangles.size() * 3;
auto meshID = overkillModel.m_meshes.size();
auto overkillMesh = overkillModel.m_meshes.emplace_back(
Mesh
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment