Page 1 of 1

Irredit - black meshs = no texture

Posted: Fri Jan 02, 2009 9:15 pm
by IrrNoob
I resently got around to looking at example 15 which gives details about
loading .irr files in Irrlicht.

I'm new to IrrEdit and so after loading the example.irr i made a custom .irr file to see what I could do. The scene calls for the default skybox and a terrain mesh i made out of a .3ds file.

However while making the custom .irr file in IrrEdit, I noticed that the terrain mesh wasn't rendering and the console was telling me it was unable to open the terrain.3ds file nor the texture for the mesh.

I then noticed that the file path was wrong as seen in the console, and tried fixing it in IrrEdit, but after correcting the file path the mesh turns black and will not show its texture, even though now the console says that it is finding the file.

Does anyone know what I'm doing wrong?

Posted: Fri Jan 02, 2009 9:22 pm
by bitplane
Did you add a light?

Posted: Fri Jan 02, 2009 9:58 pm
by IrrNoob
Yes, but nothing is different.

Posted: Fri Jan 02, 2009 10:00 pm
by ayboangelus
Have you disable your light when you have created your character in 3D.

Try with another.

Posted: Fri Jan 02, 2009 10:15 pm
by IrrNoob
I used Blender 3d to build a small plane of about a hundred polys and exported it as a .x, 3ds, and md2, but none of these worked.

Something i may need to explain is that the mesh becomes black in IrrEdit, no matter the format or light positioning. It becomes black when I point IrrEdit towards the correct paths of my mesh file.

However, before doing this, my custom grass.jpg texture is showing correctly on the terrain mesh.

but i need to correct the default

Code: Select all

../../../lib/irrlicht-1.5/examples/Game/media/Terrain.3ds
problem the file paths are set to when adding the mesh in IrrEdit, so that the .irr file will read the correct

Code: Select all

c:/lib/irrlicht-1.5/examples/Game/media/Terrain.3ds

Posted: Fri Jan 02, 2009 10:38 pm
by IrrNoob
ayboangelus wrote:Have you disable your light
Ok, I get what your saying. You want want me to disable the light on the mesh in IrrEdit, correct? In any case this does solve the first problem.
Thanks

But how would I create a light to make light and shadows on the mesh?

Posted: Fri Jan 02, 2009 11:17 pm
by ayboangelus
try with it :
scenegraph->setAmbientLight (video::SColorf(1.0,1.0,1.0,0.0));


^^

for diffuse light:
scenegraph->addLightSceneNode (0, core::vector3df(0,0,0), video::SColorf(0.4f,0.4f,0.6f,0.0f), 100.0f);

Posted: Sat Jan 03, 2009 12:06 am
by IrrNoob
ayboangelus wrote:try with it :
scenegraph->setAmbientLight (video::SColorf(1.0,1.0,1.0,0.0));


^^

for diffuse light:
scenegraph->addLightSceneNode (0, core::vector3df(0,0,0), video::SColorf(0.4f,0.4f,0.6f,0.0f), 100.0f);
Thanks, I'm starting to get the hang of IrrEdit.

Posted: Sat Jan 03, 2009 2:08 pm
by Velud
when the program loads a scene, it uses pathes that irredit used. so if texutre was in the same folder as irredit the path was from irredit exe file.
when the program loads scene it try to find texures in own folder.
but I amn't coplitely sure in it.

Posted: Sat Jan 03, 2009 2:14 pm
by zillion42
I had black models when exporting from maya, it helped a lot to set the vertex color to white before exporting....
Also in irredit you can set a working directory to reflect the same path as your textures...
hope it helps...

Posted: Sat Jan 03, 2009 11:49 pm
by IrrNoob
Ive since learned abit about using IrrEdit, its quite simple to learn really, and figured out why my terrain model was turning black, as I had placed no lights in the scene and hadn't figured out how to use the light ray caster doohicky.

Now I'm trying to figure out how to do simple collisions with a .irr file.
I'll make another questionary topic about that in a day or two if I can't figure that out. but so far the models load with terrain shadowed nicely, and it took just a little tinkering to find how to set the radius of a light, for example.