Updated to deferred renderer
BIN
resources/EngineResources/Fonts/Oswald-VariableFont_wght.ttf
Normal file
BIN
resources/EngineResources/audio/music/IntroMusicStero.ogg
Normal file
BIN
resources/EngineResources/audio/music/MainThemeCEZ4434_12.ogg
Normal file
BIN
resources/EngineResources/audio/sounds/IntroMusicMono.ogg
Normal file
|
|
@ -1,12 +1,152 @@
|
|||
#version 450
|
||||
#extension GL_EXT_scalar_block_layout: require
|
||||
// CREDITS: functions obtained from this link: https://github.com/SaschaWillems/Vulkan
|
||||
// developed by Sascha Willems, https://twitter.com/JoeyDeVriez, licensed under MIT License (MIT)
|
||||
// also Vulkan Book https://github.com/lwjglgamedev/vulkanbook/blob/master/bookcontents/chapter-15/chapter-15.md
|
||||
|
||||
|
||||
const int MAX_LIGHTS = 1000;
|
||||
const float PI = 3.14159265359;
|
||||
|
||||
struct Light {
|
||||
vec3 position;
|
||||
uint directional;
|
||||
float intensity;
|
||||
vec3 color;
|
||||
};
|
||||
|
||||
layout(location = 0) in vec2 inTextCoord;
|
||||
|
||||
layout(location = 0) out vec4 outFragColor;
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D albedoSampler;
|
||||
layout(set = 0, binding = 1) uniform sampler2D depthSampler;
|
||||
layout(set = 0, binding = 0) uniform sampler2D posSampler;
|
||||
layout(set = 0, binding = 1) uniform sampler2D albedoSampler;
|
||||
layout(set = 0, binding = 2) uniform sampler2D normalsSampler;
|
||||
layout(set = 0, binding = 3) uniform sampler2D pbrSampler;
|
||||
|
||||
layout(scalar, set = 1, binding = 0) readonly buffer Lights {
|
||||
Light lights[];
|
||||
} lights;
|
||||
layout(scalar, set = 2, binding = 0) uniform SceneInfo {
|
||||
vec3 camPos;
|
||||
float ambientLightIntensity;
|
||||
vec3 ambientLightColor;
|
||||
uint numLights;
|
||||
} sceneInfo;
|
||||
|
||||
float distributionGGX(vec3 N, vec3 H, float roughness) {
|
||||
float a = roughness * roughness;
|
||||
float a2 = a * a;
|
||||
float NdotH = max(dot(N, H), 0.0);
|
||||
float NdotH2 = NdotH * NdotH;
|
||||
|
||||
float nom = a2;
|
||||
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
|
||||
denom = PI * denom * denom;
|
||||
|
||||
return nom / denom;
|
||||
}
|
||||
|
||||
float geometrySchlickGGX(float NdotV, float roughness) {
|
||||
float r = (roughness + 1.0);
|
||||
float k = (r * r) / 8.0;
|
||||
|
||||
float nom = NdotV;
|
||||
float denom = NdotV * (1.0 - k) + k;
|
||||
|
||||
return nom / denom;
|
||||
}
|
||||
|
||||
float geometrySmith(vec3 N, vec3 V, vec3 L, float roughness) {
|
||||
float NdotV = max(dot(N, V), 0.0);
|
||||
float NdotL = max(dot(N, L), 0.0);
|
||||
float ggx2 = geometrySchlickGGX(NdotV, roughness);
|
||||
float ggx1 = geometrySchlickGGX(NdotL, roughness);
|
||||
|
||||
return ggx1 * ggx2;
|
||||
}
|
||||
|
||||
vec3 fresnelSchlick(float cosTheta, vec3 F0) {
|
||||
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
|
||||
}
|
||||
|
||||
vec3 calculatePointLight(Light light, vec3 worldPos, vec3 V, vec3 N, vec3 F0, vec3 albedo, float metallic, float roughness) {
|
||||
vec3 tmpSub = light.position - worldPos;
|
||||
vec3 L = normalize(tmpSub);
|
||||
vec3 H = normalize(V + L);
|
||||
|
||||
// Calculate distance and attenuation
|
||||
float distance = length(tmpSub);
|
||||
float attenuation = 1.0 / (distance * distance);
|
||||
float intensity = 10.0f;
|
||||
vec3 radiance = light.color * light.intensity * attenuation;
|
||||
|
||||
// Cook-Torrance BRDF
|
||||
float NDF = distributionGGX(N, H, roughness);
|
||||
float G = geometrySmith(N, V, L, roughness);
|
||||
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
|
||||
|
||||
vec3 numerator = NDF * G * F;
|
||||
float denominator = 4.0 * max(dot(N, V), 0.0) * max(dot(N, L), 0.0) + 0.0001;
|
||||
vec3 specular = numerator / denominator;
|
||||
|
||||
vec3 kS = F;
|
||||
vec3 kD = vec3(1.0) - kS;
|
||||
kD *= 1.0 - metallic;
|
||||
|
||||
float NdotL = max(dot(N, L), 0.0);
|
||||
return (kD * albedo / PI + specular) * radiance * NdotL;
|
||||
}
|
||||
|
||||
vec3 calculateDirectionalLight(Light light, vec3 V, vec3 N, vec3 F0, vec3 albedo, float metallic, float roughness) {
|
||||
vec3 L = normalize(-light.position);
|
||||
vec3 H = normalize(V + L);
|
||||
|
||||
vec3 radiance = light.color * light.intensity;
|
||||
|
||||
// Cook-Torrance BRDF
|
||||
float NDF = distributionGGX(N, H, roughness);
|
||||
float G = geometrySmith(N, V, L, roughness);
|
||||
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
|
||||
|
||||
vec3 numerator = NDF * G * F;
|
||||
float denominator = 4.0 * max(dot(N, V), 0.0) * max(dot(N, L), 0.0) + 0.0001;
|
||||
vec3 specular = numerator / denominator;
|
||||
|
||||
vec3 kS = F;
|
||||
vec3 kD = vec3(1.0) - kS;
|
||||
kD *= 1.0 - metallic;
|
||||
|
||||
float NdotL = max(dot(N, L), 0.0);
|
||||
return (kD * albedo / PI + specular) * radiance * NdotL;
|
||||
}
|
||||
|
||||
void main() {
|
||||
outFragColor = vec4(texture(albedoSampler, inTextCoord).rgb, 1.0);
|
||||
vec3 albedo = texture(albedoSampler, inTextCoord).rgb;
|
||||
vec3 normal = texture(normalsSampler, inTextCoord).rgb;
|
||||
vec3 worldPos = texture(posSampler, inTextCoord).rgb;
|
||||
vec3 pbr = texture(pbrSampler, inTextCoord).rgb;
|
||||
|
||||
float roughness = pbr.g;
|
||||
float metallic = pbr.b;
|
||||
|
||||
vec3 N = normalize(normal);
|
||||
vec3 V = normalize(sceneInfo.camPos - worldPos);
|
||||
|
||||
vec3 F0 = vec3(0.04);
|
||||
F0 = mix(F0, albedo, metallic);
|
||||
|
||||
vec3 Lo = vec3(0.0);
|
||||
for (uint i = 0; i < sceneInfo.numLights; i++) {
|
||||
Light light = lights.lights[i];
|
||||
if (light.directional == 1) {
|
||||
Lo += calculateDirectionalLight(light, V, N, F0, albedo, metallic, roughness);
|
||||
} else {
|
||||
Lo += calculatePointLight(light, worldPos, V, N, F0, albedo, metallic, roughness);
|
||||
}
|
||||
}
|
||||
vec3 ambient = sceneInfo.ambientLightColor * albedo * sceneInfo.ambientLightIntensity;
|
||||
vec3 color = ambient + Lo;
|
||||
|
||||
outFragColor = vec4(color, 1.0f);
|
||||
}
|
||||
|
|
|
|||
BIN
resources/EngineResources/shaders/lighting_frag.glsl.spv
Normal file
BIN
resources/EngineResources/shaders/lighting_vertex.glsl.spv
Normal file
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
layout(constant_id = 0) const int USE_AA = 0;
|
||||
|
||||
const float GAMMA_CONST = 0.4545;
|
||||
const float GAMMA_CONST = 0.8545;
|
||||
const float SPAN_MAX = 8.0;
|
||||
const float REDUCE_MIN = 1.0/128.0;
|
||||
const float REDUCE_MUL = 1.0/32.0;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
layout(constant_id = 0) const int USE_AA = 0;
|
||||
|
||||
const float GAMMA_CONST = 0.4545;
|
||||
const float GAMMA_CONST = 0.8545;
|
||||
const float SPAN_MAX = 8.0;
|
||||
const float REDUCE_MIN = 1.0/128.0;
|
||||
const float REDUCE_MUL = 1.0/32.0;
|
||||
|
|
|
|||
BIN
resources/EngineResources/shaders/post_process_frag.glsl.spv
Normal file
BIN
resources/EngineResources/shaders/post_process_vtx.glsl.spv
Normal file
|
|
@ -1,15 +1,26 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 500;
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 0) in vec2 inTextCoords;
|
||||
layout(location = 0) out vec4 outAlbedo;
|
||||
|
||||
struct Material{
|
||||
|
||||
struct Material {
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint padding[2];
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform{
|
||||
|
|
@ -24,12 +35,14 @@ layout(push_constant) uniform pc{
|
|||
|
||||
void main()
|
||||
{
|
||||
|
||||
Material material = matUniform.materials[push_constants.materialIdx];
|
||||
if(material.hasTexture == 1){
|
||||
vec4 texColor = texture(textSampler[material.textureIdx],inTextCoords);
|
||||
if(texColor.a < 0.1){discard;}
|
||||
if(texColor.a < 0.4){discard;}
|
||||
outAlbedo = texColor;
|
||||
} else{
|
||||
outAlbedo = material.diffuseColor;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
resources/EngineResources/shaders/scene_fragment.glsl.spv
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 1) out vec4 outAlbedo ;
|
||||
layout(location = 0) out vec4 outPos;
|
||||
layout(location = 2) out vec4 outNormal;
|
||||
layout(location = 3) out vec4 outPBR;
|
||||
|
||||
struct Material {
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform {
|
||||
Material materials[];
|
||||
} matUniform;
|
||||
layout(set = 3, binding = 0) uniform sampler2D textSampler[MAX_TEXTURES];
|
||||
|
||||
vec3 calcNormal(Material material, vec3 normal, vec2 textCoords, mat3 TBN)
|
||||
{
|
||||
vec3 newNormal = normal;
|
||||
if (material.hasNormalMap > 0)
|
||||
{
|
||||
newNormal = texture(textSampler[material.normalMapIdx], textCoords).rgb;
|
||||
newNormal = normalize(newNormal * 2.0 - 1.0);
|
||||
newNormal = normalize(TBN * newNormal);
|
||||
}
|
||||
return newNormal;
|
||||
}
|
||||
|
||||
layout(push_constant) uniform pc {
|
||||
layout(offset = 64) uint materialIdx;
|
||||
} push_constants;
|
||||
|
||||
void main()
|
||||
{
|
||||
outPos = inPos;
|
||||
|
||||
Material material = matUniform.materials[push_constants.materialIdx];
|
||||
if (material.hasTexture == 1) {
|
||||
outAlbedo = texture(textSampler[material.textureIdx], inTextCoords);
|
||||
} else {
|
||||
outAlbedo = material.diffuseColor;
|
||||
}
|
||||
|
||||
|
||||
if(outAlbedo.a < 0.5) discard;
|
||||
|
||||
mat3 TBN = mat3(inTangent, inBitangent, inNormal);
|
||||
vec3 newNormal = calcNormal(material, inNormal, inTextCoords, TBN);
|
||||
outNormal = vec4(newNormal, 1.0f);
|
||||
|
||||
float ao = 0.5f;
|
||||
float roughnessFactor = 0.0f;
|
||||
float metallicFactor = 0.0f;
|
||||
if (material.hasRoughMap > 0) {
|
||||
vec4 metRoughValue = texture(textSampler[material.roughMapIdx], inTextCoords);
|
||||
roughnessFactor = metRoughValue.g;
|
||||
metallicFactor = metRoughValue.b;
|
||||
} else {
|
||||
roughnessFactor = material.roughnessFactor;
|
||||
metallicFactor = material.metallicFactor;
|
||||
}
|
||||
|
||||
outPBR = vec4(ao, roughnessFactor, metallicFactor, 1.0f);
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,25 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 500;
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 0) in vec2 inTextCoords;
|
||||
layout(location = 0) out vec4 outAlbedo;
|
||||
|
||||
struct Material{
|
||||
struct Material {
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint padding[2];
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform{
|
||||
|
|
|
|||
BIN
resources/EngineResources/shaders/scene_opaque_fragment.glsl.spv
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 1) out vec4 outAlbedo ;
|
||||
layout(location = 0) out vec4 outPos;
|
||||
layout(location = 2) out vec4 outNormal;
|
||||
layout(location = 3) out vec4 outPBR;
|
||||
|
||||
struct Material {
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform {
|
||||
Material materials[];
|
||||
} matUniform;
|
||||
layout(set = 3, binding = 0) uniform sampler2D textSampler[MAX_TEXTURES];
|
||||
|
||||
vec3 calcNormal(Material material, vec3 normal, vec2 textCoords, mat3 TBN)
|
||||
{
|
||||
vec3 newNormal = normal;
|
||||
if (material.hasNormalMap > 0)
|
||||
{
|
||||
newNormal = texture(textSampler[material.normalMapIdx], textCoords).rgb;
|
||||
newNormal = normalize(newNormal * 2.0 - 1.0);
|
||||
newNormal = normalize(TBN * newNormal);
|
||||
}
|
||||
return newNormal;
|
||||
}
|
||||
|
||||
layout(push_constant) uniform pc {
|
||||
layout(offset = 64) uint materialIdx;
|
||||
} push_constants;
|
||||
|
||||
void main()
|
||||
{
|
||||
outPos = inPos;
|
||||
|
||||
Material material = matUniform.materials[push_constants.materialIdx];
|
||||
if (material.hasTexture == 1) {
|
||||
outAlbedo = texture(textSampler[material.textureIdx], inTextCoords);
|
||||
} else {
|
||||
outAlbedo = material.diffuseColor;
|
||||
}
|
||||
|
||||
|
||||
if(outAlbedo.a < 0.75) discard;
|
||||
|
||||
mat3 TBN = mat3(inTangent, inBitangent, inNormal);
|
||||
vec3 newNormal = calcNormal(material, inNormal, inTextCoords, TBN);
|
||||
outNormal = vec4(newNormal, 1.0f);
|
||||
|
||||
float ao = 0.5f;
|
||||
float roughnessFactor = 0.0f;
|
||||
float metallicFactor = 0.0f;
|
||||
if (material.hasRoughMap > 0) {
|
||||
vec4 metRoughValue = texture(textSampler[material.roughMapIdx], inTextCoords);
|
||||
roughnessFactor = metRoughValue.g;
|
||||
metallicFactor = metRoughValue.b;
|
||||
} else {
|
||||
roughnessFactor = material.roughnessFactor;
|
||||
metallicFactor = material.metallicFactor;
|
||||
}
|
||||
|
||||
outPBR = vec4(ao, roughnessFactor, metallicFactor, 1.0f);
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,25 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 500;
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 0) in vec2 inTextCoords;
|
||||
layout(location = 0) out vec4 outAlbedo;
|
||||
|
||||
struct Material{
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint padding[2];
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 1) out vec4 outAlbedo ;
|
||||
layout(location = 0) out vec4 outPos;
|
||||
layout(location = 2) out vec4 outNormal;
|
||||
layout(location = 3) out vec4 outPBR;
|
||||
|
||||
struct Material {
|
||||
vec4 diffuseColor;
|
||||
uint hasTexture;
|
||||
uint textureIdx;
|
||||
uint hasNormalMap;
|
||||
uint normalMapIdx;
|
||||
uint hasRoughMap;
|
||||
uint roughMapIdx;
|
||||
float roughnessFactor;
|
||||
float metallicFactor;
|
||||
};
|
||||
layout(set = 2, binding = 0) readonly buffer MaterialUniform {
|
||||
Material materials[];
|
||||
} matUniform;
|
||||
layout(set = 3, binding = 0) uniform sampler2D textSampler[MAX_TEXTURES];
|
||||
|
||||
vec3 calcNormal(Material material, vec3 normal, vec2 textCoords, mat3 TBN)
|
||||
{
|
||||
vec3 newNormal = normal;
|
||||
if (material.hasNormalMap > 0)
|
||||
{
|
||||
newNormal = texture(textSampler[material.normalMapIdx], textCoords).rgb;
|
||||
newNormal = normalize(newNormal * 2.0 - 1.0);
|
||||
newNormal = normalize(TBN * newNormal);
|
||||
}
|
||||
return newNormal;
|
||||
}
|
||||
|
||||
layout(push_constant) uniform pc {
|
||||
layout(offset = 64) uint materialIdx;
|
||||
} push_constants;
|
||||
|
||||
void main()
|
||||
{
|
||||
outPos = inPos;
|
||||
|
||||
Material material = matUniform.materials[push_constants.materialIdx];
|
||||
if (material.hasTexture == 1) {
|
||||
outAlbedo = texture(textSampler[material.textureIdx], inTextCoords);
|
||||
} else {
|
||||
outAlbedo = material.diffuseColor;
|
||||
}
|
||||
|
||||
|
||||
if(outAlbedo.a < 0.05 || outAlbedo.a >= 0.75) discard;
|
||||
|
||||
mat3 TBN = mat3(inTangent, inBitangent, inNormal);
|
||||
vec3 newNormal = calcNormal(material, inNormal, inTextCoords, TBN);
|
||||
outNormal = vec4(newNormal, outAlbedo.a);
|
||||
|
||||
float ao = 0.5f;
|
||||
float roughnessFactor = 0.0f;
|
||||
float metallicFactor = 0.0f;
|
||||
if (material.hasRoughMap > 0) {
|
||||
vec4 metRoughValue = texture(textSampler[material.roughMapIdx], inTextCoords);
|
||||
roughnessFactor = metRoughValue.g;
|
||||
metallicFactor = metRoughValue.b;
|
||||
} else {
|
||||
roughnessFactor = material.roughnessFactor;
|
||||
metallicFactor = material.metallicFactor;
|
||||
}
|
||||
|
||||
outPBR = vec4(ao, roughnessFactor, metallicFactor, outAlbedo.a);
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,16 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) in vec3 inPos;
|
||||
layout(location = 1) in vec2 inTextCoords;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
layout(location = 2) in vec3 inTangent;
|
||||
layout(location = 3) in vec3 inBitangent;
|
||||
layout(location = 4) in vec2 inTextCoords;
|
||||
|
||||
layout(location = 0) out vec2 outTextCoords;
|
||||
layout(location = 0) out vec4 outPos;
|
||||
layout(location = 1) out vec3 outNormal;
|
||||
layout(location = 2) out vec3 outTangent;
|
||||
layout(location = 3) out vec3 outBitangent;
|
||||
layout(location = 4) out vec2 outTextCoords;
|
||||
|
||||
|
||||
layout(set = 0, binding = 0) uniform ProjUniform{
|
||||
|
|
@ -20,6 +27,12 @@ layout(push_constant) uniform pc{
|
|||
|
||||
void main()
|
||||
{
|
||||
vec4 worldPos = push_constants.modelMatrix * vec4(inPos,1);
|
||||
gl_Position = projUniform.matrix * viewUniform.matrix * push_constants.modelMatrix * vec4(inPos,1);
|
||||
mat3 mNormal = transpose(inverse(mat3(push_constants.modelMatrix)));
|
||||
outPos = worldPos;
|
||||
outNormal = mNormal * normalize(inNormal);
|
||||
outTangent = mNormal * normalize(inTangent);
|
||||
outBitangent = mNormal * normalize(inBitangent);
|
||||
outTextCoords = inTextCoords;
|
||||
}
|
||||
BIN
resources/EngineResources/shaders/scene_vertex.glsl.spv
Normal file
BIN
resources/EngineResources/shaders/swap_frag.glsl.spv
Normal file
BIN
resources/EngineResources/shaders/swap_vtx.glsl.spv
Normal file
|
Before Width: | Height: | Size: 5.7 KiB |
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"ID": "Welsh040Alice",
|
||||
"Meshes": [
|
||||
{
|
||||
"ID": "cube_0",
|
||||
"MaterialID": "Welsh040Alice-mat-1",
|
||||
"OffsetVertex": 0,
|
||||
"VertexSize": 42720,
|
||||
"OffsetIndex": 0,
|
||||
"IndexSize": 14976
|
||||
}
|
||||
],
|
||||
"VertexPath": "resources/models/Alice/Welsh040Alice.vtx",
|
||||
"IndexPath": "resources/models/Alice/Welsh040Alice.idx"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# Made in Blockbench 5.1.4
|
||||
newmtl m_43544ac2-29ce-cec1-9562-1ae6e86abc5a
|
||||
map_Kd Alice040.png
|
||||
newmtl none
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
[
|
||||
{
|
||||
"ID": "Welsh040Alice-mat-0",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "Welsh040Alice-mat-1",
|
||||
"TexturePath": "resources\\models\\Alice\\Alice040.png",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "Welsh040Alice-mat-2",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
7911
resources/models/Class08-1/Class08-1GLTF.gltf
Normal file
BIN
resources/models/Class08-1/Part1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/Class08-1/Part1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
resources/models/Class08-1/Part3_diff.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
resources/models/Class08-1/Part3_nmap.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
resources/models/Class08-1/Part3_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/Class08-1/Rightrail1_diff.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
resources/models/Class08-1/Rightrail1_nmap.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
resources/models/Class08-1/Rightrail1_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/Class08-1/Union1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/Class08-1/Union1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
10371
resources/models/Class08-9/Class08-9GLTF.gltf
Normal file
BIN
resources/models/Class08-9/Part1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/Class08-9/Part1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
resources/models/Class08-9/Part3_diff.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
resources/models/Class08-9/Part3_nmap.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
resources/models/Class08-9/Part3_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/Class08-9/Rightrail1_diff.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
resources/models/Class08-9/Rightrail1_nmap.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
resources/models/Class08-9/Rightrail1_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/Class08-9/Union1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/Class08-9/Union1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"ID": "CorvetteOBJ",
|
||||
"Meshes": [
|
||||
{
|
||||
"ID": "cube_0",
|
||||
"MaterialID": "CorvetteOBJ-mat-1",
|
||||
"OffsetVertex": 0,
|
||||
"VertexSize": 452640,
|
||||
"OffsetIndex": 0,
|
||||
"IndexSize": 151488
|
||||
}
|
||||
],
|
||||
"VertexPath": "resources/models/Corvette/CorvetteOBJ.vtx",
|
||||
"IndexPath": "resources/models/Corvette/CorvetteOBJ.idx"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# Made in Blockbench 5.1.4
|
||||
newmtl m_64480dc7-fc68-f52d-eb18-7368900ee2a3
|
||||
map_Kd corvetteclass.png
|
||||
newmtl none
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
[
|
||||
{
|
||||
"ID": "CorvetteOBJ-mat-0",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "CorvetteOBJ-mat-1",
|
||||
"TexturePath": "resources\\models\\Corvette\\corvetteclass.png",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "CorvetteOBJ-mat-2",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"ID": "corvetteclass",
|
||||
"Meshes": [
|
||||
{
|
||||
"ID": "hexadecagon_0",
|
||||
"MaterialID": "corvetteclass-mat-1",
|
||||
"OffsetVertex": 0,
|
||||
"VertexSize": 473600,
|
||||
"OffsetIndex": 0,
|
||||
"IndexSize": 154944
|
||||
}
|
||||
],
|
||||
"VertexPath": "resources/models/Corvette/corvetteclass.vtx",
|
||||
"IndexPath": "resources/models/Corvette/corvetteclass.idx"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# Made in Blockbench 5.1.4
|
||||
newmtl m_64480dc7-fc68-f52d-eb18-7368900ee2a3
|
||||
map_Kd corvetteclass.png
|
||||
newmtl none
|
||||
|
Before Width: | Height: | Size: 64 KiB |
|
|
@ -1,32 +0,0 @@
|
|||
[
|
||||
{
|
||||
"ID": "corvetteclass-mat-0",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "corvetteclass-mat-1",
|
||||
"TexturePath": "resources\\models\\Corvette\\corvetteclass.png",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "corvetteclass-mat-2",
|
||||
"TexturePath": "",
|
||||
"DiffuseColour": {
|
||||
"X": 0.6,
|
||||
"Y": 0.6,
|
||||
"Z": 0.6,
|
||||
"W": 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
2707
resources/models/FlatBed/FlatBedGLTF.gltf
Normal file
BIN
resources/models/FlatBed/Part1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/FlatBed/Part1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
resources/models/FlatBed/Part3_diff.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
resources/models/FlatBed/Part3_nmap.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
resources/models/FlatBed/Part3_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/FlatBed/Rightrail1_diff.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
resources/models/FlatBed/Rightrail1_nmap.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
resources/models/FlatBed/Rightrail1_spec.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
resources/models/FlatBed/Union1_diff.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
resources/models/FlatBed/Union1_nmap.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 3.6 MiB |
|
Before Width: | Height: | Size: 286 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 884 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 787 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 855 KiB |
|
Before Width: | Height: | Size: 1,022 KiB |