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 --- js/helper-classes/RDGE/src/core/script/MeshManager.js | 0 js/helper-classes/RDGE/src/core/script/RenderInitProcs.js | 0 js/helper-classes/RDGE/src/core/script/RenderProcs.js | 0 js/helper-classes/RDGE/src/core/script/ScreenQuad.js | 0 js/helper-classes/RDGE/src/core/script/ShaderManager.js | 0 js/helper-classes/RDGE/src/core/script/TextureManager.js | 0 js/helper-classes/RDGE/src/core/script/animation.js | 0 js/helper-classes/RDGE/src/core/script/box.js | 0 js/helper-classes/RDGE/src/core/script/camera.js | 0 js/helper-classes/RDGE/src/core/script/engine.js | 0 js/helper-classes/RDGE/src/core/script/fx/blur.js | 0 js/helper-classes/RDGE/src/core/script/fx/ssao.js | 0 js/helper-classes/RDGE/src/core/script/init_state.js | 0 js/helper-classes/RDGE/src/core/script/input.js | 0 js/helper-classes/RDGE/src/core/script/jpass.js | 0 js/helper-classes/RDGE/src/core/script/jshader.js | 0 js/helper-classes/RDGE/src/core/script/lightmanager.js | 0 js/helper-classes/RDGE/src/core/script/math/mat4.js | 0 js/helper-classes/RDGE/src/core/script/math/quat.js | 0 js/helper-classes/RDGE/src/core/script/math/vec2.js | 0 js/helper-classes/RDGE/src/core/script/math/vec3.js | 0 js/helper-classes/RDGE/src/core/script/math/vec4.js | 0 js/helper-classes/RDGE/src/core/script/objectManager.js | 0 js/helper-classes/RDGE/src/core/script/particle.js | 0 js/helper-classes/RDGE/src/core/script/precompiled.js | 0 js/helper-classes/RDGE/src/core/script/renderUtils.js | 0 js/helper-classes/RDGE/src/core/script/rendercontext.js | 0 js/helper-classes/RDGE/src/core/script/renderer.js | 0 js/helper-classes/RDGE/src/core/script/run_state.js | 0 js/helper-classes/RDGE/src/core/script/runtime.js | 0 js/helper-classes/RDGE/src/core/script/scenegraph.js | 0 js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | 0 js/helper-classes/RDGE/src/core/script/shadowLight.js | 0 js/helper-classes/RDGE/src/core/script/sockets.js | 0 js/helper-classes/RDGE/src/core/script/ubershader.js | 0 js/helper-classes/RDGE/src/core/script/util/dbgpanel.js | 0 js/helper-classes/RDGE/src/core/script/util/fpsTracker.js | 0 js/helper-classes/RDGE/src/core/script/util/statTracker.js | 0 js/helper-classes/RDGE/src/core/script/utilities.js | 0 39 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/MeshManager.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/RenderInitProcs.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/RenderProcs.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/ScreenQuad.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/ShaderManager.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/TextureManager.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/animation.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/box.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/camera.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/engine.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/fx/blur.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/fx/ssao.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/init_state.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/input.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/jpass.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/jshader.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/lightmanager.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/math/mat4.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/math/quat.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/math/vec2.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/math/vec3.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/math/vec4.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/objectManager.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/particle.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/precompiled.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/renderUtils.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/rendercontext.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/renderer.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/run_state.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/runtime.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/scenegraph.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/scenegraphNodes.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/shadowLight.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/sockets.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/ubershader.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/util/dbgpanel.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/util/fpsTracker.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/util/statTracker.js mode change 100644 => 100755 js/helper-classes/RDGE/src/core/script/utilities.js (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/MeshManager.js b/js/helper-classes/RDGE/src/core/script/MeshManager.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js b/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/RenderProcs.js b/js/helper-classes/RDGE/src/core/script/RenderProcs.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/ScreenQuad.js b/js/helper-classes/RDGE/src/core/script/ScreenQuad.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/ShaderManager.js b/js/helper-classes/RDGE/src/core/script/ShaderManager.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/TextureManager.js b/js/helper-classes/RDGE/src/core/script/TextureManager.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/animation.js b/js/helper-classes/RDGE/src/core/script/animation.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/box.js b/js/helper-classes/RDGE/src/core/script/box.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/camera.js b/js/helper-classes/RDGE/src/core/script/camera.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/fx/blur.js b/js/helper-classes/RDGE/src/core/script/fx/blur.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/fx/ssao.js b/js/helper-classes/RDGE/src/core/script/fx/ssao.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/init_state.js b/js/helper-classes/RDGE/src/core/script/init_state.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/input.js b/js/helper-classes/RDGE/src/core/script/input.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/jpass.js b/js/helper-classes/RDGE/src/core/script/jpass.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/lightmanager.js b/js/helper-classes/RDGE/src/core/script/lightmanager.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/math/mat4.js b/js/helper-classes/RDGE/src/core/script/math/mat4.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/math/quat.js b/js/helper-classes/RDGE/src/core/script/math/quat.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/math/vec2.js b/js/helper-classes/RDGE/src/core/script/math/vec2.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/math/vec3.js b/js/helper-classes/RDGE/src/core/script/math/vec3.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/math/vec4.js b/js/helper-classes/RDGE/src/core/script/math/vec4.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/particle.js b/js/helper-classes/RDGE/src/core/script/particle.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/renderUtils.js b/js/helper-classes/RDGE/src/core/script/renderUtils.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/rendercontext.js b/js/helper-classes/RDGE/src/core/script/rendercontext.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/renderer.js b/js/helper-classes/RDGE/src/core/script/renderer.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/run_state.js b/js/helper-classes/RDGE/src/core/script/run_state.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/scenegraph.js b/js/helper-classes/RDGE/src/core/script/scenegraph.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/shadowLight.js b/js/helper-classes/RDGE/src/core/script/shadowLight.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/sockets.js b/js/helper-classes/RDGE/src/core/script/sockets.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/ubershader.js b/js/helper-classes/RDGE/src/core/script/ubershader.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/util/dbgpanel.js b/js/helper-classes/RDGE/src/core/script/util/dbgpanel.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/util/fpsTracker.js b/js/helper-classes/RDGE/src/core/script/util/fpsTracker.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/util/statTracker.js b/js/helper-classes/RDGE/src/core/script/util/statTracker.js old mode 100644 new mode 100755 diff --git a/js/helper-classes/RDGE/src/core/script/utilities.js b/js/helper-classes/RDGE/src/core/script/utilities.js old mode 100644 new mode 100755 -- cgit v1.2.3 From 191cb96b3b4e1e5aa805211e5ab8dbd6aa075881 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 10:09:13 -0800 Subject: Merging WebGL changes that allow users to modify different shape instances. Also, merging in changes that improve rendering performance by not updating static materials. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/src/core/script/engine.js | 18 ++++++------ .../RDGE/src/core/script/init_state.js | 7 ++++- js/helper-classes/RDGE/src/core/script/jshader.js | 6 ++-- js/helper-classes/RDGE/src/core/script/renderer.js | 32 ++++++++++++++++++---- .../RDGE/src/core/script/run_state.js | 10 ++++++- js/helper-classes/RDGE/src/core/script/runtime.js | 2 +- 6 files changed, 55 insertions(+), 20 deletions(-) (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js index 6fe964c7..5bc9305c 100644 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.js @@ -377,13 +377,13 @@ Engine.prototype.getRDGEPanel=function(panelID) return panelObjectManager.handleToObject(panelID); } -Engine.prototype.registerCanvas = function(canvas, runState) { - if (canvas && this.getContext(canvas.id)) - return; - +Engine.prototype.registerCanvas = function(canvas, runState) { + if (canvas && this.getContext(canvas.rdgeid)) + return; + canvas.renderer = new _renderer(canvas); // create the renderer for the context - this.canvasToRendererMap[canvas.id] = canvas; // store the canvas in the context map - canvas.renderer.id = canvas.id; + this.canvasToRendererMap[canvas.rdgeid] = canvas; // store the canvas in the context map + canvas.renderer.id = canvas.rdgeid; // configure the state manager for this context var stateMan = new stateManager(); @@ -391,11 +391,11 @@ Engine.prototype.registerCanvas = function(canvas, runState) { // add this context to the contextManager and attach the handle to DOM canvas for user retrieval var context = new contextDef(); - context.id = canvas.id; + context.id = canvas.rdgeid; context.renderer = canvas.renderer; context.ctxStateManager = stateMan; context.startUpState; - context.fpsTracker = new fpsTracker(canvas.id); + context.fpsTracker = new fpsTracker(canvas.rdgeid); context.renderer.mvMatrix = mat4.identity(); context.renderer.invMvMatrix = mat4.identity(); @@ -471,7 +471,7 @@ Engine.prototype.registerCanvas = function(canvas, runState) { } Engine.prototype.unregisterCanvas = function(canvas) { - stat.closePage(canvas.id + "_fps"); + stat.closePage(canvas.rdgeid + "_fps"); contextManager.removeObject(canvas.rdgeCtxHandle); } diff --git a/js/helper-classes/RDGE/src/core/script/init_state.js b/js/helper-classes/RDGE/src/core/script/init_state.js index 8c69d218..4b97a4f4 100644 --- a/js/helper-classes/RDGE/src/core/script/init_state.js +++ b/js/helper-classes/RDGE/src/core/script/init_state.js @@ -42,11 +42,16 @@ LoadState.prototype.Init = function() if(this.sceneName) { this.loadScene("assets_web/mesh/" + this.sceneName + ".json", this.sceneName); - } + } + + if (this.hasUserState && this.userRunState && this.userRunState.onLoadState) + this.userRunState.onLoadState(); } LoadState.prototype.ReInit = function() { + if (this.hasUserState && this.userRunState && this.userRunState.onLoadState) + this.userRunState.onLoadState(); } LoadState.prototype.Resize = function() diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js index f28219cf..36c5939e 100644 --- a/js/helper-classes/RDGE/src/core/script/jshader.js +++ b/js/helper-classes/RDGE/src/core/script/jshader.js @@ -173,7 +173,7 @@ jshader = function(addr) { // if the parameter does not exist in the shader cull it from the pass if (this.loc == null) { - window.console.log("ctx:" + ctx.canvas.id + ", technique: " + technique + ", uniform: " + name + " was not found, jshader param will have no affect"); + window.console.log("ctx:" + ctx.canvas.rdgeid + ", technique: " + technique + ", uniform: " + name + " was not found, jshader param will have no affect"); //return; } @@ -308,7 +308,7 @@ jshader = function(addr) { } } - program.ctxId = this.ctx.canvas.id; + program.ctxId = this.ctx.canvas.rdgeid; if (!program) { this.renderer.console.log("Build errors found in technique: " + t); this.def[t] = null; // remove bad technique @@ -322,7 +322,7 @@ jshader = function(addr) { var gp = new globalParam(this.ctx, p, rdgeGlobalParameters[p], program); if (gp.loc != null) { - gp.loc.ctxID = this.ctx.canvas.id; + gp.loc.ctxID = this.ctx.canvas.rdgeid; this[t].passes[i].defParams[p] = gp; this.global[p] = gp; } diff --git a/js/helper-classes/RDGE/src/core/script/renderer.js b/js/helper-classes/RDGE/src/core/script/renderer.js index 0c51d2cb..a50b8a68 100644 --- a/js/helper-classes/RDGE/src/core/script/renderer.js +++ b/js/helper-classes/RDGE/src/core/script/renderer.js @@ -335,14 +335,19 @@ _renderer = function(canvas) { var tex = this.textureMap[name]; - if (tex === undefined) { - - + if (tex === undefined) + { // load the texture tex = this.createTexture(name + ext, wrap, mips); this.textureMap[name] = tex; tex.lookUpName = name; + tex.previouslyReferenced = false; } + else + { + //console.log( "texture already loaded: " + name ); + tex.previouslyReferenced = true; + } return tex; @@ -354,9 +359,11 @@ _renderer = function(canvas) { * @param wrap - optional "CLAMP or "REPEAT", default is clamp * @param mips - optional true/false value to create mipmaps, the default is true */ + this.unloadedTextureCount = 0; _texparams = function(wrap, mips) { this.wrap = wrap, this.mips = mips }; this.createTexture = function(url, wrap, mips) { var texture = this.ctx.createTexture(); + this.unloadedTextureCount++; if (wrap === undefined) wrap = "CLAMP"; @@ -371,7 +378,20 @@ _renderer = function(canvas) { texture.image.onload = function() { var stateMan = this.context.ctxStateManager; stateMan.RDGEInitState.loadTexture(texture); + this.context.renderer.unloadedTextureCount--; + //console.log( "loaded texture: " + texture.lookUpName + ",to: " + this.context.renderer._world._worldCount + ", textures remaining to load: " + this.context.renderer.unloadedTextureCount ); + if (texture.callback) texture.callback( texture ); + if (this.context.renderer.unloadedTextureCount < 0) + console.log( "more textures loaded then created..." ); }; + texture.image.onerror = function() { + this.context.renderer.unloadedTextureCount--; + if (texture.callback) texture.callback( texture ); + //console.log( "Error loading texture: " + texture.image.src ); + if (this.context.renderer.unloadedTextureCount < 0) + console.log( "more textures loaded then created..." ); + } + } return texture; } @@ -544,8 +564,10 @@ _renderer = function(canvas) { */ rdgeDefaultShaderDefintion = { 'shaders': { - 'defaultVShader':"assets/shaders/test_vshader.glsl", - 'defaultFShader':"assets/shaders/test_fshader.glsl" + //'defaultVShader':"assets/shaders/test_vshader.glsl", + //'defaultFShader':"assets/shaders/test_fshader.glsl" + 'defaultVShader':"assets/shaders/Basic.vert.glsl", + 'defaultFShader':"assets/shaders/Basic.frag.glsl" }, 'techniques': { 'defaultTechnique':[{ diff --git a/js/helper-classes/RDGE/src/core/script/run_state.js b/js/helper-classes/RDGE/src/core/script/run_state.js index ad56d9ea..acdb6797 100644 --- a/js/helper-classes/RDGE/src/core/script/run_state.js +++ b/js/helper-classes/RDGE/src/core/script/run_state.js @@ -30,6 +30,9 @@ RunState.prototype.Init = function() this.userRunState.init(); } + if (this.hasUserState && this.userRunState && this.userRunState.onRunState) + this.userRunState.onRunState(); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -94,6 +97,11 @@ RunState.prototype.ReInit = function() if(!this.initialized) { this.Init(); + } + else + { + if (this.hasUserState && this.userRunState && this.userRunState.onRunState) + this.userRunState.onRunState(); } } @@ -117,7 +125,7 @@ RunState.prototype.Draw = function () var width = this.renderer.vpWidth; var height = this.renderer.vpHeight; - this.renderer._clear(); +// this.renderer._clear(); this.userRunState.draw(); diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js index 8d8fdf38..18b9b223 100644 --- a/js/helper-classes/RDGE/src/core/script/runtime.js +++ b/js/helper-classes/RDGE/src/core/script/runtime.js @@ -179,7 +179,7 @@ RDGERequestAnimationFrame = (function() { RDGETask = (function() { var tasks = {}; return function(canvas, startNow) { - this.id = canvas.id; + this.id = canvas.rdgeid; this.currTime = 0.0; this.lastTime = 0.0; this.running = false; -- cgit v1.2.3 From 96a0a8c916533eb5625816192ed38488f639326d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 11:00:20 -0800 Subject: Integrating canvas-2d drawing and WebGL fixes, including adding back WebGL materials. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/src/core/script/precompiled.js | 10 +++++----- js/helper-classes/RDGE/src/core/script/runtime.js | 14 +++++++++----- js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | 8 ++++---- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js index 7fd1a425..bed94e4e 100755 --- a/js/helper-classes/RDGE/src/core/script/precompiled.js +++ b/js/helper-classes/RDGE/src/core/script/precompiled.js @@ -48,11 +48,11 @@ rdgeGlobalParameters = "u_light3Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, "u_light3Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}}, "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}, + //"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.00,1.00,1.00, 1]}, "u_matDiffuse": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, "u_matSpecular": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js index 18b9b223..3d824faf 100755 --- a/js/helper-classes/RDGE/src/core/script/runtime.js +++ b/js/helper-classes/RDGE/src/core/script/runtime.js @@ -206,11 +206,15 @@ RDGETask = (function() { self.lastTime = self.currTime; } - this.start = function() { - this.running = true; - this.currTime = new Date().getTime(); - this.lastTime = this.currTime; - tasks[this.id](); + this.start = function() + { + if (!this.running) + { + this.running = true; + this.currTime = new Date().getTime(); + this.lastTime = this.currTime; + tasks[this.id](); + } } this.stop = function() { diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js index 48f0aab9..e80a14fb 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js @@ -321,10 +321,10 @@ materialNodeTemplate = function(matNode) var renderer = g_Engine.getContext().renderer; matNode.textureList = [ - {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} +// {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} ]; } -- cgit v1.2.3 From f775fb752cac57a0c1f6c42c8c60f5ff329eab32 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 11:36:19 -0800 Subject: Revert "Integrating canvas-2d drawing and WebGL fixes, including adding back WebGL materials." This reverts commit 96a0a8c916533eb5625816192ed38488f639326d. --- js/helper-classes/RDGE/src/core/script/precompiled.js | 10 +++++----- js/helper-classes/RDGE/src/core/script/runtime.js | 14 +++++--------- js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | 8 ++++---- 3 files changed, 14 insertions(+), 18 deletions(-) (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js index bed94e4e..7fd1a425 100755 --- a/js/helper-classes/RDGE/src/core/script/precompiled.js +++ b/js/helper-classes/RDGE/src/core/script/precompiled.js @@ -48,11 +48,11 @@ rdgeGlobalParameters = "u_light3Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, "u_light3Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}}, "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}, + "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.00,1.00,1.00, 1]}, "u_matDiffuse": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, "u_matSpecular": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js index 3d824faf..18b9b223 100755 --- a/js/helper-classes/RDGE/src/core/script/runtime.js +++ b/js/helper-classes/RDGE/src/core/script/runtime.js @@ -206,15 +206,11 @@ RDGETask = (function() { self.lastTime = self.currTime; } - this.start = function() - { - if (!this.running) - { - this.running = true; - this.currTime = new Date().getTime(); - this.lastTime = this.currTime; - tasks[this.id](); - } + this.start = function() { + this.running = true; + this.currTime = new Date().getTime(); + this.lastTime = this.currTime; + tasks[this.id](); } this.stop = function() { diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js index e80a14fb..48f0aab9 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js @@ -321,10 +321,10 @@ materialNodeTemplate = function(matNode) var renderer = g_Engine.getContext().renderer; matNode.textureList = [ -// {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, -// {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, -// {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, -// {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} + {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, + {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, + {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, + {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} ]; } -- cgit v1.2.3 From d5b216d9d6d2b8cb93106e8f8ca351089d05b41d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 11:52:31 -0800 Subject: Integrating canvas-2d and WebGL drawing fixes. Also adding back WebGL materials. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/src/core/script/precompiled.js | 10 +++++----- js/helper-classes/RDGE/src/core/script/runtime.js | 14 +++++++++----- js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | 8 ++++---- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js index 7fd1a425..bed94e4e 100755 --- a/js/helper-classes/RDGE/src/core/script/precompiled.js +++ b/js/helper-classes/RDGE/src/core/script/precompiled.js @@ -48,11 +48,11 @@ rdgeGlobalParameters = "u_light3Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, "u_light3Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}}, "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}, + //"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.00,1.00,1.00, 1]}, "u_matDiffuse": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, "u_matSpecular": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js index 18b9b223..3d824faf 100755 --- a/js/helper-classes/RDGE/src/core/script/runtime.js +++ b/js/helper-classes/RDGE/src/core/script/runtime.js @@ -206,11 +206,15 @@ RDGETask = (function() { self.lastTime = self.currTime; } - this.start = function() { - this.running = true; - this.currTime = new Date().getTime(); - this.lastTime = this.currTime; - tasks[this.id](); + this.start = function() + { + if (!this.running) + { + this.running = true; + this.currTime = new Date().getTime(); + this.lastTime = this.currTime; + tasks[this.id](); + } } this.stop = function() { diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js index 48f0aab9..e80a14fb 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js @@ -321,10 +321,10 @@ materialNodeTemplate = function(matNode) var renderer = g_Engine.getContext().renderer; matNode.textureList = [ - {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, - {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} +// {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"normalMap",'handle':renderer.getTextureByName("assets/images/blue"), 'unit': TEX_NORM, "type":UNIFORMTYPE.TEXTURE2D}, +// {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":UNIFORMTYPE.TEXTURE2D} ]; } -- cgit v1.2.3