From patchwork Thu Jul 21 12:36:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 2970 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0413323F4D for ; Thu, 21 Jul 2011 12:43:25 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id C101BA1822A for ; Thu, 21 Jul 2011 12:43:24 +0000 (UTC) Received: by mail-qy0-f173.google.com with SMTP id 10so3962301qyk.11 for ; Thu, 21 Jul 2011 05:43:24 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr174789qcc.148.1311252204550; Thu, 21 Jul 2011 05:43:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs139537qcb; Thu, 21 Jul 2011 05:43:24 -0700 (PDT) Received: by 10.227.208.197 with SMTP id gd5mr198632wbb.22.1311251796817; Thu, 21 Jul 2011 05:36:36 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id fq4si2382242wbb.83.2011.07.21.05.36.36; Thu, 21 Jul 2011 05:36:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QjsUU-0000Cl-Vr for ; Thu, 21 Jul 2011 12:36:35 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 781882EA027 for ; Thu, 21 Jul 2011 12:36:34 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 63 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 63: Use a vec4 for the MaterialColor uniform, so that the alpha value can be specified by the user. Message-Id: <20110721123634.17019.16569.launchpad@loganberry.canonical.com> Date: Thu, 21 Jul 2011 12:36:34 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13475"; Instance="initZopeless config overlay" X-Launchpad-Hash: 0ecf1a34070c5c63e02b2398d31a828fb1f1c914 ------------------------------------------------------------ revno: 63 committer: Alexandros Frantzis timestamp: Fri 2010-11-19 15:11:20 +0200 message: Use a vec4 for the MaterialColor uniform, so that the alpha value can be specified by the user. modified: data/shaders/light-advanced.frag data/shaders/light-basic.vert src/scenebuild.cpp src/sceneshading.cpp src/scenetexture.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'data/shaders/light-advanced.frag' --- data/shaders/light-advanced.frag 2010-07-28 14:52:54 +0000 +++ data/shaders/light-advanced.frag 2010-11-19 13:11:20 +0000 @@ -8,7 +8,7 @@ uniform vec3 MaterialAmbient; uniform vec3 MaterialDiffuse; uniform vec3 MaterialSpecular; -uniform vec3 MaterialColor; +uniform vec4 MaterialColor; varying vec3 Normal; varying vec3 Light; @@ -32,5 +32,5 @@ // Calculate the final color gl_FragColor = vec4(ambient, 1.0) + vec4(specular, 1.0) + - vec4(diffuse, 1.0) * vec4(MaterialColor, 1.0); + vec4(diffuse, 1.0) * MaterialColor; } === modified file 'data/shaders/light-basic.vert' --- data/shaders/light-basic.vert 2010-07-09 13:34:12 +0000 +++ data/shaders/light-basic.vert 2010-11-19 13:11:20 +0000 @@ -5,7 +5,7 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 NormalMatrix; uniform vec4 LightSourcePosition; -uniform vec3 MaterialColor; +uniform vec4 MaterialColor; varying vec4 Color; varying vec2 TextureCoord; @@ -21,7 +21,7 @@ // Multiply the diffuse value by the vertex color (which is fixed in this case) // to get the actual color that we will use to draw this vertex with float diffuse = max(dot(N, L), 0.0); - Color = diffuse * vec4(MaterialColor, 1.0); + Color = diffuse * MaterialColor; // Set the texture coordinates as a varying TextureCoord = texcoord; === modified file 'src/scenebuild.cpp' --- src/scenebuild.cpp 2010-11-19 12:03:25 +0000 +++ src/scenebuild.cpp 2010-11-19 13:11:20 +0000 @@ -85,7 +85,7 @@ glUniform3fv(mShader.mLocations.LightSourceAmbient, 1, lightAmbient); glUniform3fv(mShader.mLocations.LightSourceDiffuse, 1, lightDiffuse); - glUniform3fv(mShader.mLocations.MaterialColor, 1, materialColor); + glUniform4fv(mShader.mLocations.MaterialColor, 1, materialColor); mCurrentFrame = 0; mRunning = true; === modified file 'src/sceneshading.cpp' --- src/sceneshading.cpp 2010-11-19 12:03:25 +0000 +++ src/sceneshading.cpp 2010-11-19 13:11:20 +0000 @@ -99,7 +99,7 @@ glUniform3fv(mShader[mCurrentPart].mLocations.MaterialAmbient, 1, materialAmbient); glUniform3fv(mShader[mCurrentPart].mLocations.MaterialDiffuse, 1, materialDiffuse); glUniform3fv(mShader[mCurrentPart].mLocations.MaterialSpecular, 1, materialSpecular); - glUniform3fv(mShader[mCurrentPart].mLocations.MaterialColor, 1, materialColor); + glUniform4fv(mShader[mCurrentPart].mLocations.MaterialColor, 1, materialColor); // Calculate and load the half vector Vector3f halfVector = Vector3f(lightPosition[0], lightPosition[1], lightPosition[2]); === modified file 'src/scenetexture.cpp' --- src/scenetexture.cpp 2010-07-15 08:59:36 +0000 +++ src/scenetexture.cpp 2010-11-19 13:11:20 +0000 @@ -91,7 +91,7 @@ glUniform3fv(mShader.mLocations.LightSourceAmbient, 1, lightAmbient); glUniform3fv(mShader.mLocations.LightSourceDiffuse, 1, lightDiffuse); - glUniform3fv(mShader.mLocations.MaterialColor, 1, materialColor); + glUniform4fv(mShader.mLocations.MaterialColor, 1, materialColor); mCurrentFrame = 0; mRunning = true;