Another Light Problem (Solved)

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
armzajetset
Posts: 40
Joined: Tue Mar 13, 2007 9:23 am
Location: Thailand

Another Light Problem (Solved)

Post 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!
Last edited by armzajetset on Fri Sep 26, 2008 1:07 pm, edited 1 time in total.
Image Irrlicht NewBie~*
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I suggest using a directional light. ELT_DIRECTIONAL. Look that up.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
armzajetset
Posts: 40
Joined: Tue Mar 13, 2007 9:23 am
Location: Thailand

Post 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 ?
Image Irrlicht NewBie~*
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
armzajetset
Posts: 40
Joined: Tue Mar 13, 2007 9:23 am
Location: Thailand

Post 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
Image Irrlicht NewBie~*
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post 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?
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post 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.
Image
armzajetset
Posts: 40
Joined: Tue Mar 13, 2007 9:23 am
Location: Thailand

Post 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.) :(
Image Irrlicht NewBie~*
Post Reply