mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Shaders can be an array of strings
This commit is contained in:
parent
a93425ef0d
commit
d9570b1b0b
1 changed files with 18 additions and 4 deletions
|
@ -722,11 +722,25 @@ var WebGLPipeline = new Class({
|
|||
{
|
||||
var shaderEntry = configShaders[i];
|
||||
|
||||
var name = GetFastValue(shaderEntry, 'name', 'default');
|
||||
var name;
|
||||
var vertShader;
|
||||
var fragShader;
|
||||
var attributes;
|
||||
|
||||
var vertShader = GetFastValue(shaderEntry, vName, defaultVertShader);
|
||||
var fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures);
|
||||
var attributes = GetFastValue(shaderEntry, aName, defaultAttribs);
|
||||
if (typeof shaderEntry === 'string')
|
||||
{
|
||||
name = 'default';
|
||||
vertShader = defaultVertShader;
|
||||
fragShader = Utils.parseFragmentShaderMaxTextures(shaderEntry, renderer.maxTextures);
|
||||
attributes = defaultAttribs;
|
||||
}
|
||||
else
|
||||
{
|
||||
name = GetFastValue(shaderEntry, 'name', 'default');
|
||||
vertShader = GetFastValue(shaderEntry, vName, defaultVertShader);
|
||||
fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures);
|
||||
attributes = GetFastValue(shaderEntry, aName, defaultAttribs);
|
||||
}
|
||||
|
||||
if (name === 'default')
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue