phaser
Version:
A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.
23 lines (22 loc) • 598 B
JavaScript
module.exports = [
'uniform vec2 uMainResolution[TEXTURE_COUNT];',
'vec2 getTexRes ()',
'{',
' #if TEXTURE_COUNT == 1',
' float texId = 0.0;',
' #else',
' float texId = outTexDatum;',
' #endif',
' #pragma phaserTemplate(texIdProcess)',
' vec2 texRes = vec2(0.0);',
' for (int i = 0; i < TEXTURE_COUNT; i++)',
' {',
' if (texId == float(i))',
' {',
' texRes = uMainResolution[i];',
' break;',
' }',
' }',
' return texRes;',
'}',
].join('\n');