Is there a way to get coordinates from 0...1 in filters that map to the actual viewing area rather than the texture size.
For example I want to tint an object so that it gradually changes color based on the distance from center point.
Doing that with this:
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void)
{
float dist = length(vTextureCoord - vec2(0.5, 0.5));
gl_FragColor = dist * texture2D(uSampler, vTextureCoord);
}
Provides wrong results (sometimes c
That is also because pixi-v4 uses power-of-two framebuffers. If you want 400x400 it will give you 512x512. That's why you have to use some matrices with "calculateNormalizedScreenSpaceMatrix" method, I understand that its not obvious for now, but we'll make it better with docs
You can paste it to http://pixijs.github.io/examples/index.html?s=basics&f=container.js&title=Container&v=dev and see that it works
//============FILTER
function VignetteFilter(options) {
var opts =