Hi,
I’m tryin to adapt this MSAA, but i’m struggling with the 2 pre computed functions:
// In the constructor
this.getSearchTexture = function () {
return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=';
};
/*
* THREE.js
this.searchTexture.magFilter = NearestFilter;
this.searchTexture.minFilter = NearestFilter;
this.searchTexture.generateMipmaps = false;
this.searchTexture.flipY = false;
* */
this.tSearch = new pc.Texture(this.graphicsDevice, {
// format: pc.PIXELFORMAT_RGB16F,
magFilter : pc.FILTER_NEAREST,
minFilter : pc.FILTER_NEAREST,
mipmaps: false,
flipY: false
});
// setting the source then upload
this.tSearch.setSource(this.getSearchTexture());
this.tSearch.upload();
};
// Our effect must derive from pc.PostEffect
PostEffectSMAAWeights = pc.inherits(PostEffectSMAAWeights, pc.PostEffect);
PostEffectSMAAWeights.prototype = pc.extend(PostEffectSMAAWeights.prototype, {
// Every post effect must implement the render method which
// sets any parameters that the shader might require and
// also renders the effect on the screen
render: function (inputTarget, outputTarget, rect) {
var device = this.device;
var scope = device.scope;
// this.tArea.setSource(this.getAreaTexture());
// this.tArea.upload();
// this.tSearch.upload();
// this.tSearch.setSource(this.getSearchTexture());
this.resolution[0] = 1 / inputTarget.width;
this.resolution[1] = 1 / inputTarget.height;
scope.resolve("uResolution").setValue(this.resolution);
scope.resolve("tDiffuse").setValue(inputTarget.colorBuffer);
scope.resolve("tArea").setValue(this.tArea);
scope.resolve("tSearch").setValue(this.tSearch);
pc.posteffect.drawFullscreenQuad(device, outputTarget, this.vertexBuffer, this.weightShader, rect);
I get this when displaying it in three.js:
But nothing here.
How can i make sure the population of the texture is correct?
Best,
P