2020-10-13 17:17:30 +00:00
|
|
|
module.exports = [
|
|
|
|
'#define SHADER_NAME PHASER_POINTLIGHT_VS',
|
|
|
|
'',
|
|
|
|
'precision mediump float;',
|
|
|
|
'',
|
|
|
|
'uniform mat4 uProjectionMatrix;',
|
|
|
|
'',
|
|
|
|
'attribute vec2 inPosition;',
|
|
|
|
'attribute vec2 inLightPosition;',
|
|
|
|
'attribute vec4 inLightColor;',
|
|
|
|
'attribute float inLightRadius;',
|
2020-10-14 10:57:58 +00:00
|
|
|
'attribute float inLightIntensity;',
|
2020-10-13 17:17:30 +00:00
|
|
|
'',
|
2020-10-13 21:34:26 +00:00
|
|
|
'varying vec4 lightPosition;',
|
2020-10-13 17:17:30 +00:00
|
|
|
'varying vec4 lightColor;',
|
|
|
|
'varying float lightRadius;',
|
|
|
|
'',
|
|
|
|
'void main ()',
|
|
|
|
'{',
|
|
|
|
' lightColor = inLightColor;',
|
2020-10-13 21:34:26 +00:00
|
|
|
' lightRadius = inLightRadius;',
|
2020-10-29 14:37:52 +00:00
|
|
|
' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);',
|
2020-10-13 17:17:30 +00:00
|
|
|
'',
|
2020-10-29 14:37:52 +00:00
|
|
|
' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
|
2020-10-13 17:17:30 +00:00
|
|
|
'}',
|
|
|
|
''
|
|
|
|
].join('\n');
|