Permalink
Browse files

Fix framebuffer settings to work on FF.

  • Loading branch information...
1 parent 2e27bdd commit 1d23956ee11a15ee342f287a5b5f1c000e4c1fb3 @philogb committed Apr 26, 2012
Showing with 18 additions and 15 deletions.
  1. +1 −1 examples/blur/index.js
  2. +6 −5 examples/fractal/index.js
  3. +6 −4 examples/wave/SwapTexture.js
  4. +5 −5 examples/wave/index.js
View
@@ -107,7 +107,7 @@ function load() {
value : 'LINEAR'
}, {
name : 'TEXTURE_MIN_FILTER',
- value : 'LINEAR',
+ value : 'LINEAR_MIPMAP_NEAREST',
generateMipmap : false
} ]
},
View
@@ -62,6 +62,7 @@ function load() {
alert('There was an error, sorry :S');
},
onLoad: function(app) {
+ window.app = app;
//Set framebuffers
var fboOpt = {
width: sizeX,
@@ -72,7 +73,7 @@ function load() {
value: 'LINEAR'
}, {
name: 'TEXTURE_MIN_FILTER',
- value: 'LINEAR',
+ value: 'LINEAR_MIPMAP_NEAREST',
generateMipmap: false
}]
},
@@ -81,12 +82,12 @@ function load() {
app.setFrameBuffer('main', fboOpt)
.setFrameBuffer('main2', fboOpt);
-
+
timer = setInterval(fr, 500);
time = Date.now();
animation = "animate";
anim();
-
+
function draw() {
var uniform = getUniforms();
Media.Image.postProcess({
@@ -126,7 +127,7 @@ function load() {
uniforms: uniform
});
}
-
+
function getUniforms() {
return {
'time': time,
@@ -147,7 +148,7 @@ function load() {
break;
}
}
-
+
function fr() {
var ti = Date.now();
time = ti;
@@ -3,6 +3,7 @@ function SwapTexture(config, count) {
config = config || {};
var me = this;
gl.supports_OES_texture_float = !!gl.getExtension('OES_texture_float');
+ debugger;
config = Utils.merge({
width: 512,
height: 512,
@@ -15,8 +16,8 @@ function SwapTexture(config, count) {
},
{
name: gl.TEXTURE_MIN_FILTER,
- value: gl.supports_OES_texture_float ? gl.LINEAR : gl.NEAREST,
- generateMipmap: false
+ value: gl.supports_OES_texture_float ? gl.LINEAR_MIPMAP_NEAREST : gl.NEAREST,
+ generateMipmap: true
},
{
name: gl.TEXTURE_WRAP_S,
@@ -30,7 +31,8 @@ function SwapTexture(config, count) {
data: {
type: gl.supports_OES_texture_float ? gl.FLOAT : gl.UNSIGNED_BYTE
}
- }
+ },
+ bindToRenderBuffer: true
}, config);
if (config.bindToTexture.data) {
var data = config.bindToTexture.data;
@@ -74,4 +76,4 @@ SwapTexture.prototype = {
me.from = me.to;
me.to = temp;
}
-};
+};
View
@@ -106,11 +106,11 @@ function webGLStart() {
parameters: [
{
name: 'TEXTURE_MAG_FILTER',
- value: 'LINEAR_MIPMAP_LINEAR'
+ value: 'LINEAR'
},
{
name: 'TEXTURE_MIN_FILTER',
- value: 'LINEAR_MIPMAP_LINEAR',
+ value: 'LINEAR_MIPMAP_NEAREST',
generateMipmap: true
}
],
@@ -123,7 +123,8 @@ function webGLStart() {
data: {
width: 1024,
height: 512
- }
+ },
+ bindToRenderBuffer: true
},
events: {
@@ -163,7 +164,6 @@ function webGLStart() {
onDragStart: function(e) {
cameraControl.onDragStart(e);
},
-
onDragMove: function(e) {
cameraControl.onDragMove(e);
}
@@ -342,4 +342,4 @@ function webGLStart() {
setTimeout(function() {return app.animate.apply(app, arguments);}, 15);
}
});
-}
+}

0 comments on commit 1d23956

Please sign in to comment.