Docs updated
example updated misplaced files removed
This commit is contained in:
parent
72e38cccb0
commit
e91be9b53a
100 changed files with 6387 additions and 12207 deletions
|
@ -49,6 +49,8 @@
|
|||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasGraphics.html">CanvasGraphics</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/CustomRenderable.html">CustomRenderable</a></li>
|
||||
|
@ -57,6 +59,8 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/Graphics.html">Graphics</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
@ -143,6 +147,11 @@
|
|||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* the default suoer fast shader!
|
||||
*/
|
||||
|
||||
PIXI.shaderFragmentSrc = [
|
||||
"precision mediump float;",
|
||||
"varying vec2 vTextureCoord;",
|
||||
|
@ -158,17 +167,41 @@ PIXI.shaderVertexSrc = [
|
|||
"attribute vec2 aVertexPosition;",
|
||||
"attribute vec2 aTextureCoord;",
|
||||
"attribute float aColor;",
|
||||
"uniform mat4 uMVMatrix;",
|
||||
//"uniform mat4 uMVMatrix;",
|
||||
"uniform vec2 projectionVector;",
|
||||
"varying vec2 vTextureCoord;",
|
||||
"varying float vColor;",
|
||||
"void main(void) {",
|
||||
"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
|
||||
// "gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
|
||||
"gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
||||
"vTextureCoord = aTextureCoord;",
|
||||
"vColor = aColor;",
|
||||
"}"
|
||||
];
|
||||
|
||||
/*
|
||||
* the triangle strip shader..
|
||||
*/
|
||||
PIXI.stripShaderVertexSrc = [
|
||||
"attribute vec2 aVertexPosition;",
|
||||
"attribute vec2 aTextureCoord;",
|
||||
"attribute float aColor;",
|
||||
"uniform mat3 translationMatrix;",
|
||||
"uniform vec2 projectionVector;",
|
||||
"varying vec2 vTextureCoord;",
|
||||
"varying float vColor;",
|
||||
"void main(void) {",
|
||||
"vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);",
|
||||
"gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
||||
"vTextureCoord = aTextureCoord;",
|
||||
"vColor = aColor;",
|
||||
"}"
|
||||
];
|
||||
|
||||
|
||||
/*
|
||||
* primitive shader..
|
||||
*/
|
||||
|
||||
PIXI.primitiveShaderFragmentSrc = [
|
||||
"precision mediump float;",
|
||||
|
@ -181,19 +214,16 @@ PIXI.primitiveShaderFragmentSrc = [
|
|||
PIXI.primitiveShaderVertexSrc = [
|
||||
"attribute vec2 aVertexPosition;",
|
||||
"attribute vec4 aColor;",
|
||||
"uniform mat3 translationMatrix;",
|
||||
"uniform vec2 projectionVector;",
|
||||
"varying vec4 vColor;",
|
||||
"void main(void) {",
|
||||
"gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
||||
"vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);",
|
||||
"gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
||||
"vColor = aColor;",
|
||||
"}"
|
||||
];
|
||||
|
||||
/*
|
||||
* primitive shader..
|
||||
*/
|
||||
|
||||
|
||||
PIXI.initPrimitiveShader = function()
|
||||
{
|
||||
var gl = PIXI.gl;
|
||||
|
@ -205,6 +235,7 @@ PIXI.initPrimitiveShader = function()
|
|||
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
||||
|
||||
PIXI.primitiveProgram = shaderProgram;
|
||||
}
|
||||
|
@ -217,6 +248,7 @@ PIXI.initDefaultShader = function()
|
|||
gl.useProgram(shaderProgram);
|
||||
|
||||
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||
|
||||
|
@ -226,6 +258,27 @@ PIXI.initDefaultShader = function()
|
|||
PIXI.shaderProgram = shaderProgram;
|
||||
}
|
||||
|
||||
PIXI.initDefaultStripShader = function()
|
||||
{
|
||||
var gl = this.gl;
|
||||
var shaderProgram = PIXI.compileProgram(PIXI.stripShaderVertexSrc, PIXI.shaderFragmentSrc)
|
||||
|
||||
gl.useProgram(shaderProgram);
|
||||
|
||||
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
||||
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
||||
|
||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||
|
||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||
|
||||
shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
|
||||
|
||||
PIXI.stripShaderProgram = shaderProgram;
|
||||
}
|
||||
|
||||
PIXI.CompileVertexShader = function(gl, shaderSrc)
|
||||
{
|
||||
return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue