Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Integer value scaling for quads?

A topic by digiwombat created Jan 28, 2021 Views: 156 Replies: 4
Viewing posts 1 to 5
(1 edit)

Hey again!

So I'm trying to do button prompts inline and there's a minor issue where the scaling that STM does (even with point enabled) is causing my icons to come out blurry. I'd really like if there was a way I could lock the quad sizing to be integer scaled of the source quad size (18x18 pixels at 1PPU in my case) so I can maintain my pixel perfect sprites.

Also, it doesn't seem to be respecting point filtering even though the STM object, texture, and quad image settings (tried overriding and not) are all set to point.


Developer

Hm, would it be possible to send me a screenshot of the inspector for the quad? I'm wondering if it's possible "override filter mode" is checked and forcing it to render in a mode besides point. You can also define a size there, which will be relative to the size of your text, so tweaking the value there might help? As long as it matches the text, integer locking shouldn't be needed... Do you have "Pixel Snap" enabled on your font's shader?


Those are my initial thoughts! Please let me know if those did anything, and I'll take a deeper dive into this if that doesn't solve the issue.

THE PLOT THICKENS!

I reimported the file because it seems to have been somehow corrupted by applying it as a texture for a quad image file.

Steps:
1. Import the file fresh, it's pixel perfect beautiful when I drop it into the scene.
2. Drag it onto the buttons quad image I made
3. Drop the image into the scene:


There's the inspector. Toggling the Override and changing options doesn't do anything. I'm going to try deleting and fully remaking the quad now to see if that fixes the issue.

(1 edit)

Yep, that fixed it. Even though the UI was saying that I was on Point (even when manually selecting the file and regardless of override) I think it was forcing Bilinear.

And to get it pixel perfect I just need to multiple the pixel size by the quad size, so 1.125 to go from 16-18.

Edit: Just to add, not sure how this happened since it was working previously with the same texture. Just somehow the quad file got broken without being touched.

Developer

Huh, bizarre... I really can't think of what would have caused that, but I'm glad it's working now. My only other idea was that if the texture was set to point but the text mesh wasn't, but the first screenshot looked fine. Either way, I'm glad it works now! The 1.125 thing is perfect, I was having a lot of trouble trying to articulate that, so I'm glad you figured it out.