global lighting

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
WhytWulf
Posts: 51
Joined: Mon Sep 08, 2003 11:14 am
Location: Australia, Tamworth, NSW
Contact:

global lighting

Post by WhytWulf »

is there any function for global illumination. also known as ambient lighting, which is not dependant on the map mesh being loaded.
IE in a BSP file without change the overall map lighting, or including additional lights in the map, or for instance an OBJ file which doesn't have lighting information included..

I mentioned to CLeaves about a method of dropping markers/waypoints to denote object loactions, and descided to use that to drop lights around a non-BSP mesh in a fly-thru type mode..

but I would like to be able to see the map with light, without light and adjust the global lighting at various stages when dropping the lights..
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Maybe setAmbientLight() of IVideoDriver helps you: http://irrlicht.sourceforge.net/docu/cl ... r.html#a32
WhytWulf
Posts: 51
Joined: Mon Sep 08, 2003 11:14 am
Location: Australia, Tamworth, NSW
Contact:

Post by WhytWulf »

yay, finally tried to use the
setAmbientLight()
and what I got was not quite what I had expected. See screeen shots for details

this is default lighting
http://shadowrunonline.sourceforge.net/ ... ghting.jpg

lighting with settings of driver->setAmbientLight(video::SColor(0,0,0,255));
http://shadowrunonline.sourceforge.net/ ... hting2.jpg

and with driver->setAmbientLight(video::SColor(255,255,255,255));
http://shadowrunonline.sourceforge.net/ ... hting3.jpg

as you can I have noidea why the colour turned purple'ish in the second screen, but what is not happening is the map is not changing in illumination when I make the changes..

(you can also see my attempts at rain :) )
Project Admin -
http://shadowrunonline.sourceforge.net

------------------------------------
There are 10 kinds of people, those that understand binary and those that don't.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

The rain looks cool, yes. :)
The reason why your .bsp map is not influenced by light is because I did not want it to be. EMT_LIGHTMAP only uses a Texture and a Lightmap, ignoring the dynamic light. You could set the Material to EMT_SOLID. In this way the lightmap is ignored, but dynamic light influences the shading of the triangles. If you need something like EMT_LIGHTMAP_WITH_DYNAMIC_LIGHT (ok, maybe another name, this is to long), just say it. :)
WhytWulf
Posts: 51
Joined: Mon Sep 08, 2003 11:14 am
Location: Australia, Tamworth, NSW
Contact:

Post by WhytWulf »

errr.. IT

EMT_DYNAMIC_LIGHTMAP ??
Project Admin -
http://shadowrunonline.sourceforge.net

------------------------------------
There are 10 kinds of people, those that understand binary and those that don't.
WhytWulf
Posts: 51
Joined: Mon Sep 08, 2003 11:14 am
Location: Australia, Tamworth, NSW
Contact:

Post by WhytWulf »

After a bit more looking and playing around, with setMaterial...etc..

I can get the dynamic light to effect the BSP, by casting light onto it

Code: Select all

....
zoneLevelNode->setMaterialType(video::EMT_SOLID);
zoneLevelNode->setMaterialFlag(video::EMF_LIGHTING, true);
....
results in an effect that I'm kind of after (it does have a few issues, like the light is not stopped by walls etc...(yet)... so if you can imagine this scene
in daytime, flag the dynamic lights to be turned off (I would like to have a great big omni light (sun) to cast day shadows. at twilight, change ambientLight (probably on a timer set from the server), and flag all dynamic light to be turned on.. simulating street lighting, etc.etc.etc....(that is the goal, of all this lightling business :) )
Project Admin -
http://shadowrunonline.sourceforge.net

------------------------------------
There are 10 kinds of people, those that understand binary and those that don't.
boredom

Post by boredom »

@niko:

I would love to see an option for using both lightmaps and dynamic lights on a bsp!!

:) :)
hell_bird

Post by hell_bird »

i really need it too!
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

on my TODO list ;)
MG

Post by MG »

I need this feature too. Do you think that this feature will be to the end this year? Because i would had to look for other engine, but this is verry good :!:
HLE (Guest)

Post by HLE (Guest) »

I have yet to use Irrlicht, I'm looking at all the open source engines and trying to decide which one. Irrlicht looks really good, and its demos actually work, unlike 90% of the other projects I've seen! However the lack of dynamic lighting on the bsp maps is a big weakness because it is such an important part of the atmosphere of a map. I'd suggest that it needs some lighting system like Quake3, where the lights in the map not only produce lightmaps but actually light the dynamic things as well, like seeing your gunbarrel go red when you run over lava or the side of the gun turn blue when you run past a light on the wall.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Sorry to bring this thread to life after such a long time, but has anyone found the reason this doesn't work in 0.4.2

--The Robomaniac
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

Post by hell_bird »

you can do it yourself:

put in the code of EMT_LIGHTMAP instead of

pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE);
pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);

this:

pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);

i can send you a precompiled dll (for visual c++).

edit: oh sorry, i forgot-> this will only work for d3d...
Post Reply