mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 22:52:14 +00:00
If you add #define SHADER_NAME
to the start of your shader then it will be picked up as the WebGLShader
name during the setShadersFromConfig
process within WebGLPipeline
.
This commit is contained in:
parent
b40cc9b584
commit
e1391445fe
1 changed files with 11 additions and 0 deletions
|
@ -728,6 +728,17 @@ var WebGLPipeline = new Class({
|
|||
var fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures);
|
||||
var attributes = GetFastValue(shaderEntry, aName, defaultAttribs);
|
||||
|
||||
if (name === 'default')
|
||||
{
|
||||
var lines = fragShader.split('\n');
|
||||
var test = lines[0].trim();
|
||||
|
||||
if (test.indexOf('#define SHADER_NAME') > -1)
|
||||
{
|
||||
name = test.substring(20);
|
||||
}
|
||||
}
|
||||
|
||||
if (vertShader && fragShader)
|
||||
{
|
||||
newShaders.push(new WebGLShader(this, name, vertShader, fragShader, DeepCopy(attributes)));
|
||||
|
|
Loading…
Reference in a new issue