yet another lighting question

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
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

yet another lighting question

Post by WToma »

i try to display 3ds files with irrlicht (0.11)
for some models lighting works correcty, the unlighted polygons appear black.
but for some others, I can see all polygons in its own colors. the lighted ones appear only brighter.
what can be the problem? what should I set?
Toma
"This is not a bug, this is a feature!"
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

I wouldn't say that Irrlicht's lighting system is all that great... I'm trying to figure these bugs out myself, it could be the normals.
________
Friday night lights advice
Last edited by disanti on Thu Feb 24, 2011 10:38 am, edited 1 time in total.
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

Someone correct me here if I am wrong...
but from what I understand, if you have a line like this:

Code: Select all

node->setMaterialFlag(video::EMF_LIGHTING, false);
then the material will just show up with the model, but if that value is set to true, then it will be relying on the lights that you add in by code to be able to see colors and materials.
At least that's been my impression.
I think a good lighting tutorial would be useful.

As a CG artist by profession, I can tell you that lighting and texturing are what seperates OK-ish work to "WOW"
You can train a monkey to place and manipulate primitives.

Anyway, since Irrlicht does have its own lighting system, it would be interesting to see various techniques.
This is a subject I'm trying to make the time to really jump into, but alas...there is never enough time.
(sorry for ramble)
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

Post by WToma »

Well, about EMF_LIGHTING I have the same opinion. But is was not the solution. It was MY3D format that saved my life. Now I am happy and I put back the rope for harder times :)
Toma
ps: 3DS sux, MY3S for president! :D
"This is not a bug, this is a feature!"
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

MY3D came along and saved your life within the past 5 hours?
wow.
So, does your original question pertain to the *3ds format or the *.My3D?

The only problem I have with MY3D are that the file sizes seem HUGE. I don't how much of a problem this might pose with the size levels that I want to achieve, maybe not at all.

Does anyone know if there is a performance issue related to model file size or poly count?
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

Post by WToma »

The orginial question was about 3DS. But it's not a problem to use My3D since there is exporter for 3ds max (3ds to my3d: import the 3ds into max then export to my3d). I don't know what was the difference in the 3ds files, but it isn't important any more.
I think files are bigger because my3d stores additional information about the models (lightmaps, i think). And of course, the more polys you have, the more cpu time will be needed to draw everything.
Toma
"This is not a bug, this is a feature!"
Guest

Post by Guest »

yet another one ;)
can I place directional lights to the scene? addLightSceneNode places only a pointlight, doesn't it?
Toma
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

I don't think so.
Nothing I could find in the API anyway...
I think it is only like an omni light.
A dircetional light would be very cool to have though...feel like coding one up?
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

Post by WToma »

Well, I will need it.
OpenGL supports it, but I have never coded in DX. Anyway, I must try it. I'll post my code here as soon as I manage to make it work.
Toma
"This is not a bug, this is a feature!"
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

Post by WToma »

OK, it is up and working.
You can download it from here: http://sohivatal.uw.hu/dev/directional_light_patch.zip or from here: http://szerver2.radnoti-szeged.sulinet. ... _patch.zip
(note, the first is a hungarian free webspace provider, the second is the public server of my school and they may have very little bandwidth outside Hungary. if you find the source useful, please mirror it to your webspaces)
License: which Irrlicht has
Manual
Installation: simply update Irrlicht source with the files you got in the ZIP file. Build the source. It should compile without warning. Don't forget to use the new headers and binaries (.a, .dll, .lib)
Usage: to create a directional light, call

Code: Select all

ISceneManager::addDirectionalLightSceneNode
parameters:

Code: Select all

ISceneNode* parent node, can be NULL
vector3df& position of the light source (default: 0,0,0)
vector3df& direction of the light source (degrees) (default: 0,0,-1)
SColorf color of the light (default: full white)
f32 radius of th light (default: 100)
s32 id (default: -1)
return value:
an IDirectionalLightSceneNode pointer. You can use all functions you can use with an ILightSceneNode.
Notes
1. for OpenGL-ers: the cutoff angle is 90°, you can change in COpenGLDriver.cpp line 1618
2. there is an example/test source in the dirlight_test directory.
3. Tested with OpenGL, DX8 and DX9) renderers. Not implemented in software renderer.
Enjoy and use it on your own risk! ;)
Toma
"This is not a bug, this is a feature!"
Post Reply