Page 1 of 1

Another Light Problem (Solved)

Posted: Fri Sep 26, 2008 5:57 am
by armzajetset
Hi, I'm trying to build my project. At first I decided not to use lighting on it but it doesn't look so good. Now I'm trying to fix somelighting up and there're lots of problems.

I loaded 2 mesh on my scene (both in my3d format). First for collision checking (wall,floor ,etc..) and second one is for visual sight ( Buildings,trees,pole )

This is my scene without light.
ImageImage

And this is when I set EMF_LIGHTING with EMT_LIGHTMAP.

ImageImage

And last with EMF_LIGHTING and EMT_TRANS_ALPHA_CHANEL.

ImageImage

You'll see the poll is dark. but that's where i put my second light source. It seems not to be affected by light.

I don't know anything about lighting. I just put a light out there.

Code: Select all

	
light1 = smgr->addLightSceneNode(0, core::vector3df(4975.0f,-809.0f,-1697.0f), video::SColorf(0.5f, 0.5f, 0.5f, 0.5f), 30000.0f);

light2 = smgr->addLightSceneNode(0, core::vector3df(443.0f,-809.0f,1728.0f),video::SColorf(0.5f, 0.5f, 0.5f, 0.5f), 300.0f);


I tried it all , about reduce the light radius or increase it. I didn't have my lightmap as well (just export from 3dsmax). Anyway how did you guys do about light? is it just one spot like the sun or as much as it needed ?

Thanks in advance!

Posted: Fri Sep 26, 2008 6:17 am
by BlindSide
I suggest using a directional light. ELT_DIRECTIONAL. Look that up.

Posted: Fri Sep 26, 2008 6:33 am
by armzajetset
Do I need to declare new variable that is SLight ? So I'm using wrong type of light didn't I ?

Anyway can you give me an example of this SLight thing ?

Posted: Fri Sep 26, 2008 7:52 am
by hybrid
Maybe your light is inside the pole? Or the pole (column?) doesn't have proper normals, which can easily destroy any dynamic lighting effect.

Posted: Fri Sep 26, 2008 9:01 am
by armzajetset
What is normals? I've seen something like "normal map" and I didn't understand it.

Anyway my light source is not inside the pole. It's right on its feet (next to it feet :) )

Newb Question :

- When I want to use lighting on my scene do I have to generate light map for it ? (I don't know how to do it)

- Can you post me some example of SLight ?

PS. I'm using Irrlicht 1.2

EDIT: I've done a bit search and found something like "setLightData" but there's no "setLightData" in 1.2

EDIT2 :

I Think I know what is it.

Code: Select all

light1->getLightData().Type=ELT_DIRECTIONAL;
	light1->getLightData().Radius=50000.0f;
	light1->getLightData().Position = vector3df(77.0f,25000.0f,-134.0f);
	light1->getLightData().AmbientColor= video::SColorf(0.5f,0.5f,0.5f); 
At first I didn't set Ambient and Diffuse color so it went dark. This is what it look likes

ImageImage

Posted: Fri Sep 26, 2008 6:57 pm
by dlangdev
Wow, I'm impressed with the lighting.

Maybe that's why the second light is not lighting up the scene, it's casting a big shadow?

Posted: Fri Sep 26, 2008 8:33 pm
by dlangdev
I took a second look...

Man! that is one awesome render, perfect to the demo game I'm planning to make.

By the way, may I know what is your workflow?

Do you use Blender for modeling and animation?

Do you use Gile[s] for lightmapping?

If yes, maybe we could work together to create a simple game?

If no, then it's probably going to be tough working together on a project.

Posted: Sat Sep 27, 2008 2:03 am
by armzajetset
Thanks dlangdev.

Actually I'm just a project manager. This is my project for the national software contest. That's product from my 3d animator.

BTW. I'm using 3DSMax and don't know anything about light map (my 3D animator too, We're just newbie here.) :(