mirror of
https://github.com/photonstorm/phaser
synced 2024-12-26 04:53:38 +00:00
29 lines
849 B
JavaScript
29 lines
849 B
JavaScript
module.exports = [
|
|
'#define SHADER_NAME PHASER_MULTI_FS',
|
|
'#ifdef GL_FRAGMENT_PRECISION_HIGH',
|
|
'precision highp float;',
|
|
'#else',
|
|
'precision mediump float;',
|
|
'#endif',
|
|
'uniform sampler2D uMainSampler[%count%];',
|
|
'varying vec2 outTexCoord;',
|
|
'varying float outTexId;',
|
|
'varying float outTintEffect;',
|
|
'varying vec4 outTint;',
|
|
'void main ()',
|
|
'{',
|
|
' vec4 texture;',
|
|
' %forloop%',
|
|
' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);',
|
|
' vec4 color = texture * texel;',
|
|
' if (outTintEffect == 1.0)',
|
|
' {',
|
|
' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);',
|
|
' }',
|
|
' else if (outTintEffect == 2.0)',
|
|
' {',
|
|
' color = texel;',
|
|
' }',
|
|
' gl_FragColor = color;',
|
|
'}',
|
|
].join('\n');
|