[fixed]textures not working properly

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

[fixed]textures not working properly

Post by butthead_82 »

Hi everybody,

Sorry for being boring with textures again but something is not right with textures.

I export an X-file from Truespace7.6 and load it in Irrlicht. Mesh and bones load properly but textures do not.
The object is brown...because the texture is brownish, if I paint texture in red, for example, the object is red. It appears that loader takes color of one texel in texture and paints the model in that color.

Could someone take a look at this model, please:
http://download136.mediafire.com/owq9zh ... /Horse.rar

(Truespace also exports normal maps for textures but normal mapping is not applied here)

Thanks
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You haven't given the mesh texture coordinates. Or you haven't exported them. So each vertex in your model probably has texture coords of 0,0 and so just use the upper left pixel of the texture.

I don't know anything about Truespace but there could be an option to texture wrap the model or in the exporter there may be an option to export texture coords or materials or something...
Image Image Image
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

Post by butthead_82 »

But the model is textured fine in directX viewer. It couldn't be without tex coords.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Interesting... does the console output say anything nasty when you load the model in Irrlicht? Like... "oh noes, i dun't no wot diz iz"?

Otherwise i guess we'll have to wait for one of the devs to inspect your model closer.
Image Image Image
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

Post by butthead_82 »

I downloaded latest version of irrlicht from svn, there is no console showing.(can I enable it somehow?)

Do you have this line somewhere in one of your application files? If so, remove it, or comment it out, or make it conditional on being a release build.

Code: Select all

#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

it's to do with your project settings as to whether a console will be shown when you run your code.
Image Image Image
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

Post by butthead_82 »

Console says a lot of things about reading the file...

Image

At the end it says about loading the texture but it doesn't apply it right...

Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I'll fix this issue sometimes soon. The thing here is that texture coords are not stored explicitly, but inside the DeclData. Most tools avoid this behavior for better backwads compatibility, so we didn't need to support it until now. But since also Binormals and Tangents are stored in this format it seems reasonable to support it. Moreover, it doesn't seem to be too complex to support.
The normal map support of your file seems rather uncommon, though, because the DX SDK doesn't know about such a group... But it would be even simpler to support this second texture filename, so I'll add it as well.
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

Post by butthead_82 »

hybrid wrote:I'll fix this issue sometimes soon. The thing here is that texture coords are not stored explicitly, but inside the DeclData. Most tools avoid this behavior for better backwads compatibility, so we didn't need to support it until now. But since also Binormals and Tangents are stored in this format it seems reasonable to support it. Moreover, it doesn't seem to be too complex to support.
The normal map support of your file seems rather uncommon, though, because the DX SDK doesn't know about such a group... But it would be even simpler to support this second texture filename, so I'll add it as well.
Thanks for answer.
Could you tell me approximately when this could be supported? (just to know if I should change the tool I'm working with)
Or, could I modify my X-file manually to make it compatible with your loader?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Not manually, you could check whether your exporter allows to export UV coords explicitly instead of the binary FVF representation in DeclData. The format should be supported in Irrlicht 1.5, or if you use the SVN/trunk on monday or tuesday.
butthead_82
Posts: 41
Joined: Mon Jun 16, 2008 12:20 pm

Post by butthead_82 »

great
thank you for helping :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, revision 1646 fixes this. Normalmaps are not really used, only the texture gets loaded. This has to wait some more, just as the binormal/tangent loading support and other things...
Post Reply