mirror of https://github.com/axmolengine/axmol.git
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
This commit is contained in:
parent
a888f42d7f
commit
d5dacd4f0e
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
);
|
||||
)";
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
|
@ -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
|
||||
);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
)";
|
||||
|
|
Loading…
Reference in New Issue