Commit c91733bf authored by Dario Seyb's avatar Dario Seyb

pimped up cockpit

parent 6ffee93f
# Blender v2.71 (sub 0) OBJ File: 'cockpit_v2.blend'
# www.blender.org
v -1.061821 -0.698382 -1.686825
v -1.291435 -0.444211 -1.852240
v -1.262768 -0.520902 -1.745952
v -1.222154 -0.520902 -1.802329
v -1.044899 -0.482556 -2.120801
v -1.196148 -0.444211 -1.984509
v -0.990964 -0.520902 -2.123246
v -1.031578 -0.520902 -2.066868
v -1.102435 -0.698382 -1.630447
v -1.277529 -0.482556 -1.797886
v -1.126866 -0.520902 -1.934599
v -0.966533 -0.698382 -1.819094
v -0.830631 -0.698382 -2.007741
v -1.100860 -0.444211 -2.116779
v -0.871246 -0.698382 -1.951364
v 1.061821 -0.698382 -1.686825
v 1.291435 -0.444211 -1.852240
v 1.262768 -0.520902 -1.745952
v 1.222154 -0.520902 -1.802329
v 1.044899 -0.482556 -2.120801
v 1.196148 -0.444211 -1.984509
v 0.990964 -0.520902 -2.123246
v 1.031578 -0.520902 -2.066868
v 1.102435 -0.698382 -1.630447
v 1.277529 -0.482556 -1.797886
v 1.126866 -0.520902 -1.934599
v 0.966533 -0.698382 -1.819094
v 0.830631 -0.698382 -2.007741
v 1.100860 -0.444211 -2.116779
v 0.871246 -0.698382 -1.951364
vt 0.149489 0.997251
vt 0.072139 0.846115
vt 0.000090 0.696382
vt 0.500001 0.997250
vt 0.149489 0.696383
vt 0.149490 0.000111
vt 0.500001 0.696383
vt 0.999909 0.696381
vt 0.927860 0.846115
vt 0.850510 0.997250
vt 0.850511 0.696383
vt 0.999909 0.000110
vt 0.850512 0.000110
vt 0.000093 0.000112
vt 0.500001 0.000111
vn 0.731100 0.631400 0.258400
vn 0.542200 0.744000 0.390600
vn 0.476600 0.631400 0.611700
vn -0.731100 0.631400 0.258400
vn -0.542200 0.744000 0.390600
vn -0.476600 0.631400 0.611700
s off
f 2/1/1 10/2/1 3/3/1
f 6/4/2 2/1/2 4/5/2
f 1/6/2 4/5/2 3/3/2
f 11/7/2 4/5/2 1/6/2
f 7/8/3 5/9/3 14/10/3
f 11/7/2 8/11/2 14/10/2
f 13/12/2 7/8/2 8/11/2
f 15/13/2 8/11/2 11/7/2
f 18/3/4 25/2/4 17/1/4
f 19/5/5 17/1/5 21/4/5
f 16/6/5 24/14/5 18/3/5
f 16/6/5 19/5/5 26/7/5
f 29/10/6 20/9/6 22/8/6
f 26/7/5 21/4/5 29/10/5
f 23/11/5 22/8/5 28/12/5
f 26/7/5 23/11/5 30/13/5
f 4/5/2 2/1/2 3/3/2
f 11/7/2 6/4/2 4/5/2
f 9/14/2 1/6/2 3/3/2
f 12/15/2 11/7/2 1/6/2
f 8/11/2 7/8/2 14/10/2
f 6/4/2 11/7/2 14/10/2
f 15/13/2 13/12/2 8/11/2
f 12/15/2 15/13/2 11/7/2
f 19/5/5 18/3/5 17/1/5
f 26/7/5 19/5/5 21/4/5
f 19/5/5 16/6/5 18/3/5
f 27/15/5 16/6/5 26/7/5
f 23/11/5 29/10/5 22/8/5
f 23/11/5 26/7/5 29/10/5
f 30/13/5 23/11/5 28/12/5
f 27/15/5 26/7/5 30/13/5
# Blender v2.71 (sub 0) OBJ File: 'cockpit_v2.blend'
# www.blender.org
v -0.964138 -0.445972 -2.312674
v -0.772664 -0.703471 -2.087978
v -0.731518 -0.703471 -2.145093
v -0.935096 -0.523667 -2.204994
v -0.893950 -0.523667 -2.262110
v -0.497302 -0.703471 -2.470211
v -0.714375 -0.484820 -2.584751
v -0.700880 -0.523667 -2.530112
v -0.950050 -0.484820 -2.257608
v -0.867603 -0.445972 -2.446675
v -0.797415 -0.523667 -2.396111
v -0.634983 -0.703471 -2.279094
v -0.659734 -0.523667 -2.587227
v -0.771068 -0.445972 -2.580676
v -0.538448 -0.703471 -2.413095
v 0.964138 -0.445972 -2.312674
v 0.772664 -0.703471 -2.087978
v 0.731518 -0.703471 -2.145093
v 0.935096 -0.523667 -2.204994
v 0.893950 -0.523667 -2.262110
v 0.497302 -0.703471 -2.470211
v 0.714375 -0.484820 -2.584751
v 0.700880 -0.523667 -2.530112
v 0.950050 -0.484820 -2.257608
v 0.867603 -0.445972 -2.446675
v 0.797415 -0.523667 -2.396111
v 0.634983 -0.703471 -2.279094
v 0.659734 -0.523667 -2.587227
v 0.771068 -0.445972 -2.580676
v 0.538448 -0.703471 -2.413095
vt 0.149492 0.992412
vt 0.072141 0.842009
vt 0.000090 0.693003
vt 0.500002 0.693003
vt 0.500003 0.992409
vt 0.149489 0.693003
vt 0.000091 0.000110
vt 0.149491 0.000110
vt 0.850513 0.693001
vt 0.850512 0.992408
vt 0.999908 0.000110
vt 0.999910 0.692999
vt 0.500002 0.000110
vt 0.850511 0.000110
vt 0.927862 0.842005
vn 0.731000 0.631500 0.258400
vn 0.542200 0.744000 0.390600
vn 0.476600 0.631500 0.611600
vn -0.731000 0.631500 0.258400
vn -0.542200 0.744000 0.390600
vn -0.476600 0.631500 0.611600
s off
f 1/1/1 9/2/1 4/3/1
f 11/4/2 10/5/2 1/1/2
f 5/6/2 4/3/2 2/7/2
f 11/4/2 5/6/2 3/8/2
f 11/4/2 8/9/2 14/10/2
f 6/11/2 13/12/2 8/9/2
f 12/13/2 15/14/2 8/9/2
f 13/12/3 7/15/3 14/10/3
f 19/3/4 24/2/4 16/1/4
f 26/4/5 20/6/5 16/1/5
f 17/7/5 19/3/5 20/6/5
f 18/8/5 20/6/5 26/4/5
f 26/4/5 25/5/5 29/10/5
f 23/9/5 28/12/5 21/11/5
f 26/4/5 23/9/5 30/14/5
f 29/10/6 22/15/6 28/12/6
f 5/6/2 1/1/2 4/3/2
f 5/6/2 11/4/2 1/1/2
f 3/8/2 5/6/2 2/7/2
f 12/13/2 11/4/2 3/8/2
f 10/5/2 11/4/2 14/10/2
f 15/14/2 6/11/2 8/9/2
f 11/4/2 12/13/2 8/9/2
f 8/9/2 13/12/2 14/10/2
f 20/6/5 19/3/5 16/1/5
f 25/5/5 26/4/5 16/1/5
f 18/8/5 17/7/5 20/6/5
f 27/13/5 18/8/5 26/4/5
f 23/9/5 26/4/5 29/10/5
f 30/14/5 23/9/5 21/11/5
f 27/13/5 26/4/5 30/14/5
f 23/9/5 29/10/5 28/12/5
# Blender v2.71 (sub 0) OBJ File: 'cockpit_v2.blend'
# www.blender.org
v -0.357533 -0.697646 -2.478408
v -0.315905 -0.825259 -2.223594
v -0.281419 -0.825259 -2.234052
v -0.369054 -0.736151 -2.394220
v -0.085110 -0.825259 -2.293582
v -0.166277 -0.716899 -2.495718
v -0.363808 -0.716899 -2.435817
v -0.276622 -0.697646 -2.502944
v -0.200508 -0.825259 -2.258588
v -0.138259 -0.736151 -2.464208
v -0.195711 -0.697646 -2.527479
v -0.119597 -0.825259 -2.283124
v 0.357533 -0.697646 -2.478408
v 0.315905 -0.825259 -2.223594
v 0.281419 -0.825259 -2.234052
v 0.369054 -0.736151 -2.394220
v 0.085110 -0.825259 -2.293582
v 0.166277 -0.716899 -2.495718
v 0.363808 -0.716899 -2.435817
v 0.276622 -0.697646 -2.502944
v 0.200508 -0.825259 -2.258588
v 0.138259 -0.736151 -2.464208
v 0.195711 -0.697646 -2.527479
v 0.119597 -0.825259 -2.283124
vt 0.499923 0.997923
vt 0.840881 0.999908
vt 0.916120 0.849220
vt 0.013791 0.700532
vt 0.986361 0.694871
vt 0.500073 0.002923
vt 0.986209 0.700532
vt 0.986209 0.005755
vt 0.840884 0.004908
vt 0.159116 0.004908
vt 0.013791 0.005755
vt 0.158968 0.000938
vt 0.013642 0.000091
vt 0.013639 0.694871
vt 0.158964 0.995941
vt 0.083722 0.844377
vt 0.499927 0.002923
vt 0.159119 0.999908
vt 0.500077 0.997923
vt 0.083880 0.849220
vt 0.841032 0.000938
vt 0.916278 0.844377
vt 0.986358 0.000091
vt 0.841036 0.995941
vn 0.128600 0.896400 0.424200
vn -0.129500 0.894900 0.427000
vn 0.129500 0.894900 0.427000
vn 0.127500 0.892800 0.432100
vn 0.134000 0.892800 0.430100
vn -0.128600 0.896400 0.424200
vn -0.127500 0.892800 0.432100
vn -0.134000 0.892800 0.430100
s off
f 8/1/1 1/2/1 7/3/1
f 16/4/2 22/5/2 21/6/2
f 4/7/3 2/8/3 3/9/3
f 15/10/2 14/11/2 16/4/2
f 12/12/3 5/13/3 10/14/3
f 11/15/1 8/1/1 6/16/1
f 8/1/4 10/14/4 6/16/4
f 4/7/5 8/1/5 7/3/5
f 9/17/3 12/12/3 10/14/3
f 13/18/6 20/19/6 19/20/6
f 8/1/3 4/7/3 10/14/3
f 4/7/3 3/9/3 9/17/3
f 4/7/3 9/17/3 10/14/3
f 22/5/2 24/21/2 21/6/2
f 22/5/7 20/19/7 18/22/7
f 22/5/2 17/23/2 24/21/2
f 21/6/2 15/10/2 16/4/2
f 20/19/8 16/4/8 19/20/8
f 20/19/6 23/24/6 18/22/6
f 16/4/2 20/19/2 22/5/2
# Blender v2.71 (sub 0) OBJ File: 'cockpit_v2.blend'
# www.blender.org
v -0.417927 -0.712252 -2.746126
v -0.348003 -0.509697 -3.045825
v -0.021701 -0.464668 -3.110859
v -0.021701 -0.712252 -2.746126
v -0.273761 -0.464668 -3.112214
v -0.273761 -0.712252 -2.746126
v -0.417927 -0.548774 -2.988364
v -0.021701 -0.548774 -2.986957
v -0.273761 -0.548774 -2.987852
v 0.000000 -0.464668 -3.110859
v 0.000000 -0.548774 -2.986957
v 0.417927 -0.712252 -2.746126
v 0.348003 -0.509697 -3.045825
v 0.021701 -0.464668 -3.110859
v 0.021701 -0.712252 -2.746126
v 0.273761 -0.464668 -3.112214
v 0.273761 -0.712252 -2.746126
v 0.417927 -0.548774 -2.988364
v 0.021701 -0.548774 -2.986957
v 0.273761 -0.548774 -2.987852
v 0.000000 -0.712252 -2.746126
vt 0.172524 0.994967
vt 0.083716 0.814393
vt 0.000073 0.657971
vt 0.474040 0.655352
vt 0.474040 0.992443
vt 0.172526 0.000140
vt 0.172524 0.657018
vt 0.474040 0.000140
vt 0.500000 0.992443
vt 0.499999 0.000140
vt 0.500000 0.655352
vt 0.999927 0.657970
vt 0.916284 0.814393
vt 0.827476 0.994967
vt 0.525959 0.655352
vt 0.827475 0.657018
vt 0.827474 0.000138
vt 0.999925 0.000137
vt 0.525959 0.000140
vt 0.525959 0.992443
vt 0.000074 0.000139
vn 0.015000 -0.835300 -0.549600
vn -0.003000 0.827400 0.561600
vn -0.002000 0.828300 0.560200
vn -0.002000 0.827400 0.561600
vn 0.000000 0.827400 0.561600
vn -0.015000 -0.835300 -0.549600
vn 0.002000 0.828300 0.560200
vn 0.000000 0.828900 0.559400
vn 0.000000 0.828400 0.560200
vn 0.003000 0.827400 0.561600
vn 0.002000 0.827400 0.561600
s off
f 5/1/1 2/2/1 7/3/1
f 8/4/2 3/5/2 5/1/2
f 6/6/3 9/7/3 7/3/3
f 4/8/4 8/4/4 9/7/4
f 10/9/5 3/5/5 8/4/5
f 21/10/5 11/11/5 8/4/5
f 18/12/6 13/13/6 16/14/6
f 19/15/7 20/16/7 16/14/7
f 17/17/8 12/18/8 18/12/8
f 15/19/9 17/17/9 20/16/9
f 19/15/5 14/20/5 10/9/5
f 19/15/5 11/11/5 21/10/5
f 9/7/3 5/1/3 7/3/3
f 9/7/3 8/4/3 5/1/3
f 1/21/8 6/6/8 7/3/8
f 6/6/9 4/8/9 9/7/9
f 11/11/5 10/9/5 8/4/5
f 4/8/5 21/10/5 8/4/5
f 20/16/7 18/12/7 16/14/7
f 14/20/10 19/15/10 16/14/10
f 20/16/7 17/17/7 18/12/7
f 19/15/11 15/19/11 20/16/11
f 11/11/5 19/15/5 10/9/5
f 15/19/5 19/15/5 21/10/5
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
# 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.
This diff is collapsed.
This diff is collapsed.
......@@ -28,14 +28,13 @@ float pow8(float val) {
val = val * val;
val *= val;
val *= val;
return val;
return val * val;
}
vec4 color() {
float depth = texture(uSamplerDepth, gl_FragCoord.xy*uOneOverScreenSize ).r;
float planetRadius = 6374.1305775862702;
float atmosphereRadius = planetRadius * 1.025;
float atmosphereRadius = planetRadius * 1.05;
vec3 camSpaceWorldPos = unpackWorldPosition(depth) - uCameraPosition;
vec3 viewDir = normalize(tePosition - uCameraPosition);
......@@ -51,29 +50,33 @@ vec4 color() {
vec3 currentPos = camSpaceAtmospherePos;
float totalDistance = depth == 1 ? 1000000000.0f : abs(length(camSpaceWorldPos) - length(camSpaceAtmospherePos));
float totalDistance = depth == 1 ? 1e37 : abs(length(camSpaceWorldPos) - length(camSpaceAtmospherePos));
totalDistance = min(totalDistance, length(camSpaceAtmospherePos - tePosition + uCameraPosition));
int steps = 10;
int steps = 15;
float sunAmount = max( dot( viewDir, uSunDir ), 0.0 );
float distance = totalDistance/steps;
float totalFog = 0;
vec3 Iv = vec3(0);
vec3 Is = vec3(1.0,0.9,0.7);
for(int i = 0; i < steps; i++) {
currentPos += viewDir * distance;
vec3 localPos = currentPos - uObjectPosition + uCameraPosition;
float currentHeight = length(localPos) - planetRadius;
float h = currentHeight/atmosphereThickness;
float cloud = abs((fbm_3d( localPos, 4, 0.00005) * 300 - fbm_3d( localPos, 1, 0.002) * 100))* abs((h - 0.5) * (h-0.5)) * (1.0-h);
float atm = 20 * (1-h) * (1-h)* (1-h);
float cloud = 0; //max(fbm_3d( localPos, 6, 0.0003) + 0.05, 0) * 1000 * (pow8(1-h));
cloud = h > 0.75 ? 0 : cloud;
float atm = 20 * exp(-h/0.25);
float density = ( atm + cloud)/atmosphereRadius;
totalFog += density * distance;
}
float fogAmount = 1.0 - exp(-totalFog);
vec3 fogColor = mix( vec3(0.2,0.3,0.9), // bluish
vec3 fogColor = mix( vec3(0.3,0.4,0.9), // bluish
vec3(1.0,0.9,0.7) * 1.2, // yellowish
pow8(sunAmount) );
......
......@@ -20,6 +20,7 @@
in vec3 gTriDistance;
#endif
uniform bool uHasAlbedoMap;
uniform sampler2D uTexture;
uniform bool uHasNormalMap;
......@@ -83,9 +84,9 @@ void main()
vec4 color = color();
float sampl = rand(gl_FragCoord.xy + vec2(mod(uTime,1)));
/*float sampl = rand(gl_FragCoord.xy + vec2(mod(uTime,1)));
if(sampl > color.a) discard;
if(sampl > color.a) discard;*/
vec4 thisPosition = uViewProjectionMatrix * vec4(inPosition, 1);
vec4 prevPosition = uPrevViewProjectionMatrix * uPrevModelMatrix * inverse(uModelMatrix) * vec4(inPosition, 1);
......
......@@ -102,5 +102,5 @@ void main()
float lightNdotL = max(0, dot(lightDir, normal));
vec4 lighting = BRDF (albedo.rgb, specularSmoothness.rgb, oneMinusReflectivity, specularSmoothness.a, normal, viewDir, lightDir, lightNdotL, uLightColor.rgb * uLightColor.a);
oColor = vec4(lighting.rgb + emissive.rgb, uOneOverLightCount);
oColor = vec4(lighting.rgb + emissive.rgb, uOneOverLightCount * albedo.a);
}
......@@ -4,7 +4,11 @@
#pragma import "Utils.glsl"
vec4 color() {
return texture(uTexture, teTexCoord).rgba * uTintColor;
vec4 res = uTintColor;
if(uHasAlbedoMap) {
res *= texture(uTexture, teTexCoord).rgba;
}
return res;
}
vec4 emissive() {
......@@ -12,7 +16,7 @@ vec4 emissive() {
}
vec3 normal() {
if(uHasNormalMap) {
if(false && uHasNormalMap) {
vec3 tangentNormal = unpackNormal(texture(uNormalMap, teTexCoord));
vec3 Q1 = dFdx(tePosition);
......@@ -27,7 +31,7 @@ vec3 normal() {
mat3 TBN = mat3(T, B, teNormal);
// transform the normal to eye space
return teNormal; //tangentNormal*TBN;
return tangentNormal*TBN;
}
return teNormal;
}
......@@ -36,5 +40,5 @@ vec4 specularSmoothness() {
if(uHasSpecularSmoothnessMap) {
return texture(uSpecularSmoothnessMap, inTexCoord);
}
return vec4(0, 0, 0, 0);
return vec4(0, 0, 0, 0.2);
}
......@@ -42,7 +42,7 @@ private:
glm::quat camStartRot;
glm::quat camTargetRot;
const glm::dvec3 CAM_CONSOLE_POS = { 0, -0.05, -1.95 };
const glm::dvec3 CAM_CONSOLE_POS = { 0, -0.24977, -2.79714 };
const glm::mat4 CAM_CONSOLE_ROT = glm::rotate(-1.05, glm::dvec3{ 1.0, 0.0, 0.0 });
bool isFocusedOnConsole = true;
......
......@@ -327,7 +327,13 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
counter2Start = SDL_GetPerformanceCounter();
drawCall.material.prog->use();
drawCall.material.prog->setTexture("uTexture", drawCall.material.mainTexture, 0);
if (drawCall.material.mainTexture) {
drawCall.material.prog->setTexture("uTexture", drawCall.material.mainTexture, 0);
drawCall.material.prog->setUniform("uHasAlbedoMap", true);
} else {
drawCall.material.prog->setUniform("uHasAlbedoMap", false);
}
if (drawCall.material.normalTexture) {
drawCall.material.prog->setTexture("uNormalMap", drawCall.material.normalTexture, 1);
......@@ -357,6 +363,12 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
// Draw directly to screen
if (drawCall.recursionDepth == 0) {
if (drawCall.material.cullSide == GL_NONE) {
glDisable(GL_CULL_FACE);
} else {
glEnable(GL_CULL_FACE);
glCullFace(drawCall.material.cullSide);
}
drawCall.geometry.vao->render();
glGetError();
}
......
......@@ -225,7 +225,7 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
auto atmosphereTransform = atmosphere.assign<Transform>();
atmosphereTransform->parent = planetTransform;
atmosphere.assign<Drawable>(defaultGeom, atmosphereMat, 0, m_renderer->getRenderPassId("Main"_sh));
atmosphereTransform->scale = planetTransform->scale * 1.025;
atmosphereTransform->scale = planetTransform->scale * 1.05;
// Add simple water as well
auto water = m_scene->create();
......
......@@ -179,6 +179,7 @@ bool AtmosphereTestScene::startup() {
case SDL_SCANCODE_R:
if (e.originalEvent.key.type == SDL_KEYDOWN) {
ShaderProgramFileManager::the()->updateAll();
Texture2DFileManager::the()->updateAll();
}
default:
break;
......@@ -276,22 +277,22 @@ void AtmosphereTestScene::switchToMainScene() {
cockpitSun.assign<Light>(glm::vec4(1, 1, 1, 3), glm::vec3(1, 0, 0),
true, LightType::DIRECTIONAL, cockpitPassId);
auto blinkButton = m_sceneGraph->create();
blinkButton.assign<Light>(glm::vec4(1, 0.2, 0.2, 5), glm::vec3(1, 0, 0),
/*auto blinkButton = m_sceneGraph->create();
blinkButton.assign<Light>(glm::vec4(0.2, 0.2, 0.6, 5), glm::vec3(1, 0, 0),
false, LightType::POINT, cockpitPassId);
auto transform = blinkButton.assign<Transform>();
transform->parent = cockpitTransform;
transform->position = {0.7655, -0.4545, -1.643};
blinkButton = m_sceneGraph->create();
blinkButton.assign<Light>(glm::vec4(0, 0.2, 1.0, 5), glm::vec3(1, 0, 0),
blinkButton.assign<Light>(glm::vec4(0.1, 0.7, 0.2, 5), glm::vec3(1, 0, 0),
false, LightType::POINT, cockpitPassId);
transform = blinkButton.assign<Transform>();
transform->parent = cockpitTransform;
transform->position = {-0.7655, -0.4545, -1.643};
transform->position = {-0.7655, -0.4545, -1.643};*/
auto console = m_sceneGraph->create();
auto consoleGeom = Geometry{ VertexArrayObjectCreator("console.obj").create() };
auto consoleGeom = Geometry{ VertexArrayObjectCreator("cockpit/cockpit_v2_maindisplay.obj").create() };
consoleGeom.vao->setMode(GL_PATCHES);
console.assign<Drawable>(
consoleGeom,
......@@ -305,6 +306,55 @@ void AtmosphereTestScene::switchToMainScene() {
consoleSoundSource = console.assign<SoundSource>(soundTrack);
consoleSoundSource->setVolume(0.5);
consoleSoundSource->play();
auto consoleFront = m_sceneGraph->create();
consoleGeom = Geometry{ VertexArrayObjectCreator("cockpit/cockpit_v2_console_front.obj").create() };
consoleGeom.vao->setMode(GL_PATCHES);
consoleFront.assign<Drawable>(
consoleGeom,
Material{ glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 1, 1, 1, 1 },
m_renderer->getRenderPassTarget("Console"_sh), nullptr, nullptr,
skyboxMaterial.prog, false, RenderQueue::OPAQUE, GL_BACK },
0, cockpitPassId);
consoleFront.assign<Transform>();
auto consoleBack = m_sceneGraph->create();
consoleGeom = Geometry{ VertexArrayObjectCreator("cockpit/cockpit_v2_console_back.obj").create() };
consoleGeom.vao->setMode(GL_PATCHES);
consoleBack.assign<Drawable>(
consoleGeom,
Material{ glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 1, 1, 1, 1 },
m_renderer->getRenderPassTarget("Console"_sh), nullptr, nullptr,
skyboxMaterial.prog, false, RenderQueue::OPAQUE, GL_BACK },
0, cockpitPassId);
consoleBack.assign<Transform>();
auto consoleMiddle= m_sceneGraph->create();
consoleGeom = Geometry{ VertexArrayObjectCreator("cockpit/cockpit_v2_console_middle.obj").create() };
consoleGeom.vao->setMode(GL_PATCHES);
consoleMiddle.assign<Drawable>(