Commit 05e0fa1e authored by amandaghassaei's avatar amandaghassaei

mobile warning

parent e615ccc3
......@@ -1330,5 +1330,14 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="noSupportModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
This app uses GPU functions which are not supported by this device, please try again on desktop.<br/><br/>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -11,13 +11,20 @@ function initGPUMath(){
var gl = canvas.getContext("webgl", {antialias:false}) || canvas.getContext("experimental-webgl", {antialias:false});
var floatTextures = gl.getExtension('OES_texture_float');
if (!floatTextures) {
console.warn('no floating point texture support');
notSupported();
}
gl.disable(gl.DEPTH_TEST);
var maxTexturesInFragmentShader = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
console.log(maxTexturesInFragmentShader + " textures max");
function notSupported(){
//todo get gif
$("#noSupportModal").modal("show");
console.warn("floating point textures are not supported on your system");
}
function GPUMath(){
this.reset();
......@@ -66,6 +73,12 @@ function initGPUMath(){
framebuffer = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
var check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
if(check != gl.FRAMEBUFFER_COMPLETE){
notSupported();
}
this.frameBuffers[textureName] = framebuffer;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment