No lights on BSP's

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
NatX
Posts: 5
Joined: Thu Jan 04, 2007 5:31 am

No lights on BSP's

Post by NatX »

This is my first post here, so Hello all!

I've been fighting with lights for the last 2 days and just can't seem to figure out what I'm doing wrong. I've tried multiple bsp files with and without lightmaps. All I'm trying to do is get one dynamic light to work. I'm using the Quake Level tutorial and have added the following lines for the light:

Code: Select all

node->setMaterialType(video::EMT_SOLID); //node is the level

scene::ISceneNode* lightNode = 0;
lightNode = smgr->addLightSceneNode(node, core::vector3df(0,0,0), video::SColorf(1.0f, 1.0f, 1.0f, 1.0f), 600.0f); 
I've tried quite a few different things including etcaptor's fix in CD3D9MaterialRenderer.h (Can't find the post now to link to)
It seems as though any cylinders get full light and everything else gets no light. Either way all mats ignore the light.
I'm using gtkRadiant 1.5 to create the levels, I've tried D3D9, OpenGl and Software renderer's and none seem to work.

Any ideas would be appreciated.
Even he, to whom most things that most people would think were pretty smart were pretty dumb, thought it was pretty smart.
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

There is another post by randomMesh further down this list. I am not having this problem as i use mainly my3d, x and obj format. I don't like the strict constraints the bsp format demands. It also limits you to certain editor like radiant, which are not easy to master unless you come from the modding scene. Please tell me, what advantage do you get taking this stony path? Maybe i have overseen a decisive advantage.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

R u sure ur not setting "(EMF_LIGHTING, false)"?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

Try this:

Code: Select all

node->setMaterialFlag(video::EMF_LIGHTING, true); 
node->setMaterialType(video::EMT_SOLID);
So dynamic lighting works like a charm.
xskinyx
Posts: 25
Joined: Fri Dec 29, 2006 3:28 am

Post by xskinyx »

you lose your lightmap though
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

He is already setting EMT_SOLID anyway...
NatX
Posts: 5
Joined: Thu Jan 04, 2007 5:31 am

I like Radiant :)

Post by NatX »

Please tell me, what advantage do you get taking this stony path?
It shouldn't be "stony" at all, I think gtkRadiant is one of the most simplistic level editor tools I've used and Irrlicht touts support for the format.

Blindside and randomMesh: Thanks for the tips, but I've tried

Code: Select all

node->setMaterialFlag(video::EMF_LIGHTING, true); 
But to no avail. I've also tried other experiments with loading 3ds models and lighting them, but get no lights (or very dim lights) on them either. I'm running an ATI X600 with fairly recent drivers so hardware T&L should be working, I get no shader errors on load. I am running off of the December 2006 DX SDK. I'm starting to think maybe there is a compatability issue somewhere. If I had to guess I'd say that maybe something within Irrlicht doesn't like how ATI does lights or shaders, but that's just grasping at straws.
Even he, to whom most things that most people would think were pretty smart were pretty dumb, thought it was pretty smart.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, ATI drivers are working in general. Can't say if there's some driver in between which makes problems. Maybe try your app on a different system. And try the binary examples found in the SDK which also use lights to see if your system works at all.
NatX
Posts: 5
Joined: Thu Jan 04, 2007 5:31 am

Still no lights on BSP

Post by NatX »

I tried the samples and sure enough they receive light. On further testing I was also able to see light on my other models as well. I guess I'll try another format for levels. Maplet looks similar to gtkRadiant.

Thanks for trying to help.
Even he, to whom most things that most people would think were pretty smart were pretty dumb, thought it was pretty smart.
xskinyx
Posts: 25
Joined: Fri Dec 29, 2006 3:28 am

Post by xskinyx »

when i load lights from my bsp maps they are much much much darker in irrlicht. try multiplying the brightness ten fold.

also you can only have 8 lights on at a time.
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

I have the same problem in my pentium 3 but there the problem is with my graphics card (or thats what i think it is)! Its a very very old card so i thought maybe it just doesnt have enough memory to load the lightmaps! What gfx card are you using?
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

Well I didn't want to start a whole new thread, but is there a way to have dynamic lights on BSPs? I tried Node->setMaterialType(EMT_LIGHTMAP_LIGHTING);

But that didn't work, Thanks!

Edit: I forgot to say I would like to be able to keep the lightmaps too, thank you :)
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It might be a problem with nice normals, but besides that you can just use LIGHTMAP_LIGHTING.
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

I've tried normalizing normals (if that's what you meant), I already tried the LIGHTMAP_LIGHTING thing, and I've also tried increasing the light's radius etc. It still doesn't let me use dynamic light, but that's okay. I'm going to use a different file format now :wink:
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

since setting the lighting on the single node of the BSP doesnt work, someone once posted code to run through the meshes in the bsp structure and set the lighting enable on each of them. if you search the forums, it shouldnt be too terribly hard to find.
Post Reply