Created
February 14, 2015 10:25
-
-
Save thisredone/cb23b5ae414875175d89 to your computer and use it in GitHub Desktop.
playcanvas without webgl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/framework/framework_application.js b/src/framework/framework_application.js | |
index 13977dc..1e04457 100644 | |
--- a/src/framework/framework_application.js | |
+++ b/src/framework/framework_application.js | |
@@ -84,7 +84,7 @@ pc.extend(pc, function () { | |
loader.registerHandler(pc.resources.PackRequest, new pc.resources.PackResourceHandler(registry, options.depot)); | |
loader.registerHandler(pc.resources.AudioRequest, new pc.resources.AudioResourceHandler(this.audioManager)); | |
- this.renderer = new pc.ForwardRenderer(this.graphicsDevice); | |
+ // this.renderer = new pc.ForwardRenderer(this.graphicsDevice); | |
// Register the ScriptResourceHandler late as we need the context | |
loader.registerHandler(pc.resources.ScriptRequest, new pc.resources.ScriptResourceHandler(this.context, options. | |
@@ -303,7 +303,7 @@ pc.extend(pc, function () { | |
for (var i=0,len=cameras.length; i<len; i++) { | |
camera = cameras[i]; | |
camera.frameBegin(); | |
- renderer.render(context.scene, camera.camera); | |
+ // renderer.render(context.scene, camera.camera); | |
camera.frameEnd(); | |
} | |
}, | |
diff --git a/src/graphics/graphics_device.js b/src/graphics/graphics_device.js | |
index 8845628..0e264bd 100644 | |
--- a/src/graphics/graphics_device.js | |
+++ b/src/graphics/graphics_device.js | |
@@ -107,14 +107,92 @@ pc.extend(pc, function () { | |
this.textureUnits = []; | |
this.commitFunction = {}; | |
- if (!window.WebGLRenderingContext) { | |
- throw new pc.UnsupportedBrowserError(); | |
- } | |
+ // if (!window.WebGLRenderingContext) { | |
+ // throw new pc.UnsupportedBrowserError(); | |
+ // } | |
// Retrieve the WebGL context | |
- this.gl = _createContext(canvas); | |
- var gl = this.gl; | |
+ // this.gl = _createContext(canvas); | |
+ | |
+ this.gl = {}; | |
+ this.gl.deleteFramebuffer = function() {} | |
+ this.gl.deleteRenderbuffer = function() {} | |
+ this.gl.createShader = function() {} | |
+ this.gl.shaderSource = function() {} | |
+ this.gl.compileShader = function() {} | |
+ this.gl.getShaderParameter = function() {} | |
+ this.gl.getShaderInfoLog = function() {} | |
+ this.gl.createProgram = function() {} | |
+ this.gl.attachShader = function() {} | |
+ this.gl.linkProgram = function() {} | |
+ this.gl.getProgramParameter = function() {} | |
+ this.gl.getProgramInfoLog = function() {} | |
+ this.gl.deleteShader = function() {} | |
+ this.gl.getActiveAttrib = function() {} | |
+ this.gl.getAttribLocation = function() {} | |
+ this.gl.getActiveUniform = function() {} | |
+ this.gl.getUniformLocation = function() {} | |
+ this.gl.deleteProgram = function() {} | |
+ this.gl.createBuffer = function() {} | |
+ this.gl.deleteBuffer = function() {} | |
+ this.gl.bindBuffer = function() {} | |
+ this.gl.bufferData = function() {} | |
+ this.gl.getParameter = function() {} | |
+ this.gl.getShaderPrecisionFormat = function() {} | |
+ this.gl.getExtension = function() {} | |
+ this.gl.createTexture = function() {} | |
+ this.gl.bindTexture = function() {} | |
+ this.gl.texParameteri = function() {} | |
+ this.gl.texImage2D = function() {} | |
+ this.gl.createFramebuffer = function() {} | |
+ this.gl.bindFramebuffer = function() {} | |
+ this.gl.framebufferTexture2D = function() {} | |
+ this.gl.checkFramebufferStatus = function() {} | |
+ this.gl.uniform1i = function() {} | |
+ this.gl.uniform1f = function() {} | |
+ this.gl.uniform1fv = function() {} | |
+ this.gl.uniform2fv = function() {} | |
+ this.gl.uniform3fv = function() {} | |
+ this.gl.uniform4fv = function() {} | |
+ this.gl.uniform2iv = function() {} | |
+ this.gl.uniform3iv = function() {} | |
+ this.gl.uniform4iv = function() {} | |
+ this.gl.uniformMatrix2fv = function() {} | |
+ this.gl.uniformMatrix3fv = function() {} | |
+ this.gl.uniformMatrix4fv = function() {} | |
+ this.gl.enable = function() {} | |
+ this.gl.getError = function() {} | |
+ this.gl.vertexAttribPointer = function() {} | |
+ this.gl.viewport = function() {} | |
+ this.gl.scissor = function() {} | |
+ this.gl.createRenderbuffer = function() {} | |
+ this.gl.bindRenderbuffer = function() {} | |
+ this.gl.renderbufferStorage = function() {} | |
+ this.gl.framebufferRenderbuffer = function() {} | |
+ this.gl.generateMipmap = function() {} | |
+ this.gl.pixelStorei = function() {} | |
+ this.gl.compressedTexImage2D = function() {} | |
+ this.gl.activeTexture = function() {} | |
+ this.gl.texParameterf = function() {} | |
+ this.gl.enableVertexAttribArray = function() {} | |
+ this.gl.uniform1iv = function() {} | |
+ this.gl.drawElements = function() {} | |
+ this.gl.drawArrays = function() {} | |
+ this.gl.depthMask = function() {} | |
+ this.gl.clear = function() {} | |
+ this.gl.readPixels = function() {} | |
+ this.gl.clearDepth = function() {} | |
+ this.gl.clearColor = function() {} | |
+ this.gl.disable = function() {} | |
+ this.gl.colorMask = function() {} | |
+ this.gl.blendFunc = function() {} | |
+ this.gl.blendEquation = function() {} | |
+ this.gl.cullFace = function() {} | |
+ this.gl.useProgram = function() {} | |
+ this.gl.deleteTexture = function() {} | |
+ var gl = this.gl; | |
if (!this.gl) { | |
throw new pc.ContextCreationError(); | |
} | |
@@ -153,8 +231,11 @@ pc.extend(pc, function () { | |
var fragmentShaderPrecisionMediumpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT); | |
var fragmentShaderPrecisionLowpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT); | |
- var highpAvailable = vertexShaderPrecisionHighpFloat.precision > 0 && fragmentShaderPrecisionHighpFloat.prec | |
- var mediumpAvailable = vertexShaderPrecisionMediumpFloat.precision > 0 && fragmentShaderPrecisionMediumpFloa | |
+ // var highpAvailable = vertexShaderPrecisionHighpFloat.precision > 0 && fragmentShaderPrecisionHighpFloat.p | |
+ // var mediumpAvailable = vertexShaderPrecisionMediumpFloat.precision > 0 && fragmentShaderPrecisionMediumpF | |
+ | |
+ var highpAvailable = false; | |
+ var mediumpAvailable = false; | |
if (!highpAvailable) { | |
if (mediumpAvailable) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment