coltonoscopy Posted March 3, 2015 Share Posted March 3, 2015 Hey guys, Is there a way I can disable texture filtering on my Sprites? I'm using 32x32 sprites and when they're enlarged, they look blurry and awful. I was unable to figure out through the API and Google how to change a Sprite or SpriteManager's Texture filtering method, so some guidance would be much appreciated; thank you! Best,Colton Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted March 3, 2015 Share Posted March 3, 2015 Have a look at this thread, if you haven't already. It's not specifically sprite based but some of the same ideas/methods might apply: http://www.html5gamedevs.com/topic/11601-problem-with-texture-sampling-mode/ Quote Link to comment Share on other sites More sharing options...
coltonoscopy Posted March 3, 2015 Author Share Posted March 3, 2015 Hi Xeonzinc, Thanks for the reply. I took a look at that thread before creating this one, but I was unable to figure out what I needed to do with Sprites specifically in order to take care of the filtering issue. Looking through the API didn't help either; there appear to be no methods or members within the Sprite or SpriteManager class that give direct access to the Texture and therefore texture filtering. Best,Colton Quote Link to comment Share on other sites More sharing options...
jahow Posted March 3, 2015 Share Posted March 3, 2015 Hey, Unfortunately at this time the sprite manager's texture is created behind the scenes, and there is no outside control on the type of filtering to be used. I guess that would be a nice thing to add to the project! Source: https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Sprites/babylon.spriteManager.ts Quote Link to comment Share on other sites More sharing options...
coltonoscopy Posted March 3, 2015 Author Share Posted March 3, 2015 Hi jahow, Thank you for your reply! A bummer that there isn't really an interface for it yet; it'd be a great thing to have access to, as my goal was developing a sort of Doom-like game where the enemies are sprites but retain that sort of 16-bit spritey look. Best,Colton Quote Link to comment Share on other sites More sharing options...
jahow Posted March 3, 2015 Share Posted March 3, 2015 I've done a pull request on github for this, let's see if the team accepts it: https://github.com/BabylonJS/Babylon.js/pull/421 It includes my homemade, dirty trick to have nice pixelated textures (the texture.anisotropicFilteringLevel = 1 bit). Not very classy, but I know it works 100% Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 3, 2015 Share Posted March 3, 2015 PR validated thanks guys! Quote Link to comment Share on other sites More sharing options...
coltonoscopy Posted March 4, 2015 Author Share Posted March 4, 2015 Awesome! Thanks jahow and Deltakosh! Can't wait to test it out! Best,Colton Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 4, 2015 Share Posted March 4, 2015 it's online Pick the latest v2.1 alpha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.