Hi,
i try to load Anim8or files in Irrlicht 3d (1.5 under Windows and Visual C++ 2005).
It seems to work with OpenGL but not with DirectX (9 and 8 ).
With OpenGL i have my texture with lights, but with DirectX 3D models are black. Why ?
You can download the .exe and the source code here (it is very simple)(Visual C++ 2005).
http://texel3d.free.fr/bugs/irrAn8Loader.zip
It depends on LibAn8:
http://texel3d.free.fr/projets/liban8/index.html
Thanks.
My models are black with DirectX
Texture and colors are displayed with:
model->setMaterialFlag(video::EMF_LIGHTING, false);
It tells me that the problem comes from lighting, but why ?
Why does it work with OpenGL ?
What's wong in the way i add my light ?
model->setMaterialFlag(video::EMF_LIGHTING, false);
It tells me that the problem comes from lighting, but why ?
Why does it work with OpenGL ?
What's wong in the way i add my light ?
Code: Select all
// Add a light
scene::ILightSceneNode* nodeLight = smgr->addLightSceneNode(0, core::vector3df(100,100,100),video::SColorf(1.0f,1.0f,1.0f,1.0f),20000.0f);
video::SLight light;
light.Type = video::ELT_POINT;
light.AmbientColor = video::SColorf(0.3f,0.3f,0.3f,1);
light.SpecularColor= video::SColorf(0.4f,0.4f,0.4f,1);
light.DiffuseColor = video::SColorf(1.0f,1.0f,1.0f,1);
light.CastShadows = false;
nodeLight->setLightData(light);
I have modified my model loader to use:
meshBuffer->Material.NormalizeNormals = true;
It do not solve the problem.
My vertices colors are white (for every vertices):
vertices[0].Color = video::SColor(255,255,255,255);
vertices[1].Color = video::SColor(255,255,255,255);
vertices[2].Color = video::SColor(255,255,255,255);
When i force emissive color of materials to be greater than zero, colors are displayed in DirectX.
But Lighting do not seems to be computed/used.
Colors should be used with emissive = (255,0,0,0) !?
And what about ligthing ?
And OpenGL always works very well...
Here is my material settings:
meshBuffer->Material.NormalizeNormals = true;
It do not solve the problem.
My vertices colors are white (for every vertices):
vertices[0].Color = video::SColor(255,255,255,255);
vertices[1].Color = video::SColor(255,255,255,255);
vertices[2].Color = video::SColor(255,255,255,255);
When i force emissive color of materials to be greater than zero, colors are displayed in DirectX.
But Lighting do not seems to be computed/used.
Colors should be used with emissive = (255,0,0,0) !?
And what about ligthing ?
And OpenGL always works very well...
Here is my material settings:
Code: Select all
meshBuffer->Material.Wireframe = false;
meshBuffer->Material.Lighting = true;
meshBuffer->Material.BackfaceCulling = true;
meshBuffer->Material.EmissiveColor.set(material->Alpha, material->EmissiveRGB[0], material->EmissiveRGB[1], material->EmissiveRGB[2]);
meshBuffer->Material.DiffuseColor.set(material->Alpha, material->DiffuseRGB[0], material->DiffuseRGB[1], material->DiffuseRGB[2]);
meshBuffer->Material.AmbientColor.set(material->Alpha, material->AmbiantRGB[0], material->AmbiantRGB[1], material->AmbiantRGB[2]);
meshBuffer->Material.SpecularColor.set(material->Alpha, material->SpecularRGB[0], material->SpecularRGB[1], material->SpecularRGB[2]);
meshBuffer->Material.Shininess = material->Brilliance;
meshBuffer->Material.NormalizeNormals = true;
My problem comes from lights and not from my mesh.
(i have converted my .an8 file to .3DS and i have the same problem)
Is there a complet tutorial about how to use Directional light (and light in general) with irrlicht ?
I can't do what i want. The result are different with DirectX and OpenGL. The example codes do not use light a lot.
(i have converted my .an8 file to .3DS and i have the same problem)
Is there a complet tutorial about how to use Directional light (and light in general) with irrlicht ?
I can't do what i want. The result are different with DirectX and OpenGL. The example codes do not use light a lot.