misc_model texture

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Fabio451
Posts: 17
Joined: Sun Nov 08, 2015 4:50 pm

misc_model texture

Post by Fabio451 »

Hi.
In NetRadiant I put a misc_model (a 3ds file) into the map.
I use _remap to set textures, then compile everything to get the BSP file.
Loading it in my program with IrrLicht, the model texture looks ugly (see image).
Something missing? Can be due to the UV mapping in the original file? Any clue?

Thanks.

https://www.dropbox.com/s/pjlipz5kvzb1a ... _model.png
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: misc_model texture

Post by CuteAlien »

Does that chair really have a texture in Irrlicht? It looks l ike it's just raw polygons - unless the texture is completely gray. Do you get any debug-output about the texture-loading?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: misc_model texture

Post by hendu »

I can't see your picture, dropbox is broken for some reason. Can you post to imgur?
Fabio451
Posts: 17
Joined: Sun Nov 08, 2015 4:50 pm

Re: misc_model texture

Post by Fabio451 »

Hi hendu, try this link: http://imgur.com/xbn72hM
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: misc_model texture

Post by hendu »

Funky. In addition to doing what Cutealien said, put a shader on that displays UV coords to debug that.
Fabio451
Posts: 17
Joined: Sun Nov 08, 2015 4:50 pm

Re: misc_model texture

Post by Fabio451 »

Made some progress.
CuteAlien was right, there were no texture applied on the mesh.
I fixed this, but the result was the same with a different color :)
This time I tried making the UV mapping inside Blender and then exporting as .obj file with .mtl file too, instead of 3ds.
Things go better, but still not perfect and it seems that some triangles are missing.
Maybe I have to set the right options when exporting from Blender.

Screenshot: http://imgur.com/xpncd8u

Bye
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: misc_model texture

Post by hendu »

There is a limit to how small triangles the BSP compiler will include. Remember it was made for Q3 scale, where 32 units = 1 meter.

You should instead of storing it in the BSP just store its file name, then load it in your program. Alternatively, edit the BSP compiler and change the define.
Fabio451
Posts: 17
Joined: Sun Nov 08, 2015 4:50 pm

Re: misc_model texture

Post by Fabio451 »

Thanks, Hendu.
In fact decreasing the number of faces no triangle is missing. ;)

For the other solution, is there a way to store the object file name in NetRadiant?
I heard about a placeholder entity called "misc_model_static", but I don't see it in my menu.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: misc_model texture

Post by hendu »

You can add your own entities by editing the netradiant files. They can have arbitrary properties, and you can then query these strings. Search the files for the existing names and copy one.
Fabio451
Posts: 17
Joined: Sun Nov 08, 2015 4:50 pm

Re: misc_model texture

Post by Fabio451 »

Thanks for your help.
It works well with 3ds format too.
Reducing the number of faces and making a suitable UV mapping the result is pretty good.
Post Reply