From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- assets/images/BasePlatformA01_AO.png | Bin assets/images/BasePlatformA01_DM.png | Bin assets/images/BoxA01_AO.png | Bin assets/images/BoxA01_DM.png | Bin assets/images/BoxB2_AO.png | Bin assets/images/BoxB2_DM.png | Bin assets/images/Grunge.png | Bin assets/images/LabelFrame.tga | Bin assets/images/MArmBaseN_DM.png | Bin assets/images/MArmBaseN_NM.png | Bin assets/images/MArmTopN_DM.png | Bin assets/images/MArmTopN_NM.png | Bin assets/images/MArm_AO.png | Bin assets/images/MBaseWallA01_AO.png | Bin assets/images/MBaseWallA01_DM.png | Bin assets/images/MBaseWallA01_GM.png | Bin assets/images/MBase_AO.png | Bin assets/images/MCoreBase_DM.png | Bin assets/images/MCoreBase_GM.png | Bin assets/images/MEjectorBaseN_DM.png | Bin assets/images/MEjectorBaseN_NM.png | Bin assets/images/MRingBaseN_DM.png | Bin assets/images/MRingBaseN_NM.png | Bin assets/images/MSquareBaseN_DM.png | Bin assets/images/MWall_AO.png | Bin assets/images/MWall_DM.png | Bin assets/images/MWall_GM.png | Bin assets/images/MWall_NM.png | Bin assets/images/Ref.png | Bin assets/images/Spec.png | Bin assets/images/Thumbs.db | Bin assets/images/black.png | Bin assets/images/black.tga | Bin assets/images/blue.png | Bin assets/images/cube.png | Bin assets/images/cubelight.png | Bin assets/images/cubelight_Glow.png | Bin assets/images/cubelight_spec.png | Bin assets/images/default_white.png | Bin assets/images/droid.png | Bin assets/images/env.png | Bin assets/images/femaleRobot.png | Bin assets/images/femaleRobot_Glow.png | Bin assets/images/grey.png | Bin assets/images/irredecentENV.png | Bin assets/images/lightRack.png | Bin assets/images/lightRack_Glow.png | Bin assets/images/material_paint.png | Bin assets/images/metal.png | Bin assets/images/normalMap.png | Bin assets/images/particle-star.png | Bin assets/images/quilt01.png | Bin assets/images/quilt01_E.png | Bin assets/images/quilt01_N.png | Bin assets/images/quilt02.png | Bin assets/images/quilt02_E.png | Bin assets/images/quilt02_N.png | Bin assets/images/random_normal.png | Bin assets/images/rocky-diffuse.jpg | Bin assets/images/rocky-normal.jpg | Bin assets/images/rocky-spec.jpg | Bin assets/images/scales_normal.png | Bin assets/images/silver.png | Bin assets/images/stitchStroke.png | Bin assets/images/stitchStroke_N.png | Bin assets/images/white.png | Bin assets/images/white.tga | Bin assets/shaders/Basic.vert.glsl | 0 assets/shaders/linearGradient.frag.glsl | 0 assets/shaders/linearGradient.vert.glsl | 0 assets/shaders/test_fshader.glsl | 0 assets/shaders/test_fshader_full.glsl | 0 assets/shaders/test_vshader.glsl | 0 assets/shaders/ub_fshader.glsl | 0 assets/shaders/ub_vshader.glsl | 0 75 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 assets/images/BasePlatformA01_AO.png mode change 100644 => 100755 assets/images/BasePlatformA01_DM.png mode change 100644 => 100755 assets/images/BoxA01_AO.png mode change 100644 => 100755 assets/images/BoxA01_DM.png mode change 100644 => 100755 assets/images/BoxB2_AO.png mode change 100644 => 100755 assets/images/BoxB2_DM.png mode change 100644 => 100755 assets/images/Grunge.png mode change 100644 => 100755 assets/images/LabelFrame.tga mode change 100644 => 100755 assets/images/MArmBaseN_DM.png mode change 100644 => 100755 assets/images/MArmBaseN_NM.png mode change 100644 => 100755 assets/images/MArmTopN_DM.png mode change 100644 => 100755 assets/images/MArmTopN_NM.png mode change 100644 => 100755 assets/images/MArm_AO.png mode change 100644 => 100755 assets/images/MBaseWallA01_AO.png mode change 100644 => 100755 assets/images/MBaseWallA01_DM.png mode change 100644 => 100755 assets/images/MBaseWallA01_GM.png mode change 100644 => 100755 assets/images/MBase_AO.png mode change 100644 => 100755 assets/images/MCoreBase_DM.png mode change 100644 => 100755 assets/images/MCoreBase_GM.png mode change 100644 => 100755 assets/images/MEjectorBaseN_DM.png mode change 100644 => 100755 assets/images/MEjectorBaseN_NM.png mode change 100644 => 100755 assets/images/MRingBaseN_DM.png mode change 100644 => 100755 assets/images/MRingBaseN_NM.png mode change 100644 => 100755 assets/images/MSquareBaseN_DM.png mode change 100644 => 100755 assets/images/MWall_AO.png mode change 100644 => 100755 assets/images/MWall_DM.png mode change 100644 => 100755 assets/images/MWall_GM.png mode change 100644 => 100755 assets/images/MWall_NM.png mode change 100644 => 100755 assets/images/Ref.png mode change 100644 => 100755 assets/images/Spec.png mode change 100644 => 100755 assets/images/Thumbs.db mode change 100644 => 100755 assets/images/black.png mode change 100644 => 100755 assets/images/black.tga mode change 100644 => 100755 assets/images/blue.png mode change 100644 => 100755 assets/images/cube.png mode change 100644 => 100755 assets/images/cubelight.png mode change 100644 => 100755 assets/images/cubelight_Glow.png mode change 100644 => 100755 assets/images/cubelight_spec.png mode change 100644 => 100755 assets/images/default_white.png mode change 100644 => 100755 assets/images/droid.png mode change 100644 => 100755 assets/images/env.png mode change 100644 => 100755 assets/images/femaleRobot.png mode change 100644 => 100755 assets/images/femaleRobot_Glow.png mode change 100644 => 100755 assets/images/grey.png mode change 100644 => 100755 assets/images/irredecentENV.png mode change 100644 => 100755 assets/images/lightRack.png mode change 100644 => 100755 assets/images/lightRack_Glow.png mode change 100644 => 100755 assets/images/material_paint.png mode change 100644 => 100755 assets/images/metal.png mode change 100644 => 100755 assets/images/normalMap.png mode change 100644 => 100755 assets/images/particle-star.png mode change 100644 => 100755 assets/images/quilt01.png mode change 100644 => 100755 assets/images/quilt01_E.png mode change 100644 => 100755 assets/images/quilt01_N.png mode change 100644 => 100755 assets/images/quilt02.png mode change 100644 => 100755 assets/images/quilt02_E.png mode change 100644 => 100755 assets/images/quilt02_N.png mode change 100644 => 100755 assets/images/random_normal.png mode change 100644 => 100755 assets/images/rocky-diffuse.jpg mode change 100644 => 100755 assets/images/rocky-normal.jpg mode change 100644 => 100755 assets/images/rocky-spec.jpg mode change 100644 => 100755 assets/images/scales_normal.png mode change 100644 => 100755 assets/images/silver.png mode change 100644 => 100755 assets/images/stitchStroke.png mode change 100644 => 100755 assets/images/stitchStroke_N.png mode change 100644 => 100755 assets/images/white.png mode change 100644 => 100755 assets/images/white.tga mode change 100644 => 100755 assets/shaders/Basic.vert.glsl mode change 100644 => 100755 assets/shaders/linearGradient.frag.glsl mode change 100644 => 100755 assets/shaders/linearGradient.vert.glsl mode change 100644 => 100755 assets/shaders/test_fshader.glsl mode change 100644 => 100755 assets/shaders/test_fshader_full.glsl mode change 100644 => 100755 assets/shaders/test_vshader.glsl mode change 100644 => 100755 assets/shaders/ub_fshader.glsl mode change 100644 => 100755 assets/shaders/ub_vshader.glsl (limited to 'assets') diff --git a/assets/images/BasePlatformA01_AO.png b/assets/images/BasePlatformA01_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/BasePlatformA01_DM.png b/assets/images/BasePlatformA01_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/BoxA01_AO.png b/assets/images/BoxA01_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/BoxA01_DM.png b/assets/images/BoxA01_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/BoxB2_AO.png b/assets/images/BoxB2_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/BoxB2_DM.png b/assets/images/BoxB2_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/Grunge.png b/assets/images/Grunge.png old mode 100644 new mode 100755 diff --git a/assets/images/LabelFrame.tga b/assets/images/LabelFrame.tga old mode 100644 new mode 100755 diff --git a/assets/images/MArmBaseN_DM.png b/assets/images/MArmBaseN_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MArmBaseN_NM.png b/assets/images/MArmBaseN_NM.png old mode 100644 new mode 100755 diff --git a/assets/images/MArmTopN_DM.png b/assets/images/MArmTopN_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MArmTopN_NM.png b/assets/images/MArmTopN_NM.png old mode 100644 new mode 100755 diff --git a/assets/images/MArm_AO.png b/assets/images/MArm_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/MBaseWallA01_AO.png b/assets/images/MBaseWallA01_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/MBaseWallA01_DM.png b/assets/images/MBaseWallA01_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MBaseWallA01_GM.png b/assets/images/MBaseWallA01_GM.png old mode 100644 new mode 100755 diff --git a/assets/images/MBase_AO.png b/assets/images/MBase_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/MCoreBase_DM.png b/assets/images/MCoreBase_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MCoreBase_GM.png b/assets/images/MCoreBase_GM.png old mode 100644 new mode 100755 diff --git a/assets/images/MEjectorBaseN_DM.png b/assets/images/MEjectorBaseN_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MEjectorBaseN_NM.png b/assets/images/MEjectorBaseN_NM.png old mode 100644 new mode 100755 diff --git a/assets/images/MRingBaseN_DM.png b/assets/images/MRingBaseN_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MRingBaseN_NM.png b/assets/images/MRingBaseN_NM.png old mode 100644 new mode 100755 diff --git a/assets/images/MSquareBaseN_DM.png b/assets/images/MSquareBaseN_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MWall_AO.png b/assets/images/MWall_AO.png old mode 100644 new mode 100755 diff --git a/assets/images/MWall_DM.png b/assets/images/MWall_DM.png old mode 100644 new mode 100755 diff --git a/assets/images/MWall_GM.png b/assets/images/MWall_GM.png old mode 100644 new mode 100755 diff --git a/assets/images/MWall_NM.png b/assets/images/MWall_NM.png old mode 100644 new mode 100755 diff --git a/assets/images/Ref.png b/assets/images/Ref.png old mode 100644 new mode 100755 diff --git a/assets/images/Spec.png b/assets/images/Spec.png old mode 100644 new mode 100755 diff --git a/assets/images/Thumbs.db b/assets/images/Thumbs.db old mode 100644 new mode 100755 diff --git a/assets/images/black.png b/assets/images/black.png old mode 100644 new mode 100755 diff --git a/assets/images/black.tga b/assets/images/black.tga old mode 100644 new mode 100755 diff --git a/assets/images/blue.png b/assets/images/blue.png old mode 100644 new mode 100755 diff --git a/assets/images/cube.png b/assets/images/cube.png old mode 100644 new mode 100755 diff --git a/assets/images/cubelight.png b/assets/images/cubelight.png old mode 100644 new mode 100755 diff --git a/assets/images/cubelight_Glow.png b/assets/images/cubelight_Glow.png old mode 100644 new mode 100755 diff --git a/assets/images/cubelight_spec.png b/assets/images/cubelight_spec.png old mode 100644 new mode 100755 diff --git a/assets/images/default_white.png b/assets/images/default_white.png old mode 100644 new mode 100755 diff --git a/assets/images/droid.png b/assets/images/droid.png old mode 100644 new mode 100755 diff --git a/assets/images/env.png b/assets/images/env.png old mode 100644 new mode 100755 diff --git a/assets/images/femaleRobot.png b/assets/images/femaleRobot.png old mode 100644 new mode 100755 diff --git a/assets/images/femaleRobot_Glow.png b/assets/images/femaleRobot_Glow.png old mode 100644 new mode 100755 diff --git a/assets/images/grey.png b/assets/images/grey.png old mode 100644 new mode 100755 diff --git a/assets/images/irredecentENV.png b/assets/images/irredecentENV.png old mode 100644 new mode 100755 diff --git a/assets/images/lightRack.png b/assets/images/lightRack.png old mode 100644 new mode 100755 diff --git a/assets/images/lightRack_Glow.png b/assets/images/lightRack_Glow.png old mode 100644 new mode 100755 diff --git a/assets/images/material_paint.png b/assets/images/material_paint.png old mode 100644 new mode 100755 diff --git a/assets/images/metal.png b/assets/images/metal.png old mode 100644 new mode 100755 diff --git a/assets/images/normalMap.png b/assets/images/normalMap.png old mode 100644 new mode 100755 diff --git a/assets/images/particle-star.png b/assets/images/particle-star.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt01.png b/assets/images/quilt01.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt01_E.png b/assets/images/quilt01_E.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt01_N.png b/assets/images/quilt01_N.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt02.png b/assets/images/quilt02.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt02_E.png b/assets/images/quilt02_E.png old mode 100644 new mode 100755 diff --git a/assets/images/quilt02_N.png b/assets/images/quilt02_N.png old mode 100644 new mode 100755 diff --git a/assets/images/random_normal.png b/assets/images/random_normal.png old mode 100644 new mode 100755 diff --git a/assets/images/rocky-diffuse.jpg b/assets/images/rocky-diffuse.jpg old mode 100644 new mode 100755 diff --git a/assets/images/rocky-normal.jpg b/assets/images/rocky-normal.jpg old mode 100644 new mode 100755 diff --git a/assets/images/rocky-spec.jpg b/assets/images/rocky-spec.jpg old mode 100644 new mode 100755 diff --git a/assets/images/scales_normal.png b/assets/images/scales_normal.png old mode 100644 new mode 100755 diff --git a/assets/images/silver.png b/assets/images/silver.png old mode 100644 new mode 100755 diff --git a/assets/images/stitchStroke.png b/assets/images/stitchStroke.png old mode 100644 new mode 100755 diff --git a/assets/images/stitchStroke_N.png b/assets/images/stitchStroke_N.png old mode 100644 new mode 100755 diff --git a/assets/images/white.png b/assets/images/white.png old mode 100644 new mode 100755 diff --git a/assets/images/white.tga b/assets/images/white.tga old mode 100644 new mode 100755 diff --git a/assets/shaders/Basic.vert.glsl b/assets/shaders/Basic.vert.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/linearGradient.frag.glsl b/assets/shaders/linearGradient.frag.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/linearGradient.vert.glsl b/assets/shaders/linearGradient.vert.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/test_fshader.glsl b/assets/shaders/test_fshader.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/test_fshader_full.glsl b/assets/shaders/test_fshader_full.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/test_vshader.glsl b/assets/shaders/test_vshader.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/ub_fshader.glsl b/assets/shaders/ub_fshader.glsl old mode 100644 new mode 100755 diff --git a/assets/shaders/ub_vshader.glsl b/assets/shaders/ub_vshader.glsl old mode 100644 new mode 100755 -- cgit v1.2.3 From c7ef6951baff283266df7567e30c8074dda4ad01 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 15 Feb 2012 15:31:30 -0800 Subject: Setting up webGL local library (assets) --- assets/descriptor.json | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 assets/descriptor.json (limited to 'assets') diff --git a/assets/descriptor.json b/assets/descriptor.json new file mode 100644 index 00000000..53bfb684 --- /dev/null +++ b/assets/descriptor.json @@ -0,0 +1,34 @@ +{ + "copyright": "This file contains proprietary software owned by Motorola Mobility, Inc. No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder. (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.", + "version": "0.0.0.0", + "root": "/assets/", + "directories": [{"name": "images"}, {"name": "shaders"}], + "files": [ + "images/black.png", + "images/blue.png", + "images/BoxB2_AO.png", + "images/BoxB2_DM.png", + "images/cubelight.png", + "images/grey.png", + "images/material_paint.png", + "images/metal.png", + "images/normalMap.png", + "images/random_normal.png", + "images/rocky-diffuse.jpg", + "images/rocky-normal.jpg", + "images/rocky-spec.jpg", + "images/silver.png", + "images/white.png", + "shaders/Basic.frag.glsl", + "shaders/Basic.vert.glsl", + "shaders/linearGradient.frag.glsl", + "shaders/linearGradient.vert.glsl", + "shaders/radialGradient.frag.glsl", + "shaders/radialGradient.vert.glsl", + "shaders/test_fshader.glsl", + "shaders/test_fshader_full.glsl", + "shaders/test_vshader.glsl", + "shaders/ub_fshader.glsl", + "shaders/ub_vshader.glsl" + ] +} \ No newline at end of file -- cgit v1.2.3 From 6bc07657c8ef58e6efddd383748ecf84d1c789ad Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 16 Feb 2012 15:58:26 -0800 Subject: Adding new RDGE library data --- assets/descriptor.json | 1 + assets/rdge-compiled.js | 454 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 455 insertions(+) create mode 100755 assets/rdge-compiled.js (limited to 'assets') diff --git a/assets/descriptor.json b/assets/descriptor.json index 53bfb684..ef21b8b8 100644 --- a/assets/descriptor.json +++ b/assets/descriptor.json @@ -4,6 +4,7 @@ "root": "/assets/", "directories": [{"name": "images"}, {"name": "shaders"}], "files": [ + "rdge-compiled.js", "images/black.png", "images/blue.png", "images/BoxB2_AO.png", diff --git a/assets/rdge-compiled.js b/assets/rdge-compiled.js new file mode 100755 index 00000000..4301200f --- /dev/null +++ b/assets/rdge-compiled.js @@ -0,0 +1,454 @@ +vec2={string:function(a){return"{ "+a[0]+", "+a[1]+" }"},verify:function(a){return a==void 0||a.length==void 0||a.length<2?!1:typeof a[0]!="number"||typeof a[1]!="number"?!1:!0},copy:function(a){return a.length==void 0?[a,a]:[a[0],a[1]]},inplace_copy:function(a,b){a[0]=b[0];a[1]=b[1]},zero:function(){return[0,0]},up:function(){return[0,1]},right:function(){return[1,0]},add:function(a,b){return[a[0]+b[0],a[1]+b[1]]},sub:function(a,b){return[a[0]-b[0],a[1]-b[1]]},mul:function(a,b){return[a[0]*b[0], +a[1]*b[1]]},addMul:function(a,b,f){return f.length!=void 0&&f.length>=2?[a[0]+b[0]*f[0],a[1]+b[1]*f[1]]:[a[0]+b[0]*f,a[1]+b[1]*f]},scale:function(a,b){return b.length!=void 0&&b.length>=2?[a[0]*b[0],a[1]*b[1]]:[a[0]*b,a[1]*b]},negate:function(a){return[-a[0],-a[1]]},normalize:function(a){var b=Math.sqrt(a[0]*a[0],a[1]*a[1]);return Math.abs(1-b)>1.0E-4?(b=1/b,[a[0]*b,a[1]*b]):a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},perp:function(a){return[a[1],-a[0]]},lengthSq:function(a){return a[0]*a[0]+ +a[1]*a[1]},length:function(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])},min:function(a,b){return[Math.min(a[0],b[0]),Math.min(a[1],b[1])]},max:function(a,b){return[Math.max(a[0],b[0]),Math.max(a[1],b[1])]}};vec2.clamp=function(a,b,f){return vec2.min(f,vec2.max(a,b))};vec3={string:function(a){return"{ "+a[0]+", "+a[1]+", "+a[2]+" }"},verify:function(a){return a==void 0||a.length==void 0||a.length<3?!1:typeof a[0]!="number"||typeof a[1]!="number"||typeof a[2]!="number"?!1:!0},inplace_copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2]},copy:function(a){return a.length==void 0?[a,a,a]:[a[0],a[1],a[2]]},translation:function(a){return[a[12],a[13],a[14]]},basisX:function(a){return[a[0],a[1],a[2]]},basisY:function(a){return[a[4],a[5],a[6]]},basisZ:function(a){return[a[8], +a[9],a[10]]},zero:function(){return[0,0,0]},up:function(){return[0,1,0]},forward:function(){return[0,0,1]},right:function(){return[1,0,0]},random:function(a,b){return[a[0]+(b[0]-a[0])*Math.random(),a[1]+(b[1]-a[1])*Math.random(),a[2]+(b[2]-a[2])*Math.random()]},xy:function(a){return[a[0],a[1]]},xz:function(a){return[a[0],a[2]]},add:function(a,b){return[a[0]+b[0],a[1]+b[1],a[2]+b[2]]},plusEqual:function(a,b){a[0]+=b[0];a[1]+=b[1];a[2]+=b[2]},sub:function(a,b){return[a[0]-b[0],a[1]-b[1],a[2]-b[2]]}, +mul:function(a,b){return[a[0]*b[0],a[1]*b[1],a[2]*b[2]]},addMul:function(a,b,f){return f.length!=void 0&&f.length>=3?[a[0]+b[0]*f[0],a[1]+b[1]*f[1],a[2]+b[2]*f[2]]:[a[0]+b[0]*f,a[1]+b[1]*f,a[2]+b[2]*f]},plusEqualMul:function(a,b,f){f.length!==void 0&&f.length>=3?(a[0]+=b[0]*f[0],a[1]+=b[1]*f[1],a[2]+=b[2]*f[2]):(a[0]+=b[0]*f,a[1]+=b[1]*f,a[2]+=b[2]*f)},scale:function(a,b){return b.length!==void 0&&b.length>=3?[a[0]*b[0],a[1]*b[1],a[2]*b[2]]:[a[0]*b,a[1]*b,a[2]*b]},inplace_scale:function(a,b){b.length!== +void 0&&b.length>=3?(a[0]*=b[0],a[1]*=b[1],a[2]*=b[2]):(a[0]*=b,a[1]*=b,a[2]*=b)},negate:function(a){return[-a[0],-a[1],-a[2]]},inplace_negate:function(a){a[0]=-a[0];a[1]=-a[1];a[2]=-a[2]},normalize:function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return Math.abs(1-b)>1.0E-4?(b=1/b,[a[0]*b,a[1]*b,a[2]*b]):a},cross:function(a,b){return[a[1]*b[2]-b[1]*a[2],a[2]*b[0]-b[2]*a[0],a[0]*b[1]-b[0]*a[1]]},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},lengthSq:function(a){return a[0]*a[0]+ +a[1]*a[1]+a[2]*a[2]},length:function(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2])},distanceSq:function(a,b){var f=[a[0]-b[0],a[1]-b[1],a[2]-b[2]];return f[0]*f[0]+f[1]*f[1]+f[2]*f[2]},distance:function(a,b){var f=[a[0]-b[0],a[1]-b[1],a[2]-b[2]];return Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2])}};vec3.angle=function(a,b){return Math.acos(vec3.dot(a,b))/(vec3.length(a)*vec3.length(b))};vec3.direction=function(a,b){return vec3.normalize(vec3.sub(b,a))}; +vec3.abs=function(a){return[Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])]};vec3.min=function(a,b){return[Math.min(a[0],b[0]),Math.min(a[1],b[1]),Math.min(a[2],b[2])]};vec3.max=function(a,b){return[Math.max(a[0],b[0]),Math.max(a[1],b[1]),Math.max(a[2],b[2])]};vec3.clamp=function(a,b,f){return vec3.min(f,vec3.max(a,b))};vec3.equal=function(a,b,f){f||(f=0.0010);return vec3.distanceSq(a,b)=4?[a[0]+b[0]* +f[0],a[1]+b[1]*f[1],a[2]+b[2]*f[2],a[3]+b[3]*f[3]]:[a[0]+b[0]*f,a[1]+b[1]*f,a[2]+b[2]*f,a[3]+b[3]*f]},scale:function(a,b){return b.length!=void 0&&b.length>=4?[a[0]*b[0],a[1]*b[1],a[2]*b[2],a[3]*b[3]]:[a[0]*b,a[1]*b,a[2]*b,a[3]*b]},negate:function(a){return[-a[0],-a[1],-a[2],-a[3]]},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},normalize:function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3]);return Math.abs(1-b)>1.0E-4?(b=1/b,[a[0]*b,a[1]*b,a[2]*b,a[3]*b]):a},lengthSq:function(a){return a[0]* +a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3]},length:function(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3])},abs:function(a){return[Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2]),Math.abs(a[3])]},min:function(a,b){return[Math.min(a[0],b[0]),Math.min(a[1],b[1]),Math.min(a[2],b[2]),Math.min(a[3],b[3])]},max:function(a,b){return[Math.max(a[0],b[0]),Math.max(a[1],b[1]),Math.max(a[2],b[2]),Math.min(a[3],b[3])]}};vec4.clamp=function(a,b,f){return vec4.min(f,vec4.max(a,b))}; +vec4.equal=function(a,b,f){f||(f=0.0010);return vec4.distanceSq(a,b)=4?b[3]:1;return[a[0]*f+a[4]*g+a[8]*h+a[12]*l,a[1]*f+a[5]*g+a[9]*h+a[13]*l,a[2]*f+a[6]*g+a[10]*h+a[14]*l,a[3]*f+a[7]*g+a[11]*h+a[15]*l]};mat4.transformVector=function(a,b){var a=mat4.inverse(a),f=b[0],g=b[1],h=b[2],l=b.length>=4?b[3]:0;return[a[0]*f+a[1]*g+a[2]*h+a[3]*l,a[4]*f+a[5]*g+a[6]*h+a[7]*l,a[8]*f+a[9]*g+a[10]*h+a[11]*l,a[12]*f+a[13]*g+a[14]*h+a[15]*l]}; +mat4.transformPoint4x3=function(a,b){var f=b[0],g=b[1],h=b[2];return[a[0]*f+a[4]*g+a[8]*h+a[12],a[1]*f+a[5]*g+a[9]*h+a[13],a[2]*f+a[6]*g+a[10]*h+a[14],1]};mat4.transformVector4x3=function(a,b){var a=mat4.inverse(a),f=b[0],g=b[1],h=b[2];return[a[0]*f+a[1]*g+a[2]*h,a[4]*f+a[5]*g+a[6]*h,a[8]*f+a[9]*g+a[10]*h,0]};mat4.getRow=function(a,b){b*=4;return[a[b],a[b+1],a[b+2],a[b+3]]};mat4.getCol=function(a,b){return[a[b],a[b+4],a[b+8],a[b+12]]}; +mat4.setRow=function(a,b,f){b*=4;a[b+0]=f[0];a[b+1]=f[1];a[b+2]=f[2];f.length>=4&&(a[b+3]=f[3]);return a};mat4.setCol=function(a,b,f){a[b+0]=f[0];a[b+4]=f[1];a[b+8]=f[2];f.length>=4&&(a[b+12]=f[3]);return a};mat4.rotate=function(a,b,f){return mat4.mul(a,mat4.angleAxis(b,f))};mat4.rotateX=function(a,b){return mat4.mul(a,mat4.angleAxis(b,vec3.basisX(a)))};mat4.rotateY=function(a,b){return mat4.mul(a,mat4.angleAxis(b,vec3.basisY(a)))};mat4.rotateZ=function(a,b){return mat4.mul(a,mat4.angleAxis(b,vec3.basisZ(a)))}; +mat4.scale=function(a,b){var f=mat4.identity();b.length==void 0&&(b=[b,b,b]);f[0]=b[0];f[5]=b[1];f[10]=b[2];return mat4.mul(a,f)};mat4.scaleX=function(a,b){return mat4.scale(a,[b,1,1])};mat4.scaleY=function(a,b){return mat4.scale(a,[1,b,1])};mat4.scaleZ=function(a,b){return mat4.scale(a,[1,1,b])};mat4.translate=function(a,b){matT=mat4.identity();matT[12]=b[0];matT[13]=b[1];matT[14]=b[2];return mat4.mul(a,matT)};mat4.translateX=function(a,b){return mat4.translate(a,[b,0,0])}; +mat4.translateY=function(a,b){return mat4.translate(a,[0,b,0])};mat4.translateZ=function(a,b){return mat4.translate(a,[0,0,b])};quat={string:function(a){return"{ "+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+" }"},verify:function(a){return a==void 0||a.length==void 0||a.length<4?!1:typeof a[0]!="number"||typeof a[1]!="number"||typeof a[2]!="number"||typeof a[3]!="number"?!1:!0},identity:function(){return[0,0,0,1]},add:function(a,b){return[a[0]+b[0],a[1]+b[1],a[2]+b[2],a[3]+b[3]]},sub:function(a,b){return[a[0]-b[0],a[1]-b[1],a[2]-b[2],a[3]-b[3]]},mul:function(a,b){return[a[3]*b[3]-a[0]*b[0]-a[1]*b[1]-a[2]*b[2],a[3]*b[0]+a[0]*b[3]+a[1]* +b[2]-a[2]*b[1],a[3]*b[1]-a[0]*b[2]+a[1]*b[3]+a[2]*b[0],a[3]*b[2]+a[0]*b[1]-a[1]*b[0]+a[2]*b[3]]},addMul:function(a,b,f){return f.length!=void 0&&f.length>=4?[a[0]+b[0]*f[0],a[1]+b[1]*f[1],a[2]+b[2]*f[2],a[3]+b[3]*f[3]]:[a[0]+b[0]*f,a[1]+b[1]*f,a[2]+b[2]*f,a[3]+b[3]*f]},scale:function(a,b){return b.length!=void 0&&b.length>=4?[a[0]*b[0],a[1]*a[1],a[2]*b[2],a[3]*b[3]]:[a[0]*b,a[1]*b,a[2]*b,a[3]*b]},lengthSq:function(a){return a[0]*a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3]},length:function(a){return Math.sqrt(a[0]* +a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3])},normalize:function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]+a[3]*a[3]);return Math.abs(1-b)>1.0E-4?(b=1/b,[a[0]*b,a[1]*b,a[2]*b,a[3]*b]):a},inverse:function(a){var b=vec4.lengthSq(a);return b>1.0E-5?(b=1/b,[a[0]*-b,a[1]*-b,a[2]*-b,a[3]]):a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}};quat.applyRotation=function(a,b){return mat4.transformPoint(quat.toMatrix(a),b)}; +quat.lerp=function(a,b,f){return quat.normalize([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f,a[2]+(b[2]-a[2])*f,a[3]+(b[3]-a[3])*f])};quat.slerp=function(a,b,f){var g=quat.dot(a,b);if(g>=0.9)return quat.lerp(a,b,f);var h=Math.sqrt(Math.abs(1-g*g));if(h<0.0010)return a;var g=g<0?-1:1,l=Math.asin(h),n=1/h,h=Math.sin((1-f)*l)*n,f=Math.sin(f*l)*n*g;quat.scale(a,h);quat.scale(b,f);return quat.normalize(quat.add(a,b))}; +quat.toMatrix=function(a){var b=2*a[0],f=2*a[1],g=2*a[2],h=b*a[3],l=f*a[3],n=g*a[3];b*=a[0];var o=f*a[0],p=g*a[0];f*=a[1];var q=g*a[1],a=g*a[2];return[1-(f+a),o+n,p-l,0,o-n,1-(b+a),q+h,0,p+l,q-h,1-(b+f),0,0,0,0,1]};var stat=function(){pages={};dlgId="";self=function(a,b,f,g,h){h==void 0&&(h=!0);category=!a?"default":a;pages[category]||(pages[category]=[]);pages[category].push(this);this.name=b;this.value=this.defValue=f;this.func=g;this.reset=h;this.reportInterval=500;stat.dirty=!0;stat.find=function(a,b){var f=pages[a];for(i=0;i'+a+"");g+="";for(a in pages)pages[a]&&(g+='
',g+="
");g+="";f.innerHTML=g;$("#stat_tabs").tabs();stat.dirty=!1}for(a in pages)f=document.getElementById(a),stat.report(f,a,b)};stat.report=function(a,b){b||(b="default");var f=pages[b];if(f){outputHTML='';var g=0;for(i=0;i', +outputHTML+=f[i].func?f[i].name+" : "+f[i].func(f[i].value):f[i].name+" : "+f[i].value,outputHTML+="",g++>=3&&(outputHTML+="",g=0),f[i].reset)f[i].value=f[i].defValue;outputHTML+="
";a.innerHTML=outputHTML}}};setInterval(function(){self.reportAll("RDGE_STATS")},500);return self}(); +dbCanvas=function(a,b){this.front=document.createElement("canvas");this.front.setAttribute("width",a);this.front.setAttribute("height",b);this.front.setAttribute("style","position:absolute; margin: 0.0em; padding: 0.0em;");this.front.ctx=this.front.getContext("2d");this.back=document.createElement("canvas");this.back.setAttribute("width",a);this.back.setAttribute("height",b);this.front.setAttribute("style","position:absolute; margin: 0.0em; padding: 0.0em;");this.back.ctx=this.back.getContext("2d"); +this.swap=function(){var a=this.front;this.front=this.back;this.back=a;this.front.style.visibility="visible";this.back.style.visibility="hidden"}};function getCanvasDimensions(a){var b={x:0,y:0};b.width=a.width;b.height=a.height;if(a.offsetParent){do b.x+=a.offsetLeft,b.y+=a.offsetTop;while(a=a.offsetParent)}return b} +graph2D=function(a,b,f,g,h,l,n){this.style=n||{bgcolor:"#000"};this.sampleRes=512;this.scale=1;this.rangeMin=h;this.rangeMax=l;this.offsetY=0;this.canvas=document.createElement("canvas");this.canvas.setAttribute("width",f);this.canvas.setAttribute("height",g-32);this.canvas.setAttribute("style","position:absolute; margin: 0.0em; padding: 0.0em;");o=this;this.onclick=function(a){for(var b=getCanvasDimensions(o.canvas),f=a.clientX-b.x,a=a.clientY-b.y,b=0;bg.x+g.w)&&!(a>g.y+g.h)&&!(athis.sampleRes&&b.samples.shift();b.samples.push(b.stat.value)}};this.draw=function(){var a=this.canvas,b=this.ctx,f=a.width,g=a.height,h=this.rangeMin*this.scale,l=1/(this.rangeMax*this.scale-h),n=16+Math.floor(this.tracked.length/4+0.5)* +16;b.fillStyle=this.style.bgcolor;b.strokeStyle=this.style.bgcolor;b.fillRect(0,0,f,g-n);for(a=0;athis.maxSamples&&this.samples.shift();this.timeStampMS= +a;for(var f=0,g=-1E10,a=1E10,h=this.samples.length-1;h>=0;)f+=this.samples[h],g=Math.max(g,this.samples[h]),a=Math.min(a,this.samples[h]),h--;f=this.samples.length>0?f/this.samples.length:0;f=f>0?1E3/f:0;g=g>0?1E3/g:0;a=a>0?1E3/a:0;h=this.samples[this.samples.length-1];this.fpsRaw.value=(h>0?1E3/h:0).toFixed(2);this.fpsAvg.value=f.toFixed(2);this.fpsMin.value=g.toFixed(2);this.fpsMax.value=a.toFixed(2)}};objectManager=function(){this.guidCounter=0;this.objects=[];this.numObjects=0;this.freelist=[];this.reset=function(){this.objects=[];this.freelist=[];this.guidCounter=0};this.validHandle=function(a){return this.handleToIndex(a)!=-1};this.handleToIndex=function(a){var b=a>>16&65535;return this.objects[b]!=null&&a==this.objects[b].handle?b:-1};this.handleToObject=function(a){a=this.handleToIndex(a);return a!=-1?this.objects[a]:null};this.addObject=function(a){var b=this.objects.length;this.freelist.length> +0&&(b=this.freelist.pop());if(++this.guidCounter>=65535)this.guidCounter=1;a.handle=b<<16|++this.guidCounter;this.objects[b]=a;return a.handle};this.removeObject=function(a){a=this.handleToIndex(a);if(a!=-1){if(this.objects[a].onremove!=void 0)this.objects[a].onremove();this.objects[a]=null;this.freelist.push(a)}}};rdgeGlobalParameters={u_projMatrix:{type:"mat4",data:mat4.identity()},u_mvMatrix:{type:"mat4",data:mat4.identity()},u_invMvMatrix:{type:"mat4",data:mat4.identity()},u_normalMatrix:{type:"mat4",data:mat4.identity()},u_worldMatrix:{type:"mat4",data:mat4.identity()},u_viewMatrix:{type:"mat4",data:mat4.identity()},u_invViewMatrix:{type:"mat4",data:mat4.identity()},u_invWorldMatrix:{type:"mat4",data:mat4.identity()},u_inv_viewport_width:{type:"float",data:[1]},u_inv_viewport_height:{type:"float",data:[1]}, +u_lightPos:{type:"vec3",data:[-20,50,20]},u_lightDiff:{type:"vec4",data:[0.8,0.8,0.8,1]},u_lightAmb:{type:"vec4",data:[1,1,1,1]},rdge_lights:{u_light0Pos:{type:"vec3",data:[-20,50,20]},u_light0Diff:{type:"vec4",data:[0.8,0.8,0.8,1]},u_light0Amb:{type:"vec4",data:[8.0E-4,8.0E-4,8.0E-4,1]},u_light0Spec:{type:"vec4",data:[1,1,1,1]},u_light1Pos:{type:"vec3",data:[0,0,0]},u_light1Diff:{type:"vec4",data:[0,0,0,0]},u_light1Amb:{type:"vec4",data:[0.5,0.5,0.5,1]},u_light1Spec:{type:"vec4",data:[1,1,1,1]}, +u_light2Pos:{type:"vec3",data:[0,0,0]},u_light2Diff:{type:"vec4",data:[0,0,0,1]},u_light2Amb:{type:"vec4",data:[0.5,0.5,0.5,1]},u_light2Spec:{type:"vec4",data:[1,1,1,1]},u_light3Pos:{type:"vec3",data:[0,0,0]},u_light3Diff:{type:"vec4",data:[0.8,0.8,0.8,1]},u_light3Amb:{type:"vec4",data:[0.5,0.5,0.5,1]},u_light3Spec:{type:"vec4",data:[1,1,1,1]}},colMap:{type:"tex2d",data:"assets/images/white.png"},envMap:{type:"tex2d",data:null},normalMap:{type:"tex2d",data:null},glowMap:{type:"tex2d",data:"assets/images/black.png"}, +u_shadowDepthMap:{type:"tex2d",data:null},u_depthMap:{type:"tex2d",data:null},u_matAmbient:{type:"vec4",data:[1,1,1,1]},u_matDiffuse:{type:"vec4",data:[1,1,1,1]},u_matSpecular:{type:"vec4",data:[1,1,1,1]},u_matShininess:{type:"float",data:[128]},u_matEmission:{type:"float",data:[0,0,0,1]},u_frustumFarZ:{type:"float",data:[1E3]},u_shadowLightWorld:{type:"mat4",data:mat4.identity()},u_shadowBiasMatrix:{type:"mat4",data:mat4.identity()},u_vShadowLight:{type:"mat4",data:mat4.identity()},u_shadowBPV:{type:"mat4", +data:mat4.identity()},u_farZ:{type:"float",data:[1E3]},u_shadowLightFarZ:{type:"float",data:[1E3]},u_cameraFTR:{type:"vec3",data:[0,0,0]}};g_renderStats={};g_renderStats.numDrawCalls=new stat("rendering","numDrawCalls",0,null,!1);g_renderStats.numTriangles=new stat("rendering","numTriangles",0,null,!1);g_renderStats.numVerts=new stat("rendering","numVerts",0,null,!1);g_renderStats.numPasses=new stat("rendering","numPasses",0,null,!1);g_renderStats.reset=function(){g_renderStats.numTriangles.value=0;g_renderStats.numDrawCalls.value=0;g_renderStats.numVerts.value=0;g_renderStats.numPasses.value=0}; +rdgeConstants={colorBuffer:16384,depthBuffer:256,stencilBuffer:1024,BUFFER_STATIC:0,BUFFER_DYNAMIC:1,BUFFER_STREAM:2,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,VS_ELEMENT_FLOAT4:4,VS_ELEMENT_POS:3,VS_ELEMENT_NORM:3,VS_ELEMENT_FLOAT3:3,VS_ELEMENT_FLOAT2:2,VS_ELEMENT_UV:2,VS_ELEMENT_FLOAT:1,MAX_ELEM_TYPES:7,BUFFER_STATIC:35040,BUFFER_DYNAMIC:35044,BUFFER_STREAM:35048, +MAX_MATERIAL_LIGHTS:4,categoryEnumeration:{BACKGROUND:0,OPAQUE:1,TRANSPARENT:2,ADDITIVE:3,TRANSLUCENT:4,FOREGROUND:5,MAX_CAT:6},nodeType:{TRNODE:0,MESHNODE:1,MATNODE:2,LIGHTNODE:3}};rdgeId=0;function getBufferID(){return rdgeId++} +_renderer=function(a){try{this.ctx=a.getContext("experimental-webgl",{preserveDrawingBuffer:!0});if(!this.ctx)this.ctx=a.getContext("webgl",{preserveDrawingBuffer:!0});if(!this.ctx)this.ctx=a.getContext("webkit-3d",{preserveDrawingBuffer:!0});if(!this.ctx)this.ctx=a.getContext("moz-webgl",{preserveDrawingBuffer:!0})}catch(b){}if(!this.ctx)return window.console.log("Could not create GL context"),null;this.ctx.viewport(0,0,a.width,a.height);this.console="console"in window?window.console:{log:function(){}}; +this.ctx.clearColor(1,0,0,1);this.clearColor=[1,0,0,1];this.clearFlags=this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT;this.colorBuffer=this.ctx.COLOR_BUFFER_BIT;this.depthBuffer=this.ctx.DEPTH_BUFFER_BIT;this.stencilBuffer=this.ctx.STENCIL_BUFFER_BIT;this.BUFFER_STATIC=0;this.BUFFER_DYNAMIC=1;this.BUFFER_STREAM=2;this.POINTS=0;this.LINES=1;this.LINE_LOOP=2;this.LINE_STRIP=3;this.TRIANGLES=4;this.TRIANGLE_STRIP=5;this.TRIANGLE_FAN=6;this.BYTE=5120;this.UNSIGNED_BYTE=5121;this.SHORT=5122;this.UNSIGNED_SHORT= +5123;this.INT=5124;this.UNSIGNED_INT=5125;this.FLOAT=5126;this.VS_ELEMENT_FLOAT4=4;this.VS_ELEMENT_FLOAT3=this.VS_ELEMENT_NORM=this.VS_ELEMENT_POS=3;this.VS_ELEMENT_UV=this.VS_ELEMENT_FLOAT2=2;this.VS_ELEMENT_FLOAT=1;this.MAX_ELEM_TYPES=7;this.BUFFER_STATIC=35040;this.BUFFER_DYNAMIC=35044;this.BUFFER_STREAM=35048;this.MAX_MATERIAL_LIGHTS=4;this.usedTextureUnits=5;this.vpY=this.vpX=0;this.vpWidth=a.width;this.vpHeight=a.height;this.cameraMan=new cameraManager;this.buffers=[];this.cullBackFace=function(){this.ctx.cullFace(this.ctx.Back)}; +this.cullFrontFace=function(){this.ctx.cullFace(this.ctx.FRONT)};this.disableCulling=function(){this.ctx.disable(this.ctx.CULL_FACE)};this.enableCulling=function(){this.ctx.enable(this.ctx.CULL_FACE)};this.enablePolyOffsetFill=function(){this.ctx.enable(this.ctx.POLYGON_OFFSET_FILL)};this.disablePolyOffsetFill=function(){this.ctx.enable(this.ctx.POLYGON_OFFSET_FILL)};this.enablePointSprites=function(){};this.disablePointSprites=function(){};this.setClearColor=function(a){this.clearColor=a.slice(); +this.ctx.clearColor(a[0],a[1],a[2],a[3])};this.setClearFlags=function(a){this.clearFlags=a};this._clear=function(){this.ctx.clear(this.clearFlags)};this.clear=function(a){this.ctx.clear(a)};this.flush=function(){this.ctx.flush()};this.setViewPort=function(a,b,h,l){this.vpX=a;this.vpY=b;this.vpWidth=h;this.vpHeight=l;this.ctx.viewport(this.vpX,this.vpY,this.vpWidth,this.vpHeight)};this.cameraManager=function(){return this.cameraMan};this.textureMap=[];this.rttMap=[];this.getTextureByName=function(a, +b,h){var l=a.split(".")[1],n=this.textureMap[a];n===void 0?(n=this.createTexture(a+(l?"":".png"),b,h),this.textureMap[a]=n,n.lookUpName=a,n.previouslyReferenced=!1):n.previouslyReferenced=!0;return n};this.unloadedTextureCount=0;_texparams=function(a,b){this.wrap=a;this.mips=b};this.createTexture=function(a,b,h){var l=this.ctx.createTexture();this.unloadedTextureCount++;b===void 0&&(b="CLAMP");h===void 0&&(h=!0);if(l)l.image=new Image,l.image.src=a,l.image.context=g_Engine.getContext(),l.texparams= +new _texparams(b,h),l.image.onload=function(){this.context.ctxStateManager.RDGEInitState.loadTexture(l);this.context.renderer.unloadedTextureCount--;l.callback&&l.callback(l);this.context.renderer.unloadedTextureCount<0&&console.log("more textures loaded then created...")},l.image.onerror=function(){this.context.renderer.unloadedTextureCount--;l.callback&&l.callback(l);this.context.renderer.unloadedTextureCount<0&&console.log("more textures loaded then created...")};return l};this.commitTexture=function(a){this.ctx.bindTexture(this.ctx.TEXTURE_2D, +a);this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,a.image);a.texparams.mips&&this.ctx.generateMipmap(this.ctx.TEXTURE_2D);this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.LINEAR);this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,a.texparams.mips?this.ctx.LINEAR_MIPMAP_LINEAR:this.ctx.LINEAR);this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_S,a.texparams.wrap==="REPEAT"?this.ctx.REPEAT: +this.ctx.CLAMP_TO_EDGE);this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_WRAP_T,a.texparams.wrap==="REPEAT"?this.ctx.REPEAT:this.ctx.CLAMP_TO_EDGE);this.ctx.bindTexture(this.ctx.TEXTURE_2D,null)};this.verify=function(a){var b=this.ctx.getError();b!=0&&window.console.log("GLError ( "+a+") : "+b)};this.createRenderTargetTexture=function(a,b,h,l){var n=this.ctx,o=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,o);o.width=b;o.height=h;b=n.createTexture();n.bindTexture(n.TEXTURE_2D,b); +try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,o.width,o.height,0,n.RGBA,n.UNSIGNED_BYTE,null)}catch(p){h=new WebctxUnsignedByteArray(o.width*o.height*4),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,o.width,o.height,0,n.RGBA,n.UNSIGNED_BYTE,h)}n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,l?n.LINEAR_MIPMAP_NEAREST:n.LINEAR);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);l&& +n.generateMipmap(n.TEXTURE_2D);l=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,l);n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,o.width,o.height);n.getError(n.bindFramebuffer(n.FRAMEBUFFER,o));n.getError(n.bindRenderbuffer(n.RENDERBUFFER,l));n.getError(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,o.width,o.height));n.bindRenderbuffer(n.RENDERBUFFER,null);n.getError(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,b,0));n.getError(n.framebufferRenderbuffer(n.FRAMEBUFFER, +n.DEPTH_ATTACHMENT,n.RENDERBUFFER,l));n.bindFramebuffer(n.FRAMEBUFFER,null);n.bindTexture(n.TEXTURE_2D,null);n.bindRenderbuffer(n.RENDERBUFFER,null);n.bindFramebuffer(n.FRAMEBUFFER,null);b.id="RT_"+nodeIdGen.getId();b.frameBuffer=o;this.textureMap[a]&&window.console.log("Notification: render target: "+a+" has overwritten an existing render target");return this.textureMap[a]=b};this.defaultShaderDefintion={shaders:{defaultVShader:"assets/shaders/test_vshader.glsl",defaultFShader:"assets/shaders/test_fshader.glsl"}, +techniques:{defaultTechnique:[{vshader:"defaultVShader",fshader:"defaultFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"},texcoord:{type:"vec2"}},params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}}}; +rdgeDefaultShaderDefintion={shaders:{defaultVShader:"assets/shaders/Basic.vert.glsl",defaultFShader:"assets/shaders/Basic.frag.glsl"},techniques:{defaultTechnique:[{vshader:"defaultVShader",fshader:"defaultFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"},texcoord:{type:"vec2"}},params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}}; +rdgeDepthMapShaderDef={shaders:{depthMapVShader:"assets/shaders/depthMap_vshader.glsl",depthMapFShader:"assets/shaders/depthMap_fshader.glsl"},techniques:{shadowDepthMap:[{vshader:"depthMapVShader",fshader:"depthMapFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"},texcoord:{type:"vec2"}},params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}],depthMap:[{vshader:"depthMapVShader",fshader:"depthMapFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"},texcoord:{type:"vec2"}}, +params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}};rdgeViewSpaceNormalsShader={shaders:{normalsVShader:"assets/shaders/norm_depth_vshader.glsl",normalsFShader:"assets/shaders/norm_depth_fshader.glsl"},techniques:{depthMapWNormal:[{vshader:"normalsVShader",fshader:"normalsFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"}},params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}}; +rdgeScreenQuadShaderDef={shaders:{screenQuadVShader:"\t\t\t\tattribute vec3 a_pos;\t\t\t\tattribute vec2 a_uv;\t\t\t\tuniform float u_inv_viewport_width;\t\t\t\tuniform float u_inv_viewport_height;\t\t\t\tvarying vec2 vTexcoord;\t\t\t\tvoid main()\t\t\t\t{\t\t\t\t\tgl_Position = vec4(a_pos.xy, 0.0, 1.0);\t\t\t\t\t\t\t\tvTexcoord.x = 0.5 * (1.0 + a_pos.x + u_inv_viewport_width);\t\t\t\tvTexcoord.y = 0.5 * (1.0 - a_pos.y + u_inv_viewport_height);\t\t\t\t}",screenQuadFShader:"\t\t\t\tprecision highp float;\t\t\t\tuniform sampler2D u_mainRT;\t\t\t\tuniform sampler2D u_glowFinal;\t\t\t\tuniform sampler2D u_ssaoRT;\t\t\t\tuniform sampler2D u_shadowMap;\t\t\t\tvarying vec2 vTexcoord;\t\t\t\tvoid main()\t\t\t\t{\t\t\t\t vec2 tex = vec2(vTexcoord.x, 1.0 - vTexcoord.y);\t\t\t\t vec4 glowTexel = texture2D(u_glowFinal, tex);\t\t\t\t vec4 ssaoTexel = texture2D(u_ssaoRT, tex);\t\t\t\t vec4 smapCoef = texture2D(u_shadowMap, tex);\t\t\t\t ssaoTexel.a = 0.0;\t\t\t\t vec4 texel\t\t= texture2D(u_mainRT, tex);\t\t\t\t gl_FragColor = vec4(texel.r*((1.0 - glowTexel.r)*smapCoef.r), texel.g*((1.0 - glowTexel.g)*smapCoef.g), texel.b*((1.0 - glowTexel.b)*smapCoef.b), texel.a) + glowTexel - ssaoTexel;\t\t\t\t}"}, +techniques:{screenQuad:[{vshader:"screenQuadVShader",fshader:"screenQuadFShader",attributes:{a_pos:{type:"vec3"},a_uv:{type:"vec2"}},params:{u_mainRT:{type:"tex2d"},u_glowFinal:{type:"tex2d",data:"assets/images/black"},u_ssaoRT:{type:"tex2d",data:"assets/images/black"},u_shadowMap:{type:"tex2d",data:"assets/images/white"}},states:{blendEnabled:!0,srcBlend:"SRC_ALPHA",dstcBlend:"ONE_MINUS_SRC_ALPHA"}}]}}; +rdgeGlowMapShader={shaders:{createGlowVShader:"assets/shaders/glowMap_vshader.glsl",createGlowFShader:"assets/shaders/glowMap_fshader.glsl"},techniques:{createGlowMap:[{vshader:"createGlowVShader",fshader:"createGlowFShader",attributes:{vert:{type:"vec3"},normal:{type:"vec3"},texcoord:{type:"vec2"}},params:{},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}}; +rdgeGaussianBlurShader={shaders:{blurVShader:"assets/shaders/separableBlur_vshader.glsl",blurFShader:"assets/shaders/separableBlur_fshader.glsl"},techniques:{gaussianBlur:[{vshader:"blurVShader",fshader:"blurFShader",attributes:{vert:{type:"vec3"},texcoord:{type:"vec2"}},params:{vCoeffs:{type:"vec3",data:[0.3125,0.375,0.3125]},vOffset:{type:"vec2",data:[0.00617,0.00617]},u_weight:{type:"float",data:[1]},sTexture:{type:"tex2d"}},states:{culling:!1}}]}}; +rdgeSSAOShader={shaders:{blurVShader:"assets/shaders/ssao_vshader.glsl",blurFShader:"assets/shaders/ssaohr_fshader.glsl"},techniques:{ssao:[{vshader:"blurVShader",fshader:"blurFShader",attributes:{vert:{type:"vec3"},texcoord:{type:"vec2"}},params:{u_normalsRT:{type:"tex2d"},u_depthMap:{type:"tex2d"},sRandMap:{type:"tex2d",data:"assets/images/random_normal.png",wrap:"REPEAT",mips:!1},u_cameraFTR:{type:"vec3"},u_artVals:{type:"vec4",data:[0.36,0.75,0.6,0.05]},u_randMapSize:{type:"float",data:[64]}, +u_screenSize:{type:"vec2",data:[1024,1024]}},states:{culling:!1}}]}};rdgeShadowMapShader={shaders:{shadowMapVShader:"assets/shaders/shadowMap_vshader.glsl",shadowMapFShader:"assets/shaders/shadowMap_fshader.glsl"},techniques:{shadowMap:[{vshader:"shadowMapVShader",fshader:"shadowMapFShader",attributes:{a_pos:{type:"vec3"},a_uv:{type:"vec2"}},params:{u_lightSize:{type:"float",data:[7.93]},u_shadowColor:{type:"vec4",data:[0.922,0.7373,0.4824,0.5]}},states:{depthEnable:!0,blendEnable:!1,culling:!0,cullFace:"BACK"}}]}}; +rdgeNoiseBlurShader={shaders:{blurVShader:"assets/shaders/noiseBlur_vshader.glsl",blurFShader:"assets/shaders/noiseBlur_fshader.glsl"},techniques:{blur:[{vshader:"blurVShader",fshader:"blurFShader",attributes:{a_pos:{type:"vec3"},a_uv:{type:"vec2"}},params:{u_blurSourceMap:{type:"tex2d"}},states:{culling:!1}}]}}; +function rdgePrimitiveDefinition(){this.type=rdgeConstants.TRIANGLE_STRIP;this.vertexDefinition={};this.bufferStreams=[];this.streamUsage=[];this.indexUsage=rdgeConstants.BUFFER_STREAM;this.indexBuffer=[];this.setCount=0;this.indexOffsets=[];this.indexCount=this.triCount=this.posCount=0;this.indexElementSize=rdgeConstants.UNSIGNED_SHORT;this.bufferHandles=[];this.buffersID=-1;this.indexHandle=null;this.useDoubleBuffer=!1;this.frontBufferIndex=this.doubleBufferOffset=0;this.update=function(a){if(!this.bufferStreams[a])return null; +this.bufferStreams[a].dirty=!0;return this.bufferStreams[a]};this.flip=function(a){if(this.useDoubleBuffer===!0)for(var b=0,f=this.bufferStreams.length;b-1)){b.push(g.bufferIndex);g.debugName=f+" buffer";if(g.type==this.VS_ELEMENT_POS)a.posCount=a.bufferStreams[g.bufferIndex].length,a.positions=a.bufferStreams[g.bufferIndex];this.buffers[a.buffersID][g.bufferIndex]==void 0?(a.bufferStreams[g.bufferIndex].type=f+" PrimaryBuffer",a.forceVertexCount?(this.buffers[a.buffersID][g.bufferIndex]=this.createBufferFLOAT32(4* +a.forceVertexCount,g.bufferUsage),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,new Float32Array(a.bufferStreams[g.bufferIndex]),g.bufferUsage)):this.buffers[a.buffersID][g.bufferIndex]=this.createBufferFLOAT32(a.bufferStreams[g.bufferIndex],g.bufferUsage)):(this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.buffers[a.buffersID][g.bufferIndex]),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,new Float32Array(a.bufferStreams[g.bufferIndex]),g.bufferUsage));if(a.useDoubleBuffer===!0)a.doubleBufferOffset= +a.bufferStreams.length,a.bufferStreams[g.bufferIndex].type=f+" SecondaryBuffer",this.buffers[a.buffersID][a.doubleBufferOffset+g.bufferIndex]==void 0?a.forceVertexCount?(this.buffers[a.buffersID][a.doubleBufferOffset+g.bufferIndex]=this.createBufferFLOAT32(4*a.prim.forceVertexCount,g.bufferUsage),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,new Float32Array(a.bufferStreams[g.bufferIndex]),g.bufferUsage)):this.buffers[a.buffersID][a.doubleBufferOffset+g.bufferIndex]=this.createBufferFLOAT32(a.bufferStreams[g.bufferIndex], +g.bufferUsage):(this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.buffers[a.buffersID][a.doubleBufferOffset+g.bufferIndex]),this.ctx.bufferSubData(this.ctx.ARRAY_BUFFER,0,new Float32Array(a.bufferStreams[g.bufferIndex]),g.bufferUsage))}}a.indexBuffer.length>0?(b=a.indexBuffer.length,a.indexBuffer.debugName="index Buffer",this.buffers[a.buffersID].indexHandle==void 0?a.forceIndexCount?(this.buffers[a.buffersID].indexHandle=this.createIndexBufferUINT16(2*a.forceIndexCount,a.indexUsage),this.ctx.bufferSubData(this.ctx.ELEMENT_ARRAY_BUFFER, +0,new Float32Array(a.indexBuffer),a.indexUsage)):this.buffers[a.buffersID].indexHandle=this.createIndexBufferUINT16(a.indexBuffer,a.indexUsage):(this.ctx.bindBuffer(this.ctx.ELEMENT_ARRAY_BUFFER,this.buffers[a.buffersID].indexHandle),this.ctx.bufferSubData(this.ctx.ELEMENT_ARRAY_BUFFER,0,new Float32Array(a.indexBuffer),a.indexUsage)),a.indexCount=b,a.triCount=b/3):a.triCount=a.posCount/3}else this.createPrimitive(a)}; +_renderer.prototype.deletePrimitive=function(a){var b=this.buffers[a.buffersID];if(b){var f=this;b.forEach(function(a){f.ctx.deleteBuffer(a)});delete this.buffers[a.buffersID]}};_renderer.prototype.getPrimitiveBuffer=function(a,b){return this.buffers[a.buffersID][b]}; +_renderer.prototype.drawPrimitive=function(a,b,f){g_renderStats.numDrawCalls.value++;g_renderStats.numTriangles.value+=Math.floor(a.triCount);g_renderStats.numVerts.value+=Math.floor(a.coordCount/3);a.indexCount?this.drawIndexedPrimitive(a,b,f):this.drawNonIndexedPrimitive(a,b,f);a.useDoubleBuffer===!0&&a.flip(this)}; +_renderer.prototype.drawIndexedPrimitive=function(a,b,f){var g=b=0,h=a.buffersID,l="",n=f.length,o=0,p=a.frontBufferIndex*a.doubleBufferOffset;for(g_Engine.getContext();o