[gameprogrammer] Re: WebGL has low quality bilinear filtering?

  • From: Richard Sabbarton <richard.sabbarton@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Wed, 10 Jun 2015 13:32:04 +0100

Hi All,

Great to see some action here again. We do seem to have the occasional
message spree. I am in the process of porting my MeshCreator Windows App
to HTML5/WebGL. I am going to make use of AWS Cloud Compute Engine to
assist the client browser with the heavy number crunching. Then it's just
a case of keeping the framerate respectable for the user experience. Stuff
like this thread is a great help to me in making choices on how and where I
can gain performance and quality.

Regards

Richard

On 9 June 2015 at 17:45, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

I'm still looking for some definitive info or documentation, but it looks
like the issue is that it's using 24.8 fixed point to interpolate between
the pixels.

There's some interesting links below regarding this stuff. One workaround
seems to be to do the bilinear interpolation in the shader yourself, doing
4 pixel reads instead of 1. This does make it nice and smooth and is what
i'm doing in the image on the right

Another workaround I've found is to do two pixel reads, to have it either
do only the x interpolation or only the y interpolation in the hardware,
then do the other axis interpolation in the shader. This isn't as high
quality as doing the bilinear interpolation completely in the shader, but
it is only 2 texture reads instead of 4 and in my experiments is a lot
closer to the "software bilinear" than the "hardware bilinear" so seems
like a good win.

http://iquilezles.org/www/articles/hwinterpolation/hwinterpolation.htm

http://iquilezles.org/www/articles/texture/texture.htm


On Thu, Jun 4, 2015 at 2:10 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

In this case, it's been super difficult to find any info because...
1) Not many people really do WebGL, which makes it hard to find WebGL
info out there specifically.
2) My usage case of wanting to bilinear interpolate data i've stored in
textures really doesn't seem to be common at all, which makes it hard to
find info about this topic - in any API - hard to find info on.

If I don't hear of anything and can't find anything, i'm going to try it
in DX and OpenGL and see if they have the same precision problems :P

On Thu, Jun 4, 2015 at 1:55 PM, Vince <dmarc-noreply@xxxxxxxxxxxxx>
wrote:

Firstly, I'm thrilled to see some action here again.

I have not done much raw work in WebGL, but if I was looking for
state-of-the-art examples, I would check out three.js.
Vince~


------------------------------
*From:* Alan Wolfe <alan.wolfe@xxxxxxxxx>
*To:* gameprogrammer@xxxxxxxxxxxxx
*Sent:* Thursday, June 4, 2015 3:21 PM
*Subject:* [gameprogrammer] WebGL has low quality bilinear filtering?

Anyone out there do any webgl? might be a generic gfx question though...

Check this out:
http://demofox.org/BilinearTest/bilineartest.html

The left side uses the built in bilinear filtering and has obvious noise
/ non smoothness in the interpolation.

The right side grabs the four pixels and does the bilinear interpolation
in the shader, which makes for nice smooth interpolation.

No matter i try, i cannot seem to make the built in interpolation higher
quality. I've tried a few different machines and all major browsers, all
has the same results.

Does anyone know if this is a solvable issue? or is it what we live
with, with current hardware?

Thanks!!





Other related posts: