phaser/src/renderer/webgl/shaders/PointLight-vert.js

28 lines
765 B
JavaScript
Raw Normal View History

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;',
'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;',
' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);',
2020-10-13 17:17:30 +00:00
'',
' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
2020-10-13 17:17:30 +00:00
'}',
''
].join('\n');