#1 2014-08-15 13:12:01

torque87
Member

Standard size of textures?

Hello!
Thanks for a great Engine and game!
To my question:
If i want to put custom textures in Tesseract, what size/Resolution should it have and should i use JPEG, PNG or other formats?

Thanks in advance! // torque87

Offline

#2 2014-08-15 14:04:50

RaZgRiZ
Moderator

Re: Standard size of textures?

Their resolution can be anything from 8x8 to 4096x4096 or even greater. It all depends on the purpose of your texture. The default map texture (base1.png) is 512x512, so you can use any size texture you want according to your needs. If necessary, a texture can be downscaled or upscaled, though the quality will suffer for the latter.

As for the format, anything popular is supported really.
PNG
JPG
TGA (only one to allow transparency?)
BMP (dunno about this one)

Offline

#3 2014-08-15 15:38:52

Calinou
Moderator

Re: Standard size of textures?

Use high-quality (90) JPEG. The texture scale is twice as small as Sauerbraten's or Red Eclipse's by default. Change by selecting a texture, then typing /vscale N where N is the scale, between 0.125 and 8.

Offline

#4 2014-08-16 01:09:53

Pritchard
Member

Re: Standard size of textures?

RaZgRiZ wrote:

TGA (only one to allow transparency?)

Really? Can you have transparent textures with tga? :o

Offline

#5 2014-08-16 07:20:33

Lord Kv
Member

Re: Standard size of textures?

Pritchard wrote:

Really? Can you have transparent textures with tga? :o

No, even if you make an alpha surface with transparent texture it will have the same amount of transparency on the entire face, ingoring the alpha channel. Only decals use alpha channel and png works just fine with transparency.

Offline

#6 2014-08-16 08:31:33

Calinou
Moderator

Re: Standard size of textures?

You can use the glowmap to have a really transparent texture, but it'll always be fully bright.

Offline

#7 2014-08-16 09:23:47

torque87
Member

Re: Standard size of textures?

thanks! // torque87

Offline

#8 2014-08-16 12:58:53

RaZgRiZ
Moderator

Re: Standard size of textures?

Lord Kv wrote:
Pritchard wrote:

Really? Can you have transparent textures with tga? :o

No, even if you make an alpha surface with transparent texture it will have the same amount of transparency on the entire face, ingoring the alpha channel. Only decals use alpha channel and png works just fine with transparency.

Are you certain? Last time i tried TGA texture with transparency it worked fine. PNG on the other hand appeared to have a black color in its place.

Offline

#9 2014-08-16 13:34:47

ThaOneDon
Member

Re: Standard size of textures?

WebP, supported by sdl_image, way more efficient than PNG and lossless. Also supports transparency(alpha) unlike PNG.

http://en.wikipedia.org/wiki/WebP

There are no downsides. Well... except Google but
https://developers.google.com/speed/webp/faq?csw=1

License is Open so i see no reason why Tesseract isn't using this format instead of PNG.

"According to Google's measurements, a conversion from PNG to WebP results in a 45% reduction in file size when starting with PNGs found on the web, and a 28% reduction compared to PNGs that are recompressed with pngcrush and pngout."

Last edited by ThaOneDon (2014-08-16 13:36:36)

Offline

#10 2014-08-16 15:44:35

Calinou
Moderator

Re: Standard size of textures?

I'm not sure if Tesseract can load WebP, it probably needs some specific code for that. eihrul could take a look at it.

Offline

#11 2014-08-16 20:41:48

RaZgRiZ
Moderator

Re: Standard size of textures?

ThaOneDon wrote:

WebP, supported by sdl_image, way more efficient than PNG and lossless. Also supports transparency(alpha) unlike PNG.

http://en.wikipedia.org/wiki/WebP

There are no downsides. Well... except Google but
https://developers.google.com/speed/webp/faq?csw=1

License is Open so i see no reason why Tesseract isn't using this format instead of PNG.

"According to Google's measurements, a conversion from PNG to WebP results in a 45% reduction in file size when starting with PNGs found on the web, and a 28% reduction compared to PNGs that are recompressed with pngcrush and pngout."


I don't know what the hell they're talking about but the samples they offer at
https://developers.google.com/speed/webp/gallery2
seem to tell a different tale. WebP lossless is 2KB smaller than a conventional PNG in the case of the rose and 4KB bigger in the case of the Tux. The results are wildly different and they're not truly great. It might just be me browsing with firefox which doesn't support WebP format by default but Chrome showed the exact same images and i really did not see the slightest difference.

PNG is also a lossless format, and supports transparency just fine. Just because WebP tries a different algorithm doesn't make it instantly better until you bring it to its knees crunching the image to the smallest size possible. I highly doubt those overrate claims from Google, they're just trying to reinvent the wheel here and it's not working out right.

Last edited by RaZgRiZ (2014-08-16 20:42:13)

Offline

#12 2014-08-17 05:14:46

ThaOneDon
Member

Re: Standard size of textures?

Those are all PNGs.... converted back for compatibility purposes.

WebPs are below
https://developers.google.com/speed/web … webp_links


:)

for Transparency i mean't Alpha Channel can't be converted to or converted from other image formats under some circumstances. (Photoshop has that problem for example) Sorry if i wasn't specific.

Last edited by ThaOneDon (2014-08-17 05:19:54)

Offline

#13 2014-08-17 09:31:16

Calinou
Moderator

Re: Standard size of textures?

WebP also provides a lossy mode, which supports transparency. This is really interesting for some purposes (chain fences, normal maps with bundled alpha channel for parallax map).

Offline

Board footer