X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fdeferred-shading%2Fdeferred-shading.cpp;h=7a1920f7786a67ce0fb2b621612543340a7a0fd8;hb=4f818cd12c9bf2773d44e5cfdc2fc0a344abf7f5;hp=e09032f967839327e85ba7eea7dc3a9661ac1881;hpb=31fe26eea3e2d2a1cd7cbef08afdee5befe4242d;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/deferred-shading/deferred-shading.cpp b/examples/deferred-shading/deferred-shading.cpp index e09032f..7a1920f 100644 --- a/examples/deferred-shading/deferred-shading.cpp +++ b/examples/deferred-shading/deferred-shading.cpp @@ -64,7 +64,7 @@ in vec3 aNormal; out vec4 vPosition; out vec3 vNormal; -vec4 Map(vec4 v) // projection space -> texture +vec4 Map(vec4 v) // projection space -> texture { return vec4(v.xyz / (2.f * v.w) + vec3(.5f), (v.w - NEAR) * INV_DEPTH); } @@ -149,7 +149,7 @@ uniform vec3 uDepth_InvDepth_Near;\n) // Light source uniforms struct Light { - vec3 position; // view space + vec3 position; // view space float radius; vec3 color; }; @@ -160,7 +160,7 @@ in vec2 vUv; out vec4 oColor; -vec4 Unmap(vec4 m) // texture -> projection +vec4 Unmap(vec4 m) // texture -> projection { m.w = m.w * DEPTH + NEAR; m.xyz = (m.xyz - vec3(.5)) * (2.f * m.w); @@ -180,10 +180,10 @@ vec3 CalculateLighting(vec3 pos, vec3 normal) rel /= distance; float a = uLights[i].radius / (kAttenuationConst + kAttenuationLinear * distance + - kAttenuationQuadratic * distance * distance); // attenuation + kAttenuationQuadratic * distance * distance); // attenuation - float l = max(0.f, dot(normal, rel)); // lambertian - float s = pow(max(0.f, dot(viewDirRefl, rel)), 256.f); // specular + float l = max(0.f, dot(normal, rel)); // lambertian + float s = pow(max(0.f, dot(viewDirRefl, rel)), 256.f); // specular light += (uLights[i].color * (l + s)) * a; } @@ -324,7 +324,7 @@ Geometry CreateTexturedQuadGeometry(bool flipV) std::swap(vertexData[1].aTexCoord, vertexData[3].aTexCoord); } - PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map() + VertexBuffer vertexBuffer = VertexBuffer::New( Property::Map() .Add( "aPosition", Property::VECTOR3 ) .Add( "aTexCoord", Property::VECTOR2 ) ); vertexBuffer.SetData( vertexData, std::extent::value ); @@ -402,7 +402,7 @@ Geometry CreateOctahedron(bool invertNormals) } // Configure property buffers and create geometry. - PropertyBuffer vertexBuffer = PropertyBuffer::New(Property::Map() + VertexBuffer vertexBuffer = VertexBuffer::New(Property::Map() .Add("aPosition", Property::VECTOR3) .Add("aNormal", Property::VECTOR3)); vertexBuffer.SetData(vertexData, std::extent::value); @@ -777,7 +777,7 @@ private: void OnKeyEvent(const KeyEvent& event) { - if(event.GetState() == KeyEvent::Down) + if(event.GetState() == KeyEvent::DOWN) { if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) ) {