Search the Community
Showing results for tags 'sampling'.
-
Hi, First of all thank you for Babylon.JS, it is a wonderful library and a pleasure to code with it I am working on a game project and I need to display textures with a 'nearest neighbour' sampling mode (pixelated effect). Babylon.JS theoretically offers this possibility, but I could not manage to get it working. Here is a playground illustrating my modest struggle: http://www.babylonjs-playground.com/#1IKIXK#2 Left cube's texture is created with the NEAREST_SAMPLINGMODE parameter, while the right one uses TRILINEAR_SAMPLINGMODE. In my browser (Chrome v38), there is absolutely no visible difference. I have seen a couple of threads about this on the forum but nothing that provides a real solution. Hopefully this thread will be able to do that. Of course there is always the possibility to multiply the size of the texture using a nearest neighbour interpolation with an image manipulation software, but I'd prefer not as it adds steps in the workflow and prevents doing big texture atlases. Thank you very much in advance
-
I searched in the forums and the unique thing was this: Is there anyway to easily set for the render/scene all that we need for get sharp pixels? I can turn off the Antialias for the rendering. But there is anyway to set Nearest.Samplingmode or turn off the image smoothing, anisoptric filtering or other default filters of Babylon.JS ? In the same way i can turn off the antialias is there anyway to turn off that filters in one function?
-
so I have a 2x128 vertical gradient, I do that to reduce the spritesheet size. What I want is to stretch the sprite to 64x128. When I created a sprite out of it, I notice it having a weird incorrect width. When I do, sprite.width = 64, it doesn't go to 64 px. And when I use a huge number to force it to 64px on screen, it uses the wrong sampling where it tries to interpolate the pixel across the x direction using the pixel above and below. How can I resolve this ?