• PNGS in derma turning out bad
    11 replies, posted
So, I've come into some trouble when drawing a PNG on the screen using the following code [CODE]surface.SetMaterial( Material( "resource/userfixed.png", "noclamp" ) ) surface.SetDrawColor( color_white ) surface.DrawTexturedRect( 70, 90, 60, 60)[/CODE] It successfully shows the PNG, but no matter what I do it always seems to be very pixelated, I can't get it to seem smooth. It looks like something that has no anti-aliasing, the curves aren't smooth at all. It's not a problem witht he resolution of the png. Any ideas? Regards, isagrat
Try this: [code]Material( "resource/userfixed.png", "smooth" )[/code]
Smooth + noclamp helped bump up the quality a good bit, thanks. Guess I'll also remake the png in 256 x 265. Thanks! Edit: Creating the png in 512x512 made it even more pixelated and blurry. Oh well
[QUOTE=isagrat;50645852]Edit: Creating the png in 512x512 made it even more pixelated and blurry. Oh well[/QUOTE] You didn't just stretch it, did you? It'd obviously be blurry if you just stretched it
Usually it's best to keep the PNG the correct size for what you want. I found that if I used a 512x512 image for a 200x200 space, it shrinks with jagged edges.
Make your icons twice the size you'll display it at - then turn off noclamping and smoothing For me it looks like this, 32x32 png files displayed as 16x16 - we can both agree it's a good quality isn't it? [t]http://puu.sh/pQdyZ/49f21ab0d2.jpg[/t]
[QUOTE=Netheous;50650076]Make your icons twice the size you'll display it at - then turn off noclamping and smoothing For me it looks like this, 32x32 png files displayed as 16x16 - we can both agree it's a good quality isn't it? [t]http://puu.sh/pQdyZ/49f21ab0d2.jpg[/t][/QUOTE] Don't mean to derail here, but your gamemode is looking pretty fucking cool.
[QUOTE=Netheous;50650076]Make your icons twice the size you'll display it at - then turn off noclamping and smoothing For me it looks like this, 32x32 png files displayed as 16x16 - we can both agree it's a good quality isn't it? [t]http://puu.sh/pQdyZ/49f21ab0d2.jpg[/t][/QUOTE] How did you manage to make them transparent and still have the right dimensions? I figured out my problem was that I was working in illustrator setting the file size to 256 x 256, but when I exported as a png with a transparent background, it changed the dimensions to 168 x 174, because I didn't fill all 256 pixels. I wanted some parts to be blank and transparent.
[QUOTE=isagrat;50652406]How did you manage to make them transparent and still have the right dimensions? I figured out my problem was that I was working in illustrator setting the file size to 256 x 256, but when I exported as a png with a transparent background, it changed the dimensions to 168 x 174, because I didn't fill all 256 pixels. I wanted some parts to be blank and transparent.[/QUOTE] When exporting using Ai you have to enable one of the options to make it transparent.
that and to keep it as 256x256 make sure "use artboards" is checked [img]http://i.imgur.com/wlPg8qM.png[/img] [img]http://i.imgur.com/SmZpLQR.png[/img]
I should've clarified, I already knew how to make it transparent but it changed resolution when it was exported. [QUOTE=PortalGod;50654466]that and to keep it as 256x256 make sure "use artboards" is checked [img]http://i.imgur.com/wlPg8qM.png[/img] [img]http://i.imgur.com/SmZpLQR.png[/img][/QUOTE] Anyway, I checked the use artboards option and that seemed to do the job, thanks!
Sorry, you need to Log In to post a reply to this thread.