Commit 68a60a18 authored by Dario Seyb's avatar Dario Seyb

added skybox

parent d15a9f25
This diff is collapsed.
This diff is collapsed.
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
# Blender v2.71 (sub 0) OBJ File: ''
# www.blender.org
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
vt 0.000087 0.333404
vt 0.250043 0.666640
vt 0.250043 0.333404
vt 0.500000 0.000016
vt 0.500000 0.333404
vt 0.749956 0.666641
vt 0.499999 0.666640
vt 0.250042 0.999876
vt 0.999913 0.666641
vt 0.999913 0.333405
vt 0.749956 0.333404
vt 0.000087 0.666639
vt 0.250042 0.000016
vt 0.499999 0.999876
vn 1.000000 0.000000 0.000000
vn 0.000000 -0.000000 1.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 -0.000000
s off
f 1/1/1 2/2/1 3/3/1
f 4/4/2 3/3/2 5/5/2
f 6/6/3 5/5/3 7/7/3
f 8/8/4 7/7/4 2/2/4
f 3/3/5 7/7/5 5/5/5
f 8/9/6 1/10/6 4/11/6
f 2/2/1 1/1/1 8/12/1
f 1/13/2 3/3/2 4/4/2
f 4/11/3 5/5/3 6/6/3
f 6/14/4 7/7/4 8/8/4
f 2/2/5 7/7/5 3/3/5
f 6/6/6 8/9/6 4/11/6
# Blender MTL File: 'Spaceship_Request.blend'
# Material Count: 6
newmtl Black
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Emision
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.281226 0.515584 0.639282
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Glass
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.109879 0.109879 0.109879
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Mat
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.590595 0.635841 0.722817
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Mat2
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.176566 0.355384 0.722817
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
newmtl Metal
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.310640 0.310640 0.310640
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
This diff is collapsed.
......@@ -23,10 +23,11 @@ vec4 color() {
approxNormal = inNormal;
vec4 color = texture_getColor(gPosInModelspace, gUpVector_normalized, approxNormal);
float d1 = min(min(gTriDistance.x, gTriDistance.y), gTriDistance.z);
inPosition += inNormal * height;
/*float d1 = min(min(gTriDistance.x, gTriDistance.y), gTriDistance.z);
float d2 = min(min(gPatchDistance.x, gPatchDistance.y), gPatchDistance.z);
color = amplify(d1, 80, -0.5) * amplify(d2, 120, -0.5) * color;
color = amplify(d1, 80, -0.5) * amplify(d2, 120, -0.5) * color;*/
color.w = 1.0;
return color;
}
......@@ -40,5 +41,5 @@ vec3 normal() {
}
vec4 specularSmoothness() {
return vec4(0.2, 0.2, 0.2, 0.5);
return vec4(0.2, 0.2, 0.2, 0.2);
}
......@@ -59,10 +59,10 @@ void main(){
float d1 = distance(cameraPosition, (uModelMatrix * vec4(tcPosition[1], 1)).xyz );
float d2 = distance(cameraPosition, (uModelMatrix * vec4(tcPosition[2], 1)).xyz );
gl_TessLevelOuter[0] = getTessLevel(d1, d2)*2;
gl_TessLevelOuter[1] = getTessLevel(d2, d0)*2;
gl_TessLevelOuter[2] = getTessLevel(d0, d1)*2;
gl_TessLevelInner[0] = 0.5 * gl_TessLevelOuter[2];
gl_TessLevelOuter[0] = getTessLevel(d1, d2);
gl_TessLevelOuter[1] = getTessLevel(d2, d0);
gl_TessLevelOuter[2] = getTessLevel(d0, d1);
gl_TessLevelInner[0] = 0.5 * gl_TessLevelOuter[2];
/*
......
#define LAST_SHADER TESSELATION
#pragma import "CommonDeferredFrag.glsl"
#pragma import "Utils.glsl"
vec4 color() {
return vec4(0, 0, 0, 1);
}
vec4 emissive() {
return texture(uTexture, teTexCoord).rgba;
}
vec3 normal() {
return teNormal;
}
vec4 specularSmoothness() {
return vec4(0, 0, 0, 0);
}
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#pragma import "CommonDeferredVert.glsl"
vec3 normal() {
return aNormal;
}
vec2 texCoord() {
return aTexCoord;
}
vec3 position() {
vec4 modelPos = vec4(aPosition, 1.0);
vec4 worldPosition = uModelMatrix * modelPos;
return worldPosition.xyz;
}
......@@ -20,14 +20,18 @@ vec3 calcGrass(float noiseVal1, float noiseVal2, float phiN, float height) {
#define ROCK_SLOPE .6
<<<<<<< Updated upstream:data/shader/oldstuff/mountainTexture.glsl
vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNormalized){
=======
vec4 mountainTex_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNormalized, float height){
>>>>>>> Stashed changes:data/shader/terrain/mountainTexture.glsl
float noiseVal1 = fbm_3d( texCoord3d,4, 128.*128.);// * 0.05;
vec3 distortion = vec3 (.1, .1, .1);
float noiseVal2 = fbm_3d( texCoord3d, 4, 8*128.*128.);// * 0.05;
float noiseVal3 = fbm_3d( texCoord3d + distortion, 4, 8*128.*128.);// * 0.05;
vec4 color = vec4(1., 1., 1., 1.);
float height = mountain_getHeight(texCoord3d)*.9 + noiseVal2 * .1;
height = mountain_getHeight(texCoord3d)*.9 + noiseVal2 * .1;
//color = vec4(normalNormalized.x,normalNormalized.y, normalNormalized.z, 1.);
......
This image diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,4 +15,5 @@ struct Material {
SharedShaderProgram prog;
bool castShadow;
RenderQueue queue;
GLenum cullSide;
};
\ No newline at end of file
......@@ -45,6 +45,8 @@ private:
std::vector<RenderPass> m_passes;
std::unordered_map<StringHash, uint32_t> m_passIds;
uint32_t m_totalLightCount;
std::vector<std::shared_ptr<PostFX>> m_effects;
......@@ -108,7 +110,7 @@ public:
bool startup() override;
void shutdown() override;
void addRenderPass(Entity cam) {
void addRenderPass(Entity cam, StringHash name) {
cam.component<Camera>()->renderPassIndex = m_passes.size();
auto target = SharedFrameBufferObject(new FrameBufferObject());
target->attachColorTexture("oColor", createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F));
......@@ -118,9 +120,17 @@ public:
txaa->attachColorTexture("oColor", createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F));
txaa->validate();
m_passIds[name] = m_passes.size();
m_passes.push_back({ kilobytes(4), kilobytes(4), kilobytes(4), target, txaa, cam });
}
uint32_t getRenderPassId(StringHash sh) {
if (m_passIds.find(sh) != m_passIds.end()) {
return m_passIds[sh];
}
return -1;
}
inline size_t getNumPasses() {
return m_passes.size();
}
......
......@@ -28,12 +28,14 @@ private:
OrbitalSimulationSystem* m_orbitals;
WindowSystem* m_window;
Entity m_skyboxCamera;
Entity m_mainCamera;
Entity m_cockpitCamera;
Entity parentEntity;
Transform::Handle cameraTransform;
Transform::Handle cockpitCamTransform;
Transform::Handle skyboxCamTransform;
Camera::Handle camera;
......
......@@ -11,6 +11,8 @@ private:
Light::Handle sunLight;
Entity sun;
Entity skybox;
Entity earth;
Entity cockpit;
Entity cockpitSun;
......
......@@ -215,6 +215,7 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
m_gBufferObject->setClearColor(glm::vec4{ 0, 0, 0, 0 });
m_gBufferObject->bind();
m_gBufferObject->clearBuffers();
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
auto counterStart = SDL_GetPerformanceCounter();
......@@ -358,6 +359,7 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
// Draw directly to screen
if (drawCall.recursionDepth == 0) {
drawCall.geometry.vao->render();
glGetError();
}
// Render feedback buffer 1
......
......@@ -27,7 +27,7 @@ bool OrbitalSimulationSystem::startup() {
m_events->subscribe<SimulateEvent>([this](const SimulateEvent &e) { simulateOrbitals(e.dt, e.totalTime); });
// Make a default geometry (TODO)
auto vaoSphere = VertexArrayObjectCreator("icosphere2.obj").create();
auto vaoSphere = VertexArrayObjectCreator("normalized_cube.obj").create();
auto texture = Texture2DFileManager::the()->get(Texture2DCreator("checkerboard.png"));
//auto texture = Texture2DFileManager::the()->get(Texture2DCreator("clownfishBunny.png"));
......@@ -92,7 +92,8 @@ bool OrbitalSimulationSystem::startup() {
nullptr,
moonShader,
1,
RenderQueue::OPAQUE};
RenderQueue::OPAQUE,
GL_BACK};
trajectoryMat = {glm::vec4(1, 1, 1, 1),
glm::vec4(1, 0, 0, 1),
......@@ -101,7 +102,8 @@ bool OrbitalSimulationSystem::startup() {
nullptr,
testShader,
0,
RenderQueue::OPAQUE};
RenderQueue::OPAQUE,
GL_BACK };
atmosphereMat = {glm::vec4(0, 0, 1, 0.9f),
glm::vec4(0, 0, .2, 1),
......@@ -110,7 +112,8 @@ bool OrbitalSimulationSystem::startup() {
nullptr,
atmosphereShader,
0,
RenderQueue::TRANSPARENT};
RenderQueue::TRANSPARENT,
GL_FRONT};
waterMat = {glm::vec4(0, 0.2, 0.8, 1),
glm::vec4(0, 0, .2, 1),
......@@ -119,7 +122,8 @@ bool OrbitalSimulationSystem::startup() {
nullptr,
waterShader,
0,
RenderQueue::OPAQUE};
RenderQueue::OPAQUE,
GL_BACK};
return true;
}
......@@ -213,27 +217,27 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
planetTransform->scale = glm::dvec3(solarToWorld(r), solarToWorld(r), solarToWorld(r));
planetTransform->position = pos;
planetEntity.assign<Drawable>(defaultGeom, earthMat, 2);
planetEntity.assign<Drawable>(defaultGeom, earthMat, 2, m_renderer->getRenderPassId("Main"_sh));
// Add an atmosphere to the planet
auto atmosphere = m_scene->create();
auto atmosphereTransform = atmosphere.assign<Transform>();
atmosphereTransform->parent = planetTransform;
atmosphere.assign<Drawable>(defaultGeom, atmosphereMat);
atmosphere.assign<Drawable>(defaultGeom, atmosphereMat, 0, m_renderer->getRenderPassId("Main"_sh));
atmosphereTransform->scale = planetTransform->scale * 1.05;
// Add simple water as well
/*// Add simple water as well
auto water = m_scene->create();
auto waterTransform = water.assign<Transform>();
waterTransform->parent = planetTransform;
water.assign<Drawable>(defaultGeom, waterMat, 1);
waterTransform->scale = planetTransform->scale * 1.0;
water.assign<Drawable>(defaultGeom, waterMat, 1, 1);
waterTransform->scale = planetTransform->scale * 1.0;*/
// Let's add a moon!
auto moon = m_scene->create();
auto moonTransform = moon.assign<Transform>();
moonTransform->parent = planetTransform;
moon.assign<Drawable>(defaultGeom, moonMat);
moon.assign<Drawable>(defaultGeom, moonMat, 0, m_renderer->getRenderPassId("Main"_sh));
auto moonComponent = moon.assign<Planet>("Moon", 0.000000036939686, 0.003505316091954, 0.205633, 0.08, 0.0898041713, 5.4583095414, 1.671072474, 0 );
// change starting point
......@@ -256,7 +260,7 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
auto traj = m_scene->create();
auto trajTransform = traj.assign<Transform>();
auto drawable = traj.assign<Drawable>(orbitTorus, trajectoryMat);
auto drawable = traj.assign<Drawable>(orbitTorus, trajectoryMat, 0, m_renderer->getRenderPassId("Main"_sh));
drawable->visible = false;
trajTransform->rotation = tRot;
trajTransform->scale = tScale;
......
......@@ -188,6 +188,11 @@ bool PlayerSystem::startup() {
RESOLVE_DEPENDENCY(m_orbitals);
RESOLVE_DEPENDENCY(m_window);
m_skyboxCamera = m_scene->create();
skyboxCamTransform = m_skyboxCamera.assign<Transform>();
skyboxCamTransform->position = glm::dvec3(0, 0, 0);
m_skyboxCamera.assign<Camera>(50, 0.01f, 50);
// Create an entity that is used to position the camera in the scene
m_mainCamera = m_scene->create();
cameraTransform = m_mainCamera.assign<Transform>();
......@@ -200,8 +205,10 @@ bool PlayerSystem::startup() {
cockpitCamTransform->position = glm::dvec3(0, 0, 0);
m_cockpitCamera.assign<Camera>(50, 0.01f, 50);
m_renderer->addRenderPass(m_mainCamera);
m_renderer->addRenderPass(m_cockpitCamera);
m_renderer->addRenderPass(m_skyboxCamera, "Skybox"_sh);
m_renderer->addRenderPass(m_mainCamera, "Main"_sh);
m_renderer->addRenderPass(m_cockpitCamera, "Cockpit"_sh);
m_audio->setListener(m_mainCamera);
......@@ -295,7 +302,8 @@ void PlayerSystem::handleMouse(MouseEvent e) {
cameraTransform->rotation = glm::rotate(cameraTransform->rotation, mouseMove.x * 0.001, up);
cameraTransform->rotation = glm::rotate(cameraTransform->rotation, mouseMove.y * 0.001, glm::dvec3(1, 0, 0));
}
skyboxCamTransform->rotation = cameraTransform->rotation;
}
break;
}
default:
......@@ -307,6 +315,7 @@ void PlayerSystem::update(float dt) {
glm::dvec3 moveDir(0);
glm::dvec2 rotDir(0);
double speedMod = 1.0;
// Move the camera based on WASD keyboard input
if (!ImGui::GetIO().WantCaptureKeyboard) {
......@@ -337,6 +346,8 @@ void PlayerSystem::update(float dt) {
}
}
skyboxCamTransform->rotation = cameraTransform->rotation;
// Check if we have to move the player to a different coordinate system.
double r;
......
......@@ -36,40 +36,63 @@ bool AtmosphereTestScene::startup() {
RESOLVE_DEPENDENCY(m_orbitals);
m_renderer->addEffect<BloomPostFX>();
{
auto skyboxPassId = m_renderer->getRenderPassId("Skybox"_sh);
auto vaoSkybox = VertexArrayObjectCreator("skybox.obj").create();
auto skyboxShader = ShaderProgramFileManager::the()->get(ShaderProgramCreator("Skybox")
.attributeLocations(vaoSkybox->getAttributeLocations())
.fragmentDataLocations(m_renderer->getGBufferLocations()));
auto skyboxTexture = Texture2DFileManager::the()->get(Texture2DCreator("skybox.png"));
auto vaoSun = VertexArrayObjectCreator("uvsphere.obj").create();
Geometry skyboxGeom = { vaoSkybox };
skyboxGeom.vao->setMode(GL_PATCHES);
// load a texture:
auto checkboardTexture = Texture2DFileManager::the()->get(Texture2DCreator("checkerboard.png"));
Material skyboxMaterial = { glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 1, 1, 1, 1 }, skyboxTexture, nullptr, nullptr, skyboxShader, false, RenderQueue::OPAQUE, GL_BACK };
// look up all shader files starting with 'PBR' and build a ShaderProgram from it:
auto sunShader = ShaderProgramCreator("PBR")
.attributeLocations(vaoSun->getAttributeLocations())
.fragmentDataLocations(m_renderer->getGBufferLocations()).create();
skybox = m_sceneGraph->create();
skybox.assign<Transform>();
skybox.assign<Drawable>(skyboxGeom, skyboxMaterial, 0, skyboxPassId);
skybox.assign<Light>(glm::vec4(1, 1, 1, 1), glm::vec3(1, 0, 0), false, LightType::POINT, skyboxPassId);
}
// Create geometry objects that point to the previously initialized vaos
Geometry geom1 = { vaoSun };
geom1.vao->setMode(GL_PATCHES);
{
auto mainPassId = m_renderer->getRenderPassId("Main"_sh);
auto vaoSun = VertexArrayObjectCreator("uvsphere.obj").create();
// Create a material that uses the loaded shader program
Material sunMaterial = { glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 2, 2, 1, 20 }, checkboardTexture, nullptr, nullptr, sunShader, false, RenderQueue::OPAQUE };
// load a texture:
auto checkboardTexture = Texture2DFileManager::the()->get(Texture2DCreator("checkerboard.png"));
// Let's create a placeholder sun
sun = m_sceneGraph->create();
// Add a transform component to it so we are able to position it in space
auto sunTransform = sun.assign<Transform>();
// Add a Drawable component to it so the renderer has something to draw
sun.assign<Drawable>(geom1, sunMaterial);
float scale = m_orbitals->solarRadius * m_orbitals->scaleFactor * 0.1;
sunTransform->scale = glm::dvec3(scale);
sunLight = sun.assign<Light>(glm::vec4(1, 1, 1, 3), glm::vec3(1, 0, 0), false, LightType::DIRECTIONAL);
// look up all shader files starting with 'PBR' and build a ShaderProgram from it:
auto sunShader = ShaderProgramCreator("PBR")
.attributeLocations(vaoSun->getAttributeLocations())
.fragmentDataLocations(m_renderer->getGBufferLocations()).create();
// create a planet!
// Mass in solar masses, Radius in solar radii, Eccentricity, Semimajor axis, Inclination, Ascending Node, Arg. of Periapsis, time at perihelion
// mass radius e a i N w
earth = m_orbitals->addPlanet(sunTransform, "Earth", 0.000002988, 0.009153735632184, 0.016713, 1.000000, 0.0000000, 0.00000, 4.93533, 0);
// Create geometry objects that point to the previously initialized vaos
Geometry geom1 = { vaoSun };
geom1.vao->setMode(GL_PATCHES);
// Create a material that uses the loaded shader program
Material sunMaterial = { glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 2, 2, 1, 20 }, checkboardTexture, nullptr, nullptr, sunShader, false, RenderQueue::OPAQUE, GL_BACK };
// Let's create a placeholder sun
sun = m_sceneGraph->create();
// Add a transform component to it so we are able to position it in space
auto sunTransform = sun.assign<Transform>();
// Add a Drawable component to it so the renderer has something to draw
sun.assign<Drawable>(geom1, sunMaterial, 0, mainPassId);
float scale = m_orbitals->solarRadius * m_orbitals->scaleFactor * 0.1;
sunTransform->scale = glm::dvec3(scale);
sunLight = sun.assign<Light>(glm::vec4(1, 1, 1, 3), glm::vec3(1, 0, 0), false, LightType::DIRECTIONAL, mainPassId);
// create a planet!
// Mass in solar masses, Radius in solar radii, Eccentricity, Semimajor axis, Inclination, Ascending Node, Arg. of Periapsis, time at perihelion
// mass radius e a i N w
earth = m_orbitals->addPlanet(sunTransform, "Earth", 0.000002988, 0.009153735632184, 0.016713, 1.000000, 0.0000000, 0.00000, 4.93533, 0);
}
{
auto cockpitPassId = m_renderer->getRenderPassId("Cockpit"_sh);
// create cockpit
auto vaoCockpit = VertexArrayObjectCreator("cockpit.obj").create();
auto cockpitShader = ShaderProgramCreator("PBR")
......@@ -82,30 +105,30 @@ bool AtmosphereTestScene::startup() {
Texture2DFileManager::the()->get(Texture2DCreator("cockpit/cockpit_DefaultMaterial_SpecularSmoothness.png")),
cockpitShader,
true,
RenderQueue::OPAQUE };
RenderQueue::OPAQUE,
GL_BACK };
Geometry cockpitGeom{ vaoCockpit };
cockpitGeom.vao->setMode(GL_PATCHES);
cockpit = m_sceneGraph->create();
auto cockpitDrawable = cockpit.assign<Drawable>(cockpitGeom, cockpitMaterial);
auto cockpitDrawable = cockpit.assign<Drawable>(cockpitGeom, cockpitMaterial, 0, cockpitPassId);
auto cockpitTransform = cockpit.assign<Transform>();
cockpitTransform->position = glm::dvec3(0, 0, 0);
cockpitDrawable->renderPassIndex = 1;