From 95bcfaaa3ed37cad24388ef32b383e65c2ae8ebb Mon Sep 17 00:00:00 2001 From: tangziwen Date: Fri, 19 Dec 2014 15:31:06 +0800 Subject: [PATCH] update test 15:29 --- tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp | 2 +- tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h | 2 +- tests/cpp-tests/Resources/Sprite3DTest/cylinder.frag | 6 +++--- tests/cpp-tests/Resources/Sprite3DTest/cylinder.vert | 6 +++--- tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.frag | 6 +++--- tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.vert | 6 +++--- tests/cpp-tests/Resources/Sprite3DTest/toon.frag | 6 +++--- tests/cpp-tests/Resources/Sprite3DTest/toon.vert | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 00235b3f8b..7f927cd903 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -103,7 +103,7 @@ static Layer* restartSpriteTestAction() //------------------------------------------------------------------ Sprite3DTestDemo::Sprite3DTestDemo(void) - : BaseTest() +: BaseTest() { } diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index 881240fb25..330443d12e 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -173,7 +173,7 @@ protected: float _outlineWidth; //weak reference EffectSprite3D* _sprite; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _backToForegroundListener; #endif diff --git a/tests/cpp-tests/Resources/Sprite3DTest/cylinder.frag b/tests/cpp-tests/Resources/Sprite3DTest/cylinder.frag index 0771bcdb58..c971705dfd 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/cylinder.frag +++ b/tests/cpp-tests/Resources/Sprite3DTest/cylinder.frag @@ -1,7 +1,7 @@ #ifdef GL_ES -varying mediump vec2 TextureCoordOut; +varying mediump vec2 v_texture_coord; #else -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; #endif uniform vec4 u_color; @@ -12,5 +12,5 @@ void main(void) { vec4 color = duration*vec4(0,0.8,0.4,1.0); //blend two texture - gl_FragColor = u_color*texture2D(CC_Texture0, vec2(TextureCoordOut.x- 2.0 * offset,TextureCoordOut.y)) * vec4(0.3,0.3,0.3,1)+texture2D(caustics,vec2(TextureCoordOut.x-offset,TextureCoordOut.y)).r*color; + gl_FragColor = u_color*texture2D(CC_Texture0, vec2(v_texture_coord.x- 2.0 * offset,v_texture_coord.y)) * vec4(0.3,0.3,0.3,1)+texture2D(caustics,vec2(v_texture_coord.x-offset,v_texture_coord.y)).r*color; } \ No newline at end of file diff --git a/tests/cpp-tests/Resources/Sprite3DTest/cylinder.vert b/tests/cpp-tests/Resources/Sprite3DTest/cylinder.vert index 01da9c33bf..cf80309904 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/cylinder.vert +++ b/tests/cpp-tests/Resources/Sprite3DTest/cylinder.vert @@ -1,10 +1,10 @@ attribute vec4 a_position; attribute vec2 a_texCoord; uniform float offset; -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; void main(void) { gl_Position = CC_MVPMatrix * a_position; - TextureCoordOut = a_texCoord; - TextureCoordOut.y = (1.0 - TextureCoordOut.y); + v_texture_coord = a_texCoord; + v_texture_coord.y = (1.0 - v_texture_coord.y); } diff --git a/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.frag b/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.frag index 0b391ebc98..6686997af8 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.frag +++ b/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.frag @@ -1,8 +1,8 @@ #ifdef GL_ES -varying mediump vec2 TextureCoordOut; +varying mediump vec2 v_texture_coord; varying mediump vec4 v_position; #else -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; varying vec4 v_position; #endif uniform sampler2D u_shadowTexture; @@ -18,5 +18,5 @@ void main(void) coord.x = dot(v_position.xyz - u_target_pos, UVector) + 0.5f; coord.y = dot(v_position.xyz - u_target_pos, VVector) + 0.5f; - gl_FragColor = u_color*texture2D(CC_Texture0,TextureCoordOut)*texture2D(u_shadowTexture,coord); + gl_FragColor = u_color*texture2D(CC_Texture0,v_texture_coord)*texture2D(u_shadowTexture,coord); } \ No newline at end of file diff --git a/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.vert b/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.vert index 1c8b991777..09c834f3be 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.vert +++ b/tests/cpp-tests/Resources/Sprite3DTest/simple_shadow.vert @@ -1,12 +1,12 @@ attribute vec4 a_position; attribute vec2 a_texCoord; -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; varying vec4 v_position; uniform mat4 u_model_matrix; void main(void) { gl_Position = CC_PMatrix * CC_MVMatrix * a_position; - TextureCoordOut = a_texCoord; - TextureCoordOut.y = (1.0 - TextureCoordOut.y); + v_texture_coord = a_texCoord; + v_texture_coord.y = (1.0 - v_texture_coord.y); v_position = u_model_matrix * a_position; } diff --git a/tests/cpp-tests/Resources/Sprite3DTest/toon.frag b/tests/cpp-tests/Resources/Sprite3DTest/toon.frag index 498884dd00..1c95b8fbfd 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/toon.frag +++ b/tests/cpp-tests/Resources/Sprite3DTest/toon.frag @@ -1,7 +1,7 @@ #ifdef GL_ES -varying mediump vec2 TextureCoordOut; +varying mediump vec2 v_texture_coord; #else -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; #endif uniform vec4 u_color; varying vec3 v_normal; @@ -12,7 +12,7 @@ void main(void) vec3 light_color = vec3(1,1,1); vec3 normal = normalize(v_normal); float diffuse_factor = dot(normal,-light_direction); - vec4 diffuse_color = texture2D(CC_Texture0,TextureCoordOut); + vec4 diffuse_color = texture2D(CC_Texture0,v_texture_coord); if (diffuse_factor > 0.95) diffuse_factor=1.0; else if (diffuse_factor > 0.75) diffuse_factor = 0.8; diff --git a/tests/cpp-tests/Resources/Sprite3DTest/toon.vert b/tests/cpp-tests/Resources/Sprite3DTest/toon.vert index 902b8977bc..730f010e41 100644 --- a/tests/cpp-tests/Resources/Sprite3DTest/toon.vert +++ b/tests/cpp-tests/Resources/Sprite3DTest/toon.vert @@ -1,12 +1,12 @@ attribute vec4 a_position; attribute vec2 a_texCoord; attribute vec3 a_normal; -varying vec2 TextureCoordOut; +varying vec2 v_texture_coord; varying vec3 v_normal; void main(void) { gl_Position = CC_MVPMatrix * a_position; - TextureCoordOut = a_texCoord; - TextureCoordOut.y = (1.0 - TextureCoordOut.y); + v_texture_coord = a_texCoord; + v_texture_coord.y = (1.0 - v_texture_coord.y); v_normal = CC_NormalMatrix *a_normal; }