mirror of
https://github.com/PavelDoGreat/WebGL-Fluid-Simulation.git
synced 2025-10-04 09:51:38 +02:00
update script
This commit is contained in:
15
script.js
15
script.js
@@ -30,11 +30,14 @@ function getWebGLContext (canvas) {
|
|||||||
if (!isWebGL2)
|
if (!isWebGL2)
|
||||||
{ gl = canvas.getContext('webgl', params) || canvas.getContext('experimental-webgl', params); }
|
{ gl = canvas.getContext('webgl', params) || canvas.getContext('experimental-webgl', params); }
|
||||||
|
|
||||||
var halfFloat = gl.getExtension('OES_texture_half_float');
|
var halfFloat;
|
||||||
var support_linear_float = gl.getExtension('OES_texture_half_float_linear');
|
var support_linear_float;
|
||||||
if (isWebGL2) {
|
if (isWebGL2) {
|
||||||
gl.getExtension('EXT_color_buffer_float');
|
gl.getExtension('EXT_color_buffer_float');
|
||||||
support_linear_float = gl.getExtension('OES_texture_float_linear');
|
support_linear_float = gl.getExtension('OES_texture_float_linear');
|
||||||
|
} else {
|
||||||
|
halfFloat = gl.getExtension('OES_texture_half_float');
|
||||||
|
support_linear_float = gl.getExtension('OES_texture_half_float_linear');
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.clearColor(0.0, 0.0, 0.0, 1.0);
|
gl.clearColor(0.0, 0.0, 0.0, 1.0);
|
||||||
@@ -210,8 +213,12 @@ function createFBO (texId, w, h, internalFormat, format, type, param) {
|
|||||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
|
var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
|
||||||
if (status != gl.FRAMEBUFFER_COMPLETE)
|
if (status != gl.FRAMEBUFFER_COMPLETE) {
|
||||||
{ ga('send', 'event', 'app', 'init', status); }
|
ga('send', 'pageview', {
|
||||||
|
'dimension1': status,
|
||||||
|
'dimension2': isWebGL2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return [texture, fbo, texId];
|
return [texture, fbo, texId];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user