Graphics shape fill added
shaders optimised - removed need for 4x4 matrix draw elipse added any shape can now be filled
This commit is contained in:
parent
2ad9002a79
commit
72e38cccb0
105 changed files with 20670 additions and 4633 deletions
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
<em>API Docs for: 1.3.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
|
@ -196,8 +196,10 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
|
||||
}
|
||||
|
||||
PIXI.WebGLGraphics.initShaders();
|
||||
this.initShaders();
|
||||
PIXI.initPrimitiveShader();
|
||||
PIXI.initDefaultShader();
|
||||
|
||||
PIXI.activateDefaultShader();
|
||||
|
||||
var gl = this.gl;
|
||||
PIXI.WebGLRenderer.gl = gl;
|
||||
|
|
@ -209,6 +211,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
gl.colorMask(true, true, true, this.transparent);
|
||||
|
||||
this.projectionMatrix = PIXI.mat4.create();
|
||||
|
||||
this.resize(this.width, this.height);
|
||||
this.contextLost = false;
|
||||
|
||||
|
|
@ -246,38 +249,7 @@ PIXI.WebGLRenderer.returnBatch = function(batch)
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.initShaders = function()
|
||||
{
|
||||
var gl = this.gl;
|
||||
var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
|
||||
var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
|
||||
|
||||
PIXI.shaderProgram = gl.createProgram();
|
||||
|
||||
var shaderProgram = PIXI.shaderProgram;
|
||||
|
||||
gl.attachShader(shaderProgram, vertexShader);
|
||||
gl.attachShader(shaderProgram, fragmentShader);
|
||||
gl.linkProgram(shaderProgram);
|
||||
|
||||
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
|
||||
alert("Could not initialise shaders");
|
||||
}
|
||||
|
||||
gl.useProgram(shaderProgram);
|
||||
|
||||
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
||||
|
||||
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
||||
|
||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||
|
||||
|
||||
shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
|
||||
shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
|
||||
|
||||
PIXI.activateDefaultShader();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue