From d5dacd4f0eb5ff4e57f95e8abe321d3c97c3a920 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Wed, 2 Nov 2016 02:13:34 -0400 Subject: [PATCH] Use C++11 multiline string literal instead (#16765) * Undo pull request #16742 while keeping fixed indentation on ccShader_UI_Gray.frag * Removed unnecessary whitespace * Switched implementation to C++11 string literal Thanks to stevetranby for the suggestion --- cocos/renderer/ccShader_3D_Color.frag | 4 +-- cocos/renderer/ccShader_3D_ColorNormal.frag | 8 ++--- .../renderer/ccShader_3D_ColorNormalTex.frag | 8 ++--- cocos/renderer/ccShader_3D_ColorTex.frag | 4 +-- cocos/renderer/ccShader_3D_Particle.frag | 10 +++---- .../ccShader_3D_PositionNormalTex.vert | 22 +++++++------- cocos/renderer/ccShader_3D_Skybox.frag | 4 +-- cocos/renderer/ccShader_3D_Terrain.frag | 4 +-- cocos/renderer/ccShader_3D_Terrain.vert | 4 +-- cocos/renderer/ccShader_CameraClear.frag | 4 +-- cocos/renderer/ccShader_CameraClear.vert | 6 ++-- .../ccShader_ETC1AS_PositionTextureColor.frag | 6 ++-- .../ccShader_ETC1AS_PositionTextureGray.frag | 8 ++--- cocos/renderer/ccShader_Label.vert | 4 +-- cocos/renderer/ccShader_Label_df.frag | 30 +++++++++---------- cocos/renderer/ccShader_Label_df_glow.frag | 28 ++++++++--------- cocos/renderer/ccShader_Label_normal.frag | 4 +-- cocos/renderer/ccShader_Label_outline.frag | 14 ++++----- cocos/renderer/ccShader_PositionColor.frag | 4 +-- cocos/renderer/ccShader_PositionColor.vert | 4 +-- .../ccShader_PositionColorLengthTexture.frag | 10 +++---- .../ccShader_PositionColorLengthTexture.vert | 10 +++---- ...hader_PositionColorTextureAsPointsize.vert | 4 +-- cocos/renderer/ccShader_PositionTexture.frag | 4 +-- cocos/renderer/ccShader_PositionTexture.vert | 4 +-- .../ccShader_PositionTextureA8Color.frag | 4 +-- .../ccShader_PositionTextureA8Color.vert | 4 +-- .../ccShader_PositionTextureColor.frag | 4 +-- .../ccShader_PositionTextureColor.vert | 4 +-- ...cShader_PositionTextureColorAlphaTest.frag | 4 +-- .../ccShader_PositionTextureColor_noMVP.frag | 4 +-- .../ccShader_PositionTextureColor_noMVP.vert | 4 +-- .../ccShader_PositionTexture_uColor.frag | 4 +-- .../ccShader_PositionTexture_uColor.vert | 4 +-- cocos/renderer/ccShader_Position_uColor.frag | 4 +-- cocos/renderer/ccShader_Position_uColor.vert | 4 +-- cocos/renderer/ccShader_UI_Gray.frag | 6 ++-- 37 files changed, 131 insertions(+), 131 deletions(-) diff --git a/cocos/renderer/ccShader_3D_Color.frag b/cocos/renderer/ccShader_3D_Color.frag index 730d3d6689..822c106a86 100644 --- a/cocos/renderer/ccShader_3D_Color.frag +++ b/cocos/renderer/ccShader_3D_Color.frag @@ -1,5 +1,5 @@ -const char* cc3D_Color_frag = STRINGIFY( +const char* cc3D_Color_frag = R"( #ifdef GL_ES varying lowp vec4 DestinationColor; @@ -12,4 +12,4 @@ void main(void) { gl_FragColor = u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_3D_ColorNormal.frag b/cocos/renderer/ccShader_3D_ColorNormal.frag index 03acbe75d8..b17f22fd6b 100644 --- a/cocos/renderer/ccShader_3D_ColorNormal.frag +++ b/cocos/renderer/ccShader_3D_ColorNormal.frag @@ -1,5 +1,5 @@ -const char* cc3D_ColorNormal_frag = STRINGIFY( +const char* cc3D_ColorNormal_frag = R"( #if (MAX_DIRECTIONAL_LIGHT_NUM > 0) uniform vec3 u_DirLightSourceColor[MAX_DIRECTIONAL_LIGHT_NUM]; @@ -11,7 +11,7 @@ uniform float u_PointLightSourceRangeInverse[MAX_POINT_LIGHT_NUM]; #endif #if (MAX_SPOT_LIGHT_NUM > 0) uniform vec3 u_SpotLightSourceColor[MAX_SPOT_LIGHT_NUM]; -uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; +uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceInnerAngleCos[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceOuterAngleCos[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceRangeInverse[MAX_SPOT_LIGHT_NUM]; @@ -51,7 +51,7 @@ vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, fl { float diffuse = max(dot(normalVector, lightDirection), 0.0); vec3 diffuseColor = lightColor * diffuse * attenuation; - + return diffuseColor; } @@ -110,4 +110,4 @@ void main(void) #endif } -); +)"; diff --git a/cocos/renderer/ccShader_3D_ColorNormalTex.frag b/cocos/renderer/ccShader_3D_ColorNormalTex.frag index 7b0bdeaafd..72887763ca 100644 --- a/cocos/renderer/ccShader_3D_ColorNormalTex.frag +++ b/cocos/renderer/ccShader_3D_ColorNormalTex.frag @@ -1,5 +1,5 @@ -const char* cc3D_ColorNormalTex_frag = STRINGIFY( +const char* cc3D_ColorNormalTex_frag = R"( #if (MAX_DIRECTIONAL_LIGHT_NUM > 0) uniform vec3 u_DirLightSourceColor[MAX_DIRECTIONAL_LIGHT_NUM]; @@ -11,7 +11,7 @@ uniform float u_PointLightSourceRangeInverse[MAX_POINT_LIGHT_NUM]; #endif #if (MAX_SPOT_LIGHT_NUM > 0) uniform vec3 u_SpotLightSourceColor[MAX_SPOT_LIGHT_NUM]; -uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; +uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceInnerAngleCos[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceOuterAngleCos[MAX_SPOT_LIGHT_NUM]; uniform float u_SpotLightSourceRangeInverse[MAX_SPOT_LIGHT_NUM]; @@ -78,7 +78,7 @@ vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, fl { float diffuse = max(dot(normalVector, lightDirection), 0.0); vec3 diffuseColor = lightColor * diffuse * attenuation; - + return diffuseColor; } @@ -152,4 +152,4 @@ void main(void) #endif } -); +)"; diff --git a/cocos/renderer/ccShader_3D_ColorTex.frag b/cocos/renderer/ccShader_3D_ColorTex.frag index 21e76d21b1..d5e56f29c1 100644 --- a/cocos/renderer/ccShader_3D_ColorTex.frag +++ b/cocos/renderer/ccShader_3D_ColorTex.frag @@ -1,5 +1,5 @@ -const char* cc3D_ColorTex_frag = STRINGIFY( +const char* cc3D_ColorTex_frag = R"( #ifdef GL_ES varying mediump vec2 TextureCoordOut; @@ -12,4 +12,4 @@ void main(void) { gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_3D_Particle.frag b/cocos/renderer/ccShader_3D_Particle.frag index 9bc49535e7..4d03358cd6 100644 --- a/cocos/renderer/ccShader_3D_Particle.frag +++ b/cocos/renderer/ccShader_3D_Particle.frag @@ -1,5 +1,5 @@ -const char* cc3D_Particle_tex_frag = STRINGIFY( +const char* cc3D_Particle_tex_frag = R"( #ifdef GL_ES varying mediump vec2 TextureCoordOut; @@ -14,10 +14,10 @@ void main(void) { gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * ColorOut * u_color; } -); +)"; + +const char* cc3D_Particle_color_frag = R"( -const char* cc3D_Particle_color_frag = STRINGIFY( - #ifdef GL_ES varying mediump vec4 ColorOut; #else @@ -29,4 +29,4 @@ void main(void) { gl_FragColor = ColorOut * u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_3D_PositionNormalTex.vert b/cocos/renderer/ccShader_3D_PositionNormalTex.vert index 477722cb96..a330e07a3d 100644 --- a/cocos/renderer/ccShader_3D_PositionNormalTex.vert +++ b/cocos/renderer/ccShader_3D_PositionNormalTex.vert @@ -1,5 +1,5 @@ -const char* cc3D_PositionNormalTex_vert = STRINGIFY( +const char* cc3D_PositionNormalTex_vert = R"( #ifdef USE_NORMAL_MAPPING #if (MAX_DIRECTIONAL_LIGHT_NUM > 0) @@ -12,7 +12,7 @@ uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM]; #if (MAX_SPOT_LIGHT_NUM > 0) uniform vec3 u_SpotLightSourcePosition[MAX_SPOT_LIGHT_NUM]; #ifdef USE_NORMAL_MAPPING -uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; +uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; #endif #endif @@ -101,7 +101,7 @@ void main(void) v_vertexToSpotLightDirection[i] = u_SpotLightSourcePosition[i] - ePosition.xyz; } #endif - + #if ((MAX_DIRECTIONAL_LIGHT_NUM > 0) || (MAX_POINT_LIGHT_NUM > 0) || (MAX_SPOT_LIGHT_NUM > 0)) v_normal = CC_NormalMatrix * a_normal; #endif @@ -111,9 +111,9 @@ void main(void) TextureCoordOut.y = 1.0 - TextureCoordOut.y; gl_Position = CC_PMatrix * ePosition; } -); +)"; -const char* cc3D_SkinPositionNormalTex_vert = STRINGIFY( +const char* cc3D_SkinPositionNormalTex_vert = R"( #ifdef USE_NORMAL_MAPPING #if (MAX_DIRECTIONAL_LIGHT_NUM > 0) @@ -126,7 +126,7 @@ uniform vec3 u_PointLightSourcePosition[MAX_POINT_LIGHT_NUM]; #if (MAX_SPOT_LIGHT_NUM > 0) uniform vec3 u_SpotLightSourcePosition[MAX_SPOT_LIGHT_NUM]; #ifdef USE_NORMAL_MAPPING -uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; +uniform vec3 u_SpotLightSourceDirection[MAX_SPOT_LIGHT_NUM]; #endif #endif @@ -179,8 +179,8 @@ void getPositionAndNormal(out vec4 position, out vec3 normal, out vec3 tangent, vec4 matrixPalette1 = u_matrixPalette[matrixIndex] * blendWeight; vec4 matrixPalette2 = u_matrixPalette[matrixIndex + 1] * blendWeight; vec4 matrixPalette3 = u_matrixPalette[matrixIndex + 2] * blendWeight; - - + + blendWeight = a_blendWeight[1]; if (blendWeight > 0.0) { @@ -188,7 +188,7 @@ void getPositionAndNormal(out vec4 position, out vec3 normal, out vec3 tangent, matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight; matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight; matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight; - + blendWeight = a_blendWeight[2]; if (blendWeight > 0.0) { @@ -196,7 +196,7 @@ void getPositionAndNormal(out vec4 position, out vec3 normal, out vec3 tangent, matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight; matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight; matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight; - + blendWeight = a_blendWeight[3]; if (blendWeight > 0.0) { @@ -305,4 +305,4 @@ void main() gl_Position = CC_PMatrix * ePosition; } -); \ No newline at end of file +)"; \ No newline at end of file diff --git a/cocos/renderer/ccShader_3D_Skybox.frag b/cocos/renderer/ccShader_3D_Skybox.frag index f3d5799011..8ee4fc9e89 100644 --- a/cocos/renderer/ccShader_3D_Skybox.frag +++ b/cocos/renderer/ccShader_3D_Skybox.frag @@ -1,4 +1,4 @@ -const char* cc3D_Skybox_frag = STRINGIFY( +const char* cc3D_Skybox_frag = R"( #ifdef GL_ES varying mediump vec3 v_reflect; #else @@ -11,4 +11,4 @@ void main(void) { gl_FragColor = textureCube(u_Env, v_reflect) * u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_3D_Terrain.frag b/cocos/renderer/ccShader_3D_Terrain.frag index 83c7bc351d..7cf7373f60 100644 --- a/cocos/renderer/ccShader_3D_Terrain.frag +++ b/cocos/renderer/ccShader_3D_Terrain.frag @@ -1,5 +1,5 @@ -const char* cc3D_Terrain_frag = STRINGIFY( +const char* cc3D_Terrain_frag = R"( #ifdef GL_ES precision mediump float; #endif @@ -45,4 +45,4 @@ if(u_has_alpha<=0) gl_FragColor = vec4(color.rgb*lightColor.rgb*lightFactor, 1.0); } } -); +)"; diff --git a/cocos/renderer/ccShader_3D_Terrain.vert b/cocos/renderer/ccShader_3D_Terrain.vert index d0d62ae782..20c4eb27bd 100644 --- a/cocos/renderer/ccShader_3D_Terrain.vert +++ b/cocos/renderer/ccShader_3D_Terrain.vert @@ -1,5 +1,5 @@ -const char* cc3D_Terrain_vert = STRINGIFY( +const char* cc3D_Terrain_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; attribute vec3 a_normal; @@ -16,4 +16,4 @@ void main() v_texCoord = a_texCoord; v_normal = a_normal; } -); +)"; diff --git a/cocos/renderer/ccShader_CameraClear.frag b/cocos/renderer/ccShader_CameraClear.frag index f1791395cf..4b64c77e27 100644 --- a/cocos/renderer/ccShader_CameraClear.frag +++ b/cocos/renderer/ccShader_CameraClear.frag @@ -1,5 +1,5 @@ -const char* ccCameraClearFrag = STRINGIFY( +const char* ccCameraClearFrag = R"( #ifdef GL_ES varying mediump vec2 v_texCoord; @@ -12,4 +12,4 @@ void main() { gl_FragColor = vec4(v_color, 1.0); } -); +)"; diff --git a/cocos/renderer/ccShader_CameraClear.vert b/cocos/renderer/ccShader_CameraClear.vert index b9fef806a9..d16887e2dc 100644 --- a/cocos/renderer/ccShader_CameraClear.vert +++ b/cocos/renderer/ccShader_CameraClear.vert @@ -1,6 +1,6 @@ -const char* ccCameraClearVert = STRINGIFY( - +const char* ccCameraClearVert = R"( + uniform float depth; attribute vec4 a_position; @@ -21,4 +21,4 @@ void main() v_texCoord = a_texCoord; v_color = a_color; } -); +)"; diff --git a/cocos/renderer/ccShader_ETC1AS_PositionTextureColor.frag b/cocos/renderer/ccShader_ETC1AS_PositionTextureColor.frag index 1cdb878ccf..774fbb8e3b 100644 --- a/cocos/renderer/ccShader_ETC1AS_PositionTextureColor.frag +++ b/cocos/renderer/ccShader_ETC1AS_PositionTextureColor.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccETC1ASPositionTextureColor_frag = STRINGIFY( +const char* ccETC1ASPositionTextureColor_frag = R"( #ifdef GL_ES precision mediump float; #endif @@ -35,7 +35,7 @@ void main() { vec4 texColor = vec4(texture2D(CC_Texture0, v_texCoord).rgb, texture2D(CC_Texture1, v_texCoord).r); texColor.rgb *= texColor.a; // Premultiply with Alpha channel - + gl_FragColor = v_fragmentColor * texColor; } -); +)"; diff --git a/cocos/renderer/ccShader_ETC1AS_PositionTextureGray.frag b/cocos/renderer/ccShader_ETC1AS_PositionTextureGray.frag index 53cad35a5a..319a5b8bde 100644 --- a/cocos/renderer/ccShader_ETC1AS_PositionTextureGray.frag +++ b/cocos/renderer/ccShader_ETC1AS_PositionTextureGray.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccETC1ASPositionTextureGray_frag = STRINGIFY( +const char* ccETC1ASPositionTextureGray_frag = R"( #ifdef GL_ES precision mediump float; #endif @@ -36,10 +36,10 @@ void main() vec4 texColor = texture2D(CC_Texture0, v_texCoord); texColor.a = texture2D(CC_Texture1, v_texCoord).r; texColor.rgb *= texColor.a; // premultiply alpha channel - + texColor = v_fragmentColor * texColor; - + gl_FragColor.rgb = vec3(0.2126*texColor.r + 0.7152*texColor.g + 0.0722*texColor.b); gl_FragColor.a = texColor.a; } -); +)"; diff --git a/cocos/renderer/ccShader_Label.vert b/cocos/renderer/ccShader_Label.vert index 02b3790504..cb2bba5b56 100644 --- a/cocos/renderer/ccShader_Label.vert +++ b/cocos/renderer/ccShader_Label.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccLabel_vert = STRINGIFY( +const char* ccLabel_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; @@ -43,4 +43,4 @@ void main() v_fragmentColor = a_color; v_texCoord = a_texCoord; } -); +)"; diff --git a/cocos/renderer/ccShader_Label_df.frag b/cocos/renderer/ccShader_Label_df.frag index e7e2955e0d..83c66bf769 100644 --- a/cocos/renderer/ccShader_Label_df.frag +++ b/cocos/renderer/ccShader_Label_df.frag @@ -1,26 +1,26 @@ -const char* ccLabelDistanceFieldNormal_frag = STRINGIFY( +const char* ccLabelDistanceFieldNormal_frag = R"( #ifdef GL_ES -precision lowp float; +precision lowp float; #endif - -varying vec4 v_fragmentColor; + +varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec4 u_textColor; - -void main() + +void main() { vec4 color = texture2D(CC_Texture0, v_texCoord); - //the texture use dual channel 16-bit output for distance_map - //float dist = color.b+color.g/256.0; - // the texture use single channel 8-bit output for distance_map - float dist = color.a; - //TODO: Implementation 'fwidth' for glsl 1.0 - //float width = fwidth(dist); + //the texture use dual channel 16-bit output for distance_map + //float dist = color.b+color.g/256.0; + // the texture use single channel 8-bit output for distance_map + float dist = color.a; + //TODO: Implementation 'fwidth' for glsl 1.0 + //float width = fwidth(dist); //assign width for constant will lead to a little bit fuzzy,it's temporary measure. - float width = 0.04; - float alpha = smoothstep(0.5-width, 0.5+width, dist) * u_textColor.a; + float width = 0.04; + float alpha = smoothstep(0.5-width, 0.5+width, dist) * u_textColor.a; gl_FragColor = v_fragmentColor * vec4(u_textColor.rgb,alpha); } -); +)"; diff --git a/cocos/renderer/ccShader_Label_df_glow.frag b/cocos/renderer/ccShader_Label_df_glow.frag index 2cd1a019dd..d31610957a 100644 --- a/cocos/renderer/ccShader_Label_df_glow.frag +++ b/cocos/renderer/ccShader_Label_df_glow.frag @@ -1,26 +1,26 @@ -const char* ccLabelDistanceFieldGlow_frag = STRINGIFY( +const char* ccLabelDistanceFieldGlow_frag = R"( #ifdef GL_ES -precision lowp float; +precision lowp float; #endif - -varying vec4 v_fragmentColor; + +varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec4 u_effectColor; uniform vec4 u_textColor; - -void main() + +void main() { float dist = texture2D(CC_Texture0, v_texCoord).a; - //TODO: Implementation 'fwidth' for glsl 1.0 - //float width = fwidth(dist); + //TODO: Implementation 'fwidth' for glsl 1.0 + //float width = fwidth(dist); //assign width for constant will lead to a little bit fuzzy,it's temporary measure. - float width = 0.04; - float alpha = smoothstep(0.5-width, 0.5+width, dist); - //glow - float mu = smoothstep(0.5, 1.0, sqrt(dist)); + float width = 0.04; + float alpha = smoothstep(0.5-width, 0.5+width, dist); + //glow + float mu = smoothstep(0.5, 1.0, sqrt(dist)); vec4 color = u_effectColor*(1.0-alpha) + u_textColor*alpha; - gl_FragColor = v_fragmentColor * vec4(color.rgb, max(alpha,mu)*color.a); + gl_FragColor = v_fragmentColor * vec4(color.rgb, max(alpha,mu)*color.a); } -); +)"; diff --git a/cocos/renderer/ccShader_Label_normal.frag b/cocos/renderer/ccShader_Label_normal.frag index be282b1e67..5fbf4e8295 100644 --- a/cocos/renderer/ccShader_Label_normal.frag +++ b/cocos/renderer/ccShader_Label_normal.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccLabelNormal_frag = STRINGIFY( +const char* ccLabelNormal_frag = R"( #ifdef GL_ES precision lowp float; #endif @@ -39,4 +39,4 @@ void main() u_textColor.a * texture2D(CC_Texture0, v_texCoord).a// A from texture & uniform ); } -); +)"; diff --git a/cocos/renderer/ccShader_Label_outline.frag b/cocos/renderer/ccShader_Label_outline.frag index 9c31224238..508dbe63ed 100644 --- a/cocos/renderer/ccShader_Label_outline.frag +++ b/cocos/renderer/ccShader_Label_outline.frag @@ -1,21 +1,21 @@ /* * LICENSE ??? */ -const char* ccLabelOutline_frag = STRINGIFY( +const char* ccLabelOutline_frag = R"( #ifdef GL_ES -precision lowp float; +precision lowp float; #endif - -varying vec4 v_fragmentColor; + +varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec4 u_effectColor; uniform vec4 u_textColor; - + void main() { vec4 sample = texture2D(CC_Texture0, v_texCoord); - float fontAlpha = sample.a; // sample.a == 1 indicates text, a == 0 indicates outline + float fontAlpha = sample.a; // sample.a == 1 indicates text, a == 0 indicates outline float outlineAlpha = sample.r; // sample.r always > 0 if (u_effectColor.a > 0.0) // draw outline @@ -40,4 +40,4 @@ void main() discard; } } -); +)"; diff --git a/cocos/renderer/ccShader_PositionColor.frag b/cocos/renderer/ccShader_PositionColor.frag index a42854f1fb..0d0e8b4c0f 100644 --- a/cocos/renderer/ccShader_PositionColor.frag +++ b/cocos/renderer/ccShader_PositionColor.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionColor_frag = STRINGIFY( +const char* ccPositionColor_frag = R"( #ifdef GL_ES precision lowp float; @@ -35,4 +35,4 @@ void main() { gl_FragColor = v_fragmentColor; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionColor.vert b/cocos/renderer/ccShader_PositionColor.vert index fd1694df4e..784ad1058f 100644 --- a/cocos/renderer/ccShader_PositionColor.vert +++ b/cocos/renderer/ccShader_PositionColor.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionColor_vert = STRINGIFY( +const char* ccPositionColor_vert = R"( attribute vec4 a_position; attribute vec4 a_color; @@ -39,4 +39,4 @@ void main() gl_Position = CC_MVPMatrix * a_position; v_fragmentColor = a_color; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionColorLengthTexture.frag b/cocos/renderer/ccShader_PositionColorLengthTexture.frag index e47ebf20c3..4b284f44e3 100644 --- a/cocos/renderer/ccShader_PositionColorLengthTexture.frag +++ b/cocos/renderer/ccShader_PositionColorLengthTexture.frag @@ -1,15 +1,15 @@ /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,7 +19,7 @@ * SOFTWARE. */ -const char* ccPositionColorLengthTexture_frag = STRINGIFY( +const char* ccPositionColorLengthTexture_frag = R"( #ifdef GL_ES // #extension GL_OES_standard_derivatives : enable @@ -39,4 +39,4 @@ void main() gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord)); // #endif } -); +)"; diff --git a/cocos/renderer/ccShader_PositionColorLengthTexture.vert b/cocos/renderer/ccShader_PositionColorLengthTexture.vert index 63216b6dc9..6b1d4cbd2d 100644 --- a/cocos/renderer/ccShader_PositionColorLengthTexture.vert +++ b/cocos/renderer/ccShader_PositionColorLengthTexture.vert @@ -1,15 +1,15 @@ /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,7 +19,7 @@ * SOFTWARE. */ -const char* ccPositionColorLengthTexture_vert = STRINGIFY( +const char* ccPositionColorLengthTexture_vert = R"( #ifdef GL_ES attribute mediump vec4 a_position; @@ -47,4 +47,4 @@ void main() gl_Position = CC_MVPMatrix * a_position; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionColorTextureAsPointsize.vert b/cocos/renderer/ccShader_PositionColorTextureAsPointsize.vert index fec5e55cf3..9deb234761 100644 --- a/cocos/renderer/ccShader_PositionColorTextureAsPointsize.vert +++ b/cocos/renderer/ccShader_PositionColorTextureAsPointsize.vert @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -const char* ccPositionColorTextureAsPointsize_vert = STRINGIFY( +const char* ccPositionColorTextureAsPointsize_vert = R"( attribute vec4 a_position; attribute vec4 a_color; @@ -41,4 +41,4 @@ void main() gl_PointSize = a_texCoord.x; v_fragmentColor = a_color; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTexture.frag b/cocos/renderer/ccShader_PositionTexture.frag index cb5fc2e4a2..57de69389b 100644 --- a/cocos/renderer/ccShader_PositionTexture.frag +++ b/cocos/renderer/ccShader_PositionTexture.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTexture_frag = STRINGIFY( +const char* ccPositionTexture_frag = R"( #ifdef GL_ES precision lowp float; @@ -35,4 +35,4 @@ void main() { gl_FragColor = texture2D(CC_Texture0, v_texCoord); } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTexture.vert b/cocos/renderer/ccShader_PositionTexture.vert index 288e860505..73111f72e9 100644 --- a/cocos/renderer/ccShader_PositionTexture.vert +++ b/cocos/renderer/ccShader_PositionTexture.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTexture_vert = STRINGIFY( +const char* ccPositionTexture_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; @@ -39,4 +39,4 @@ void main() gl_Position = CC_MVPMatrix * a_position; v_texCoord = a_texCoord; } -); \ No newline at end of file +)"; \ No newline at end of file diff --git a/cocos/renderer/ccShader_PositionTextureA8Color.frag b/cocos/renderer/ccShader_PositionTextureA8Color.frag index 54db791433..496abc8d65 100644 --- a/cocos/renderer/ccShader_PositionTextureA8Color.frag +++ b/cocos/renderer/ccShader_PositionTextureA8Color.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureA8Color_frag = STRINGIFY( +const char* ccPositionTextureA8Color_frag = R"( #ifdef GL_ES precision lowp float; @@ -38,4 +38,4 @@ void main() v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a // A from texture & uniform ); } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureA8Color.vert b/cocos/renderer/ccShader_PositionTextureA8Color.vert index a4d8a833d1..3f533fbb30 100644 --- a/cocos/renderer/ccShader_PositionTextureA8Color.vert +++ b/cocos/renderer/ccShader_PositionTextureA8Color.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureA8Color_vert = STRINGIFY( +const char* ccPositionTextureA8Color_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; @@ -43,4 +43,4 @@ void main() v_fragmentColor = a_color; v_texCoord = a_texCoord; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureColor.frag b/cocos/renderer/ccShader_PositionTextureColor.frag index 7c21532a2e..94f0eea40f 100644 --- a/cocos/renderer/ccShader_PositionTextureColor.frag +++ b/cocos/renderer/ccShader_PositionTextureColor.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureColor_frag = STRINGIFY( +const char* ccPositionTextureColor_frag = R"( #ifdef GL_ES precision lowp float; #endif @@ -35,4 +35,4 @@ void main() { gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureColor.vert b/cocos/renderer/ccShader_PositionTextureColor.vert index 1c3128eece..08d7941c63 100644 --- a/cocos/renderer/ccShader_PositionTextureColor.vert +++ b/cocos/renderer/ccShader_PositionTextureColor.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureColor_vert = STRINGIFY( +const char* ccPositionTextureColor_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; attribute vec4 a_color; @@ -42,5 +42,5 @@ void main() v_fragmentColor = a_color; v_texCoord = a_texCoord; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag b/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag index d0013740c8..462e551b9b 100644 --- a/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag +++ b/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureColorAlphaTest_frag = STRINGIFY( +const char* ccPositionTextureColorAlphaTest_frag = R"( #ifdef GL_ES precision lowp float; @@ -44,4 +44,4 @@ void main() gl_FragColor = texColor * v_fragmentColor; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag b/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag index 509e0fbefc..b3f48f7e23 100644 --- a/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag +++ b/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureColor_noMVP_frag = STRINGIFY( +const char* ccPositionTextureColor_noMVP_frag = R"( #ifdef GL_ES precision lowp float; #endif @@ -35,5 +35,5 @@ void main() { gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTextureColor_noMVP.vert b/cocos/renderer/ccShader_PositionTextureColor_noMVP.vert index 9b5a226c1c..65d325036c 100644 --- a/cocos/renderer/ccShader_PositionTextureColor_noMVP.vert +++ b/cocos/renderer/ccShader_PositionTextureColor_noMVP.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTextureColor_noMVP_vert = STRINGIFY( +const char* ccPositionTextureColor_noMVP_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; attribute vec4 a_color; @@ -42,4 +42,4 @@ void main() v_fragmentColor = a_color; v_texCoord = a_texCoord; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTexture_uColor.frag b/cocos/renderer/ccShader_PositionTexture_uColor.frag index aac5dda957..343b46afa2 100644 --- a/cocos/renderer/ccShader_PositionTexture_uColor.frag +++ b/cocos/renderer/ccShader_PositionTexture_uColor.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTexture_uColor_frag = STRINGIFY( +const char* ccPositionTexture_uColor_frag = R"( #ifdef GL_ES precision lowp float; @@ -37,4 +37,4 @@ void main() { gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_PositionTexture_uColor.vert b/cocos/renderer/ccShader_PositionTexture_uColor.vert index d24fbd61f8..29dad9c334 100644 --- a/cocos/renderer/ccShader_PositionTexture_uColor.vert +++ b/cocos/renderer/ccShader_PositionTexture_uColor.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPositionTexture_uColor_vert = STRINGIFY( +const char* ccPositionTexture_uColor_vert = R"( attribute vec4 a_position; attribute vec2 a_texCoord; @@ -39,4 +39,4 @@ void main() gl_Position = CC_MVPMatrix * a_position; v_texCoord = a_texCoord; } -); +)"; diff --git a/cocos/renderer/ccShader_Position_uColor.frag b/cocos/renderer/ccShader_Position_uColor.frag index 268e36ec7d..3537fa0a0b 100644 --- a/cocos/renderer/ccShader_Position_uColor.frag +++ b/cocos/renderer/ccShader_Position_uColor.frag @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPosition_uColor_frag = STRINGIFY( +const char* ccPosition_uColor_frag = R"( #ifdef GL_ES precision lowp float; @@ -35,4 +35,4 @@ void main() { gl_FragColor = v_fragmentColor; } -); +)"; diff --git a/cocos/renderer/ccShader_Position_uColor.vert b/cocos/renderer/ccShader_Position_uColor.vert index 63301dc1b6..43cd974245 100644 --- a/cocos/renderer/ccShader_Position_uColor.vert +++ b/cocos/renderer/ccShader_Position_uColor.vert @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -const char* ccPosition_uColor_vert = STRINGIFY( +const char* ccPosition_uColor_vert = R"( attribute vec4 a_position; uniform vec4 u_color; @@ -41,4 +41,4 @@ void main() gl_PointSize = u_pointSize; v_fragmentColor = u_color; } -); +)"; diff --git a/cocos/renderer/ccShader_UI_Gray.frag b/cocos/renderer/ccShader_UI_Gray.frag index 7643b5d079..01d5b32e32 100644 --- a/cocos/renderer/ccShader_UI_Gray.frag +++ b/cocos/renderer/ccShader_UI_Gray.frag @@ -1,4 +1,4 @@ -const char* ccPositionTexture_GrayScale_frag = STRINGIFY( +const char* ccPositionTexture_GrayScale_frag = R"( #ifdef GL_ES precision mediump float; @@ -10,8 +10,8 @@ varying vec2 v_texCoord; void main(void) { vec4 c = texture2D(CC_Texture0, v_texCoord); - c = v_fragmentColor * c; + c = v_fragmentColor * c; gl_FragColor.xyz = vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b); gl_FragColor.w = c.w; } -); +)";