Got metal to work

This commit is contained in:
Warwick 2022-07-22 15:02:42 +01:00
parent 3d3aaa3c3c
commit 58eb18354c
4 changed files with 6 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 KiB

View file

@ -13,4 +13,4 @@ illum 2
map_Bump wooden box and barrel/boxes_DefaultMaterial_Normal.png map_Bump wooden box and barrel/boxes_DefaultMaterial_Normal.png
map_Kd wooden box and barrel/boxes_DefaultMaterial_BaseColor.png map_Kd wooden box and barrel/boxes_DefaultMaterial_BaseColor.png
map_Ns wooden box and barrel/boxes_DefaultMaterial_Roughness.png map_Ns wooden box and barrel/boxes_DefaultMaterial_Roughness.png
map_Pm wooden box and barrel/boxes_DefaultMaterial_Metallic.png map_Pm wooden box and barrel/boxes_DefaultMaterial_Metallic.jpg

View file

@ -74,13 +74,15 @@ float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness)
void main() void main()
{ {
//albedo = vec3(texture(texture_diffuse1, ourTexCoord)); //albedo = vec3(texture(texture_diffuse1, ourTexCoord));
float metallic = texture(texture_metalness1, ourTexCoord).r; // float metallic = 1 - texture(texture_metalness1, ourTexCoord).r;
float metallic = 1 - texture(texture_metalness1, ourTexCoord).r;
// Establish ambient lighting // Establish ambient lighting
float ambientStrength = 0.1; float ambientStrength = 0.1;
// Establish a temporary hard coded light position // Establish a temporary hard coded light position
vec3 lightPosition = vec3(1.0, 1.0, 1.0); vec3 lightPosition = vec3( (sin(tick / 600.0)*2), 1 + sin(tick / 600.0)*2, 2.0);
vec3 lightColor = vec3(1.0, 0.9, 1.0); //vec3 lightColor = vec3(1.0, 1.0, 1.0) - sin(tick / 90);
vec3 lightColor = vec3(1.0, 1.0, 1.0);
// Normal light maths // Normal light maths
vec3 N = normalize(ourNormCoord); vec3 N = normalize(ourNormCoord);