diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 7a3547a2aa..6941241989 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -445,33 +445,21 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source GLchar lightStruct[] = { "#if CC_MAX_DIRECTIONAL_LIGHT_NUM \n" - "struct DirectionalLightSource \n" - "{ \n" - " vec3 color; \n" - " vec3 direction; \n" - "}; \n" - "uniform DirectionalLightSource CC_DirLightSource[CC_MAX_DIRECTIONAL_LIGHT_NUM]; \n" - "uniform int CC_EnabledDirLightNum; \n" + "uniform vec3 CC_DirLightSourceColor[CC_MAX_DIRECTIONAL_LIGHT_NUM]; \n" + "uniform vec3 CC_DirLightSourceDirection[CC_MAX_DIRECTIONAL_LIGHT_NUM]; \n" "#endif \n" "#if CC_MAX_POINT_LIGHT_NUM \n" - "struct PointLightSource \n" - "{ \n" - " vec3 color; \n" - " vec4 position; \n" - "}; \n" - "uniform PointLightSource CC_PointLightSource[CC_MAX_POINT_LIGHT_NUM]; \n" - "uniform int CC_EnabledPointLightNum; \n" + "uniform vec3 CC_PointLightSourceColor[CC_MAX_POINT_LIGHT_NUM]; \n" + "uniform vec3 CC_PointLightSourcePosition[CC_MAX_POINT_LIGHT_NUM]; \n" + "uniform float CC_PointLightSourceRangeInverse[CC_MAX_POINT_LIGHT_NUM]; \n" "#endif \n" "#if CC_MAX_SPOT_LIGHT_NUM \n" - "struct SpotLightSource \n" - "{ \n" - " vec3 color; \n" - " vec3 position; \n" - " vec3 direction; \n" - " vec3 params; \n" - "}; \n" - "uniform SpotLightSource CC_SpotLightSource[CC_MAX_SPOT_LIGHT_NUM]; \n" - "uniform int CC_EnabledSpotLightNum; \n" + "uniform vec3 CC_SpotLightSourceColor[CC_MAX_SPOT_LIGHT_NUM]; \n" + "uniform vec3 CC_SpotLightSourcePosition[CC_MAX_SPOT_LIGHT_NUM]; \n" + "uniform vec3 CC_SpotLightSourceDirection[CC_MAX_SPOT_LIGHT_NUM]; \n" + "uniform float CC_SpotLightSourceInnerAngleCos[CC_MAX_SPOT_LIGHT_NUM]; \n" + "uniform float CC_SpotLightSourceOuterAngleCos[CC_MAX_SPOT_LIGHT_NUM]; \n" + "uniform float CC_SpotLightSourceRangeInverse[CC_MAX_SPOT_LIGHT_NUM]; \n" "#endif \n" "uniform vec4 CC_AmbientColor; \n" }; @@ -571,9 +559,9 @@ void GLProgram::updateUniforms() // _builtInUniforms[UNIFORM_ENABLED_SPOT_LIGHT_NUM] != -1 // ); - _flags.usesLights = CC_MAX_DIRECTIONAL_LIGHT_NUM || - CC_MAX_POINT_LIGHT_NUM || - CC_MAX_SPOT_LIGHT_NUM; + _flags.usesLights = (0 < CC_MAX_DIRECTIONAL_LIGHT_NUM) || + (0 < CC_MAX_POINT_LIGHT_NUM) || + (0 < CC_MAX_SPOT_LIGHT_NUM); _flags.usesP = _builtInUniforms[UNIFORM_P_MATRIX] != -1; _flags.usesMV = _builtInUniforms[UNIFORM_MV_MATRIX] != -1; _flags.usesMVP = _builtInUniforms[UNIFORM_MVP_MATRIX] != -1; @@ -1008,9 +996,9 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV) CCASSERT(enabledDirLightNum < CC_MAX_DIRECTIONAL_LIGHT_NUM, ""); Vec3 dir = light->getWorldDirection(); dir.normalize(); - sprintf(str, "CC_DirLightSource[%d].%s", enabledDirLightNum, "color"); + sprintf(str, "CC_DirLightSourceColor[%d]", enabledDirLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), col.r / 255.0f, col.g / 255.0f, col.b / 255.0f); - sprintf(str, "CC_DirLightSource[%d].%s", enabledDirLightNum, "direction"); + sprintf(str, "CC_DirLightSourceDirection[%d]", enabledDirLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), dir.x, dir.y, dir.z); ++enabledDirLightNum; } @@ -1019,10 +1007,12 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV) { CCASSERT(enabledPointLightNum < CC_MAX_POINT_LIGHT_NUM, ""); Mat4 mat= light->getNodeToWorldTransform(); - sprintf(str, "CC_PointLightSource[%d].%s", enabledPointLightNum, "color"); + sprintf(str, "CC_PointLightSourceColor[%d]", enabledPointLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), col.r / 255.0f, col.g / 255.0f, col.b / 255.0f); - sprintf(str, "CC_PointLightSource[%d].%s", enabledPointLightNum, "position"); - setUniformLocationWith4f(glGetUniformLocation(_program, str), mat.m[12], mat.m[13], mat.m[14], 1.0f / light->getRange()); + sprintf(str, "CC_PointLightSourcePosition[%d]", enabledPointLightNum); + setUniformLocationWith3f(glGetUniformLocation(_program, str), mat.m[12], mat.m[13], mat.m[14]); + sprintf(str, "CC_PointLightSourceRangeInverse[%d]", enabledPointLightNum); + setUniformLocationWith1f(glGetUniformLocation(_program, str), 1.0f / light->getRange()); ++enabledPointLightNum; } else @@ -1031,14 +1021,18 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV) Vec3 dir = light->getWorldDirection(); dir.normalize(); Mat4 mat= light->getNodeToWorldTransform(); - sprintf(str, "CC_SpotLightSource[%d].%s", enabledSpotLightNum, "color"); + sprintf(str, "CC_SpotLightSourceColor[%d]", enabledSpotLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), col.r / 255.0f, col.g / 255.0f, col.b / 255.0f); - sprintf(str, "CC_SpotLightSource[%d].%s", enabledSpotLightNum, "position"); + sprintf(str, "CC_SpotLightSourcePosition[%d]", enabledSpotLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), mat.m[12], mat.m[13], mat.m[14]); - sprintf(str, "CC_SpotLightSource[%d].%s", enabledSpotLightNum, "direction"); + sprintf(str, "CC_SpotLightSourceDirection[%d]", enabledSpotLightNum); setUniformLocationWith3f(glGetUniformLocation(_program, str), dir.x, dir.y, dir.z); - sprintf(str, "CC_SpotLightSource[%d].%s", enabledSpotLightNum, "params"); - setUniformLocationWith3f(glGetUniformLocation(_program, str), cosf(light->getInnerAngle()), cosf(light->getOuterAngle()), 1.0f / light->getRange()); + sprintf(str, "CC_SpotLightSourceInnerAngleCos[%d]", enabledSpotLightNum); + setUniformLocationWith1f(glGetUniformLocation(_program, str), cosf(light->getInnerAngle())); + sprintf(str, "CC_SpotLightSourceOuterAngleCos[%d]", enabledSpotLightNum); + setUniformLocationWith1f(glGetUniformLocation(_program, str), cosf(light->getOuterAngle())); + sprintf(str, "CC_SpotLightSourceRangeInverse[%d]", enabledSpotLightNum); + setUniformLocationWith1f(glGetUniformLocation(_program, str), 1.0f / light->getRange()); ++enabledSpotLightNum; } } diff --git a/cocos/renderer/ccShader_3D_ColorNormal.frag b/cocos/renderer/ccShader_3D_ColorNormal.frag index efc14d8dd9..bec8b94dfe 100644 --- a/cocos/renderer/ccShader_3D_ColorNormal.frag +++ b/cocos/renderer/ccShader_3D_ColorNormal.frag @@ -27,76 +27,63 @@ varying vec3 v_normal; uniform vec4 u_color; -\n#if CC_MAX_POINT_LIGHT_NUM\n -void PointLight(int n, vec3 normal, inout vec4 intensity) +vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, float attenuation) { - vec3 dir = v_vertexToPointLightDirection[n]; - vec3 ldir = dir * CC_PointLightSource[n].position.w; - float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); - intensity.xyz += CC_PointLightSource[n].color * max(0.0, dot(normalize(dir), normal)) * attenuation; - intensity.w = 1.0; + float diffuse = max(dot(normalVector, lightDirection), 0.0); + vec3 diffuseColor = lightColor * diffuse * attenuation; + + return diffuseColor; } -\n#endif\n - -\n#if CC_MAX_DIRECTIONAL_LIGHT_NUM\n -void DirectionalLight(int n, vec3 normal, inout vec4 intensity) -{ - intensity.xyz += CC_DirLightSource[n].color * max(0.0, dot(-CC_DirLightSource[n].direction, normal)); - intensity.w = 1.0; -} -\n#endif\n - -\n#if CC_MAX_SPOT_LIGHT_NUM\n -void SpotLight(int n, vec3 normal, inout vec4 intensity) -{ - vec3 dir = v_vertexToSpotLightDirection[n]; - vec3 ldir = dir * CC_SpotLightSource[n].params.z; - float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); - float spotDot = dot(normalize(dir), -CC_SpotLightSource[n].direction); - float innerCos = CC_SpotLightSource[n].params.x; - float outerCos = CC_SpotLightSource[n].params.y; - float factor = smoothstep(outerCos, innerCos, spotDot); - intensity.xyz += CC_SpotLightSource[n].color * max(0.0, dot(normalize(dir), normal)) * factor * attenuation; - intensity.w = 1.0; -} -\n#endif\n void main(void) { - vec4 intensity = vec4(0.0); -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n vec3 normal = normalize(v_normal); \n#endif\n -\n#if CC_MAX_DIRECTIONAL_LIGHT_NUM\n - + vec4 combinedColor = CC_AmbientColor; + + // Directional light contribution +\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_DIRECTIONAL_LIGHT_NUM; ++i) { - DirectionalLight(i, normal, intensity); + vec3 lightDirection = normalize(CC_DirLightSourceDirection[i] * 2.0); + combinedColor.xyz += computeLighting(normal, -lightDirection, CC_DirLightSourceColor[i], 1.0); } - \n#endif\n -\n#if CC_MAX_POINT_LIGHT_NUM\n - + // Point light contribution +\n#if (CC_MAX_POINT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_POINT_LIGHT_NUM; ++i) { - PointLight(i, normal, intensity); + vec3 ldir = v_vertexToPointLightDirection[i] * CC_PointLightSourceRangeInverse[i]; + float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); + combinedColor.xyz += computeLighting(normal, normalize(v_vertexToPointLightDirection[i]), CC_PointLightSourceColor[i], attenuation); } - \n#endif\n -\n#if CC_MAX_SPOT_LIGHT_NUM\n - + // Spot light contribution +\n#if (CC_MAX_SPOT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_SPOT_LIGHT_NUM; ++i) { - SpotLight(i, normal, intensity); - } + // Compute range attenuation + vec3 ldir = v_vertexToSpotLightDirection[i] * CC_SpotLightSourceRangeInverse[i]; + float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); + vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection[i]); + vec3 spotLightDirection = normalize(CC_SpotLightSourceDirection[i] * 2.0); + + // "-lightDirection" is used because light direction points in opposite direction to spot direction. + float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection); + + // Apply spot attenuation + attenuation *= smoothstep(CC_SpotLightSourceOuterAngleCos[i], CC_SpotLightSourceInnerAngleCos[i], spotCurrentAngleCos); + combinedColor.xyz += computeLighting(normal, vertexToSpotLightDirection, CC_SpotLightSourceColor[i], attenuation); + } \n#endif\n -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n - gl_FragColor = u_color * (CC_AmbientColor + intensity); +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n + gl_FragColor = u_color * combinedColor; \n#else\n gl_FragColor = u_color; \n#endif\n diff --git a/cocos/renderer/ccShader_3D_ColorNormalTex.frag b/cocos/renderer/ccShader_3D_ColorNormalTex.frag index d36e7f4fbd..a614905d13 100644 --- a/cocos/renderer/ccShader_3D_ColorNormalTex.frag +++ b/cocos/renderer/ccShader_3D_ColorNormalTex.frag @@ -27,78 +27,66 @@ varying vec3 v_normal; uniform vec4 u_color; -\n#if CC_MAX_POINT_LIGHT_NUM\n -void PointLight(int n, vec3 normal, inout vec4 intensity) +vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, float attenuation) { - vec3 dir = v_vertexToPointLightDirection[n]; - vec3 ldir = dir * CC_PointLightSource[n].position.w; - float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); - intensity.xyz += CC_PointLightSource[n].color * max(0.0, dot(normalize(dir), normal)) * attenuation; - intensity.w = 1.0; + float diffuse = max(dot(normalVector, lightDirection), 0.0); + vec3 diffuseColor = lightColor * diffuse * attenuation; + + return diffuseColor; } -\n#endif\n - -\n#if CC_MAX_DIRECTIONAL_LIGHT_NUM\n -void DirectionalLight(int n, vec3 normal, inout vec4 intensity) -{ - intensity.xyz += CC_DirLightSource[n].color * max(0.0, dot(-CC_DirLightSource[n].direction, normal)); - intensity.w = 1.0; -} -\n#endif\n - -\n#if CC_MAX_SPOT_LIGHT_NUM\n -void SpotLight(int n, vec3 normal, inout vec4 intensity) -{ - vec3 dir = v_vertexToSpotLightDirection[n]; - vec3 ldir = dir * CC_SpotLightSource[n].params.z; - float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); - float spotDot = dot(normalize(dir), -CC_SpotLightSource[n].direction); - float innerCos = CC_SpotLightSource[n].params.x; - float outerCos = CC_SpotLightSource[n].params.y; - float factor = smoothstep(outerCos, innerCos, spotDot); - intensity.xyz += CC_SpotLightSource[n].color * max(0.0, dot(normalize(dir), normal)) * factor * attenuation; - intensity.w = 1.0; -} -\n#endif\n void main(void) { - vec4 intensity = vec4(0.0); -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n vec3 normal = normalize(v_normal); \n#endif\n -\n#if CC_MAX_DIRECTIONAL_LIGHT_NUM\n - + vec4 combinedColor = CC_AmbientColor; + + // Directional light contribution +\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_DIRECTIONAL_LIGHT_NUM; ++i) { - DirectionalLight(i, normal, intensity); + vec3 lightDirection = normalize(CC_DirLightSourceDirection[i] * 2.0); + combinedColor.xyz += computeLighting(normal, -lightDirection, CC_DirLightSourceColor[i], 1.0); } - \n#endif\n -\n#if CC_MAX_POINT_LIGHT_NUM\n - + // Point light contribution +\n#if (CC_MAX_POINT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_POINT_LIGHT_NUM; ++i) { - PointLight(i, normal, intensity); + vec3 ldir = v_vertexToPointLightDirection[i] * CC_PointLightSourceRangeInverse[i]; + float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); + combinedColor.xyz += computeLighting(normal, normalize(v_vertexToPointLightDirection[i]), CC_PointLightSourceColor[i], attenuation); } - \n#endif\n -\n#if CC_MAX_SPOT_LIGHT_NUM\n - + // Spot light contribution +\n#if (CC_MAX_SPOT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_SPOT_LIGHT_NUM; ++i) { - SpotLight(i, normal, intensity); - } + // Compute range attenuation + vec3 ldir = v_vertexToSpotLightDirection[i] * CC_SpotLightSourceRangeInverse[i]; + float attenuation = clamp(1.0 - dot(ldir, ldir), 0.0, 1.0); + vec3 vertexToSpotLightDirection = normalize(v_vertexToSpotLightDirection[i]); + vec3 spotLightDirection = normalize(CC_SpotLightSourceDirection[i] * 2.0); + + // "-lightDirection" is used because light direction points in opposite direction to spot direction. + float spotCurrentAngleCos = dot(spotLightDirection, -vertexToSpotLightDirection); + + // Apply spot attenuation + attenuation *= smoothstep(CC_SpotLightSourceOuterAngleCos[i], CC_SpotLightSourceInnerAngleCos[i], spotCurrentAngleCos); + combinedColor.xyz += computeLighting(normal, vertexToSpotLightDirection, CC_SpotLightSourceColor[i], attenuation); + } \n#endif\n -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n - gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color * (CC_AmbientColor + intensity); + +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n + gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color * combinedColor; \n#else\n - gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color; + gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color; \n#endif\n } diff --git a/cocos/renderer/ccShader_3D_PositionNormalTex.vert b/cocos/renderer/ccShader_3D_PositionNormalTex.vert index 4b1f489d22..80bce316ea 100644 --- a/cocos/renderer/ccShader_3D_PositionNormalTex.vert +++ b/cocos/renderer/ccShader_3D_PositionNormalTex.vert @@ -20,18 +20,18 @@ void main(void) \n#if (CC_MAX_POINT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_POINT_LIGHT_NUM; ++i) { - v_vertexToPointLightDirection[i] = CC_PointLightSource[i].position.xyz - ePosition.xyz; + v_vertexToPointLightDirection[i] = CC_PointLightSourcePosition[i].xyz - ePosition.xyz; } \n#endif\n \n#if (CC_MAX_SPOT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_SPOT_LIGHT_NUM; ++i) { - v_vertexToSpotLightDirection[i] = CC_SpotLightSource[i].position.xyz - ePosition.xyz; + v_vertexToSpotLightDirection[i] = CC_SpotLightSourcePosition[i] - ePosition.xyz; } \n#endif\n -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n v_normal = CC_NormalMatrix * a_normal; \n#endif\n @@ -112,8 +112,8 @@ void getPositionAndNormal(out vec4 position, out vec3 normal) position.z = dot(p, matrixPalette3); position.w = p.w; -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n - vec3 n = vec4(a_normal, 0.0); +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n + vec4 n = vec4(a_normal, 0.0); normal.x = dot(n, matrixPalette1); normal.y = dot(n, matrixPalette2); normal.z = dot(n, matrixPalette3); @@ -130,18 +130,18 @@ void main() \n#if (CC_MAX_POINT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_POINT_LIGHT_NUM; ++i) { - v_vertexToPointLightDirection[i] = CC_PointLightSource[i].position.xyz- ePosition.xyz; + v_vertexToPointLightDirection[i] = CC_PointLightSourcePosition[i].xyz- ePosition.xyz; } \n#endif\n \n#if (CC_MAX_SPOT_LIGHT_NUM > 0)\n for (int i = 0; i < CC_MAX_SPOT_LIGHT_NUM; ++i) { - v_vertexToSpotLightDirection[i] = CC_SpotLightSource[i].position.xyz - ePosition.xyz; + v_vertexToSpotLightDirection[i] = CC_SpotLightSourcePosition[i] - ePosition.xyz; } \n#endif\n -\n#if (CC_MAX_DIRECTIONAL_LIGHT_NUM || CC_MAX_POINT_LIGHT_NUM || CC_MAX_SPOT_LIGHT_NUM)\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n v_normal = CC_NormalMatrix * normal; \n#endif\n diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 830f78b943..89585f73f2 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -78,7 +78,6 @@ Controller g_aTestNames[] = { { "Node: Spine", []() { return new SpineTestScene(); } }, { "Node: Sprite", [](){return new SpriteTestScene(); } }, { "Node: Sprite3D", [](){ return new Sprite3DTestScene(); }}, - { "Node: LightTest", [](){ return new LightTestScene(); }}, { "Node: TileMap", [](){return new TileMapTestScene(); } }, #if CC_TARGET_PLATFORM != CC_PLATFORM_WP8 { "Node: FastTileMap", [](){return new TileMapTestSceneNew(); } },