TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
591 stars 156 forks source link

Models with .png textures will crash GtkRadiant #70

Closed 0bsidian closed 12 years ago

0bsidian commented 12 years ago

Loading a model that uses a .png texture will crash GtkRadiant 1.6.2 on Windows.

It appears GtkRadiant will always try to read, and fail loading the .png file even if a same named .tga file exists. If both files exist, I think GtkRadiant should intelligently pick one over the other depending on the game (Quake 3 - load .tga over .png; Quake Live - load .png over .tga).

In my case, I had a grass.ase model that should have been using grass.tga file as the texture. I also had a grass.png file that was a 3ds Max render that I used as a preview of the model. It took me a while to figure out why GtkRadiant was crashing when loading the model, it kept trying to read the .png file and failed to load it. Renaming the image to grass-preview.png fixed the problem.

However, I can see this as being a problem for any games (Quake Live) that uses .png files on models.

Note, I have only tested this with .ase files, not sure if this error occurs with other formats too. GtkRadiant reads the .ase file's *MATERIAL_NAME value to find the relative shaderpath to the texture so there is no file extension, example:

*MATERIAL_NAME "models/obsidian/plants/grass"

TTimo commented 12 years ago

Have you checked in the synapse config file and tried changing the order of the image formats? Although for models I'm not sure this is the right codepath, this may be done internally by picomodel.

On Wed, Jun 6, 2012 at 4:41 PM, 0bsidian < reply@reply.github.com

wrote:

Loading a model that uses a .png texture will crash GtkRadiant 1.6.2 on Windows.

It appears GtkRadiant will always try to read, and fail loading the .png file even if a same named .tga file exists. If both files exist, I think GtkRadiant should intelligently pick one over the other depending on the game (Quake 3 - load .tga over .png; Quake Live - load .png over .tga).

In my case, I had a grass.ase model that should have been using grass.tga file as the texture. I also had a grass.png file that was a 3ds Max render that I used as a preview of the model. It took me a while to figure out why GtkRadiant was crashing when loading the model, it kept trying to read the .png file and failed to load it. Renaming the image to grass-preview.png fixed the problem.

However, I can see this as being a problem for any games (Quake Live) that uses .png files on models.

Note, I have only tested this with .ase files, not sure if this error occurs with other formats too.


Reply to this email directly or view it on GitHub: https://github.com/TTimo/GtkRadiant/issues/70

0bsidian commented 12 years ago

Hmm, curiously.... reordering the image formats from "tga jpg png" to "png tga jpg" seems to make it work correctly, which seems a bit counter-intuitive.

shrugs

I've updated the Q3 gamepack to reflect this. Thanks, TTimo.

TTimo commented 12 years ago

Ah .. it's reading the extensions, and growing a list .. so it ends up reversed .. oh well :)

On Thu, Jun 7, 2012 at 11:50 AM, 0bsidian < reply@reply.github.com

wrote:

Hmm, curiously.... reordering the image formats from "tga jpg png" to "png tga jpg" seems to make it work correctly, which seems a bit counter-intuitive.

shrugs

I've updated the Q3 gamepack to reflect this.


Reply to this email directly or view it on GitHub: https://github.com/TTimo/GtkRadiant/issues/70#issuecomment-6181207