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-12-01 17:22:57 +00:00
|
|
|
'attribute float inLightAttenuation;',
|
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;',
|
2020-12-01 17:22:57 +00:00
|
|
|
'varying float lightAttenuation;',
|
2020-10-13 17:17:30 +00:00
|
|
|
'void main ()',
|
|
|
|
'{',
|
|
|
|
' lightColor = inLightColor;',
|
2020-10-13 21:34:26 +00:00
|
|
|
' lightRadius = inLightRadius;',
|
2020-12-01 17:22:57 +00:00
|
|
|
' lightAttenuation = inLightAttenuation;',
|
2020-10-29 14:37:52 +00:00
|
|
|
' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);',
|
|
|
|
' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
|
2020-10-13 17:17:30 +00:00
|
|
|
'}',
|
|
|
|
].join('\n');
|