From patchwork Thu Jul 21 12:36:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandros Frantzis X-Patchwork-Id: 2911 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 5D54823F52 for ; Thu, 21 Jul 2011 12:36:43 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2DF9EA185A2 for ; Thu, 21 Jul 2011 12:36:43 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 30so842327qyk.11 for ; Thu, 21 Jul 2011 05:36:43 -0700 (PDT) Received: by 10.229.217.3 with SMTP id hk3mr202915qcb.38.1311251802964; Thu, 21 Jul 2011 05:36:42 -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 hl14cs139333qcb; Thu, 21 Jul 2011 05:36:42 -0700 (PDT) Received: by 10.216.178.146 with SMTP id f18mr728784wem.70.1311251794514; Thu, 21 Jul 2011 05:36:34 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id t66si2399715weq.32.2011.07.21.05.36.34; Thu, 21 Jul 2011 05:36:34 -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 1QjsUS-0000D3-MD for ; Thu, 21 Jul 2011 12:36:32 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B41582E8958 for ; Thu, 21 Jul 2011 12:36:30 +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: 12 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 12: Fix errors in shaders. Message-Id: <20110721123630.17019.40508.launchpad@loganberry.canonical.com> Date: Thu, 21 Jul 2011 12:36:30 -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: 801dd37dd8d02d70ee6c043939b704395ef94971 ------------------------------------------------------------ revno: 12 committer: Alexandros Frantzis timestamp: Thu 2010-07-08 12:08:36 +0300 message: Fix errors in shaders. modified: data/shaders/light-advanced.frag data/shaders/light-basic.vert --- 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-07 10:32:18 +0000 +++ data/shaders/light-advanced.frag 2010-07-08 09:08:36 +0000 @@ -81,14 +81,14 @@ void main(void) { - Normal = normalize(Normal); - - float Diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * max(dot(Normal, Light),0.0); - - float Ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient; + vec3 N = normalize(Normal); + + vec4 Diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * max(dot(N, Light),0.0); + + vec4 Ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient; Ambient += gl_LightModel.ambient * gl_FrontMaterial.ambient; - float Specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(max(dot(Normal,HalfVector),0.0), gl_FrontMaterial.shininess); + vec4 Specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(max(dot(Normal,HalfVector),0.0), gl_FrontMaterial.shininess); - gl_FragColor = Ambient + (Diffuse * vec4(1,0,0,1)) + Specular; + gl_FragColor = Ambient + (Diffuse * vec4(0,0,1,1)) + Specular; } === modified file 'data/shaders/light-basic.vert' --- data/shaders/light-basic.vert 2010-07-07 10:32:18 +0000 +++ data/shaders/light-basic.vert 2010-07-08 09:08:36 +0000 @@ -62,11 +62,11 @@ void main(void) { - Normal = normalize(gl_NormalMatrix * gl_Normal); + vec3 Normal = normalize(gl_NormalMatrix * gl_Normal); - Light = normalize(gl_LightSource[0].position.xyz); + vec3 Light = normalize(gl_LightSource[0].position.xyz); Diffuse = max(dot(Normal, Light),0.0); gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -} \ No newline at end of file +}