Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, TedMar, dr_panther, Ayumi), 1,048 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
png Textures cause visibility errors #286578
08/25/09 23:21
08/25/09 23:21
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
Hi conitec,

I registrated a strange behaviour when using .png Textures for model skins: The faces to which the .png skin is attached are appearing invisible when moving with the camera at certain positions in a scene. I tested this behaviour with some models that had two skins attached to different parts of the model. One skin was a bitmap, the other one a png file. Only the faces which had the png texture attached vanished in the scene when moving the camera around. I replaced the png file with a bmp file and the problem didn't appear any more.

Greetings
Redphoenix

Re: png Textures cause visibility errors [Re: RedPhoenix] #286580
08/25/09 23:27
08/25/09 23:27
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Use .tga instead.

Re: png Textures cause visibility errors [Re: Cowabanga] #286581
08/25/09 23:50
08/25/09 23:50
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
Well I could have come to that myself...

Don't you think I have some reason for using .png. ...?

Besides it's supported by med and therefore should work properly anyway.

To make it finally clear. This post isn't about asking how to solve the problem I got, but about reporting a possible engine bug, that should be fixed whether there exists a workaround or not.

Last edited by RedPhoenix; 08/25/09 23:51.
Re: png Textures cause visibility errors [Re: RedPhoenix] #286614
08/26/09 07:51
08/26/09 07:51
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
RedPhoenix i think it would be understandable if post a screenshoot. I guess you .png image have alpha channel, so you see the alpha blending errors, this is not engine bug its feature of hardware.
Anyway, the manual says:
Quote:
PNG images behave like TGA images, but are not recommended because they are loaded not by the engine, but by the DirectX library, and are not guaranteed to be automatically restored when the video device gets lost. This means that they can lose their content f.i. when a fullscreen application is minimized.



A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: png Textures cause visibility errors [Re: XD1v0] #286616
08/26/09 08:09
08/26/09 08:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks for reporting the problem. I don't think that a 3D engine renders textures any differently when their file names ended with .PNG.

Thus, your problem is not the .PNG format, but that the image itself is wrong. The most frequent mistake is accidentally using a 32 bit image with alpha channel. That's why the manual says to use TGA, PCX, BMP, and DDS. Just because the least mistakes can be made with them.

Re: png Textures cause visibility errors [Re: jcl] #286633
08/26/09 09:12
08/26/09 09:12
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
Ok I now got the problem right:

XD1v0 is correct about the alpha blending error, that's what I saw as visibility problem. However there is one thing left.
I used several .png images and none of them contained an alpha channel!

It is possible for both the .png and the .tga format to have an image saved with or without alpha channel applied. This can be controled using the channel dock in e.g. gimp.
When loading a .tga file without alpha channel into med, the skin is proceeded in the right way and created as 24bit without alpha. However when loading a .png file into med, it seems that automatically a pure white alpha channel is created.
The texture format is set to 32bit with alpha, althoughh there is no alpha channel in the image.

Of course it's not that great problem to deactivate the alpha channel for each .png texture, but it would still be good, if you could change that behaviour, if possible.

Last edited by RedPhoenix; 08/26/09 09:17.
Re: png Textures cause visibility errors [Re: RedPhoenix] #286636
08/26/09 09:18
08/26/09 09:18
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I can not see how we could change this behavior as we didn't make PNG and DirectX. But we'll place a note in the manual about that. PNG images might always contain an alpha channel even if you haven't created one in your paint program.


Re: png Textures cause visibility errors [Re: jcl] #286667
08/26/09 12:45
08/26/09 12:45
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
How about making an intergrated png loader for the engine then?
So that a png without Alphachannel gets loaded as such.

Re: png Textures cause visibility errors [Re: Damocles_] #286705
08/26/09 17:42
08/26/09 17:42
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
would be great-I love this format laugh


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1