diff --git a/bin/Debug/main.exe b/bin/Debug/main.exe index 74fd5c5..b3cbaa3 100644 Binary files a/bin/Debug/main.exe and b/bin/Debug/main.exe differ diff --git a/data/circuits/lego.png b/data/circuits/lego.png new file mode 100644 index 0000000..3810929 Binary files /dev/null and b/data/circuits/lego.png differ diff --git a/src/main.cpp b/src/main.cpp index 0c4b6a0..98a5c75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) LoadTextureImage("../../data/display/textures/digit1.jpg"); // TextureDigit1 LoadTextureImage("../../data/circuits/wire.jpg"); // TexturePlaneWire LoadTextureImage("../../data/circuits/not.jpg"); // TexturePlaneNot - LoadTextureImage("../../data/fine-textured-plastic-2000-mm-architextures.jpg"); // TextureBlocks + LoadTextureImage("../../data/circuits/lego.png"); // TextureBlocks LoadTextureImage("../../data/Blocks_001_COLOR_B.jpg"); // TextureSphere LoadTextureImage("../../data/circuits/and.jpg"); // TexturePlaneAnd LoadTextureImage("../../data/grass-1000-mm-architextures.jpg"); // TextureFloor diff --git a/src/shader_fragment.glsl b/src/shader_fragment.glsl index c4ecc84..f008f45 100644 --- a/src/shader_fragment.glsl +++ b/src/shader_fragment.glsl @@ -351,7 +351,7 @@ void main() lambertDiffuseTerm = Kd * I * lambert; color.rgb = lambertDiffuseTerm + ambientTerm; // Diffuse } - else if (object_id == NOT || object_id == AND || object_id == OR) // Blinn-Phong e Phong shading + else if (object_id == AND || object_id == OR) // Blinn-Phong e Phong shading { U = texcoords.x * 2.0f; V = texcoords.y * 2.0f; @@ -359,6 +359,14 @@ void main() lambertDiffuseTerm = Kd * I * lambert; color.rgb = lambertDiffuseTerm + ambientTerm + specularTerm; // Blinn-Phong } + else if (object_id == NOT) // Blinn-Phong e Phong shading + { + U = texcoords.x; + V = texcoords.y; + Kd = texture(TextureBlocks, vec2(U,V)).rgb; + lambertDiffuseTerm = Kd * I * lambert; + color.rgb = lambertDiffuseTerm + ambientTerm + specularTerm; // Blinn-Phong + } // NOTE: Se você quiser fazer o rendering de objetos transparentes, é // necessário: