added normal map
This commit is contained in:
@@ -5,6 +5,8 @@ struct Material {
|
|||||||
vec4 baseColor;
|
vec4 baseColor;
|
||||||
uint albedoTexture;
|
uint albedoTexture;
|
||||||
|
|
||||||
|
uint normalTexture;
|
||||||
|
|
||||||
float metallicFactor;
|
float metallicFactor;
|
||||||
float roughnessFactor;
|
float roughnessFactor;
|
||||||
uint metallicRoughnessTexture;
|
uint metallicRoughnessTexture;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ struct Material {
|
|||||||
vec4 baseColor;
|
vec4 baseColor;
|
||||||
uint albedoTexture;
|
uint albedoTexture;
|
||||||
|
|
||||||
|
uint normalTexture;
|
||||||
|
|
||||||
float metallicFactor;
|
float metallicFactor;
|
||||||
float roughnessFactor;
|
float roughnessFactor;
|
||||||
uint metallicRoughnessTexture;
|
uint metallicRoughnessTexture;
|
||||||
@@ -74,6 +76,12 @@ void main()
|
|||||||
|
|
||||||
color = texture(texSampler[material.albedoTexture], vertex.uv[0]).xyz;
|
color = texture(texSampler[material.albedoTexture], vertex.uv[0]).xyz;
|
||||||
|
|
||||||
|
if(material.normalTexture != 0) {
|
||||||
|
normal = texture(texSampler[material.normalTexture], vertex.uv[0]).xyz;
|
||||||
|
}
|
||||||
|
else {
|
||||||
normal = vertex.normal.xyz;
|
normal = vertex.normal.xyz;
|
||||||
|
}
|
||||||
|
|
||||||
gl_Position = Camera.projection * Camera.view * PushConstants.render_matrix * vec4(vertex.position.xyz, 1.0);
|
gl_Position = Camera.projection * Camera.view * PushConstants.render_matrix * vec4(vertex.position.xyz, 1.0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user