From f78aad8abd7b09ab0ad1f94c9d8d41cb1247a4ae Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 24 May 2014 22:58:31 +0200 Subject: [PATCH] Fixed colors to match previous version of the example. --- examples/OpenGL/main.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index 4f4d9d15..14315a95 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -135,21 +135,26 @@ int main(int argc, char *argv[]) vec3 normal = worldNormal.xyz; - if(outMaterial.x == 1) + switch(outMaterial.x) { + case 1: outputColor = vec4(1.0, 0.0, 0.0, 1.0); - } - else if(outMaterial.x == 2) - { + break; + case 2: outputColor = vec4(0.0, 1.0, 0.0, 1.0); - } - else if(outMaterial.x == 3) - { + break; + case 3: outputColor = vec4(0.0, 0.0, 1.0, 1.0); - } - else - { + break; + case 4: outputColor = vec4(1.0, 1.0, 0.0, 1.0); + break; + case 5: + outputColor = vec4(1.0, 0.0, 1.0, 1.0); + break; + default: + outputColor = vec4(1.0, 1.0, 1.0, 1.0); + break; } //float color = clamp(abs(dot(normalize(normal.xyz), vec3(0.9,0.1,0.5))), 0, 1);