Hardware lights on lightmaps

Blitz3D Forums/Blitz3D Programming/Hardware lights on lightmaps

John Blackledge(Posted 2004) [#1]
Please check me if I'm wrong:
I use flickering (hardware) lights as wall torches.
So far I've used .X meshes - no problem.
Then I used .B3D meshes - still no problem.
But .B3D meshes + lightmap - flickering lights now have literally _no_ effect on the walls of my level.
Do hardware lights have _no_ effect on a lightmapped mesh?


Isaac P(Posted 2004) [#2]
check that your mesh is not set as fullbright, some b3d exporters export .b3d files as fullbright by default.


Kozmi(Posted 2004) [#3]
John,

Im' having the same problem you are with my player's torch in my egyptian level im' making! I got this real cool looking hand held torch for my player and all for this dark egyptian tomb like level, But the hardware light has no effect at all on my level's walls... :( So it sounds like your in the same boat as I am.

Wish I could help ya' out here... But I am needing the same thing as you are... Let me know if you end up figuring this out ok? Or I'll let you know if I do!


9572AD(Posted 2004) [#4]
As Tainted said, lightmapped meshes are generally set to fullbright.


Rob(Posted 2004) [#5]
Change the EntityFx for your level (and children if loaded as loadanimmesh)


Kozmi(Posted 2004) [#6]
hmmmm,

I'll give it a go around and see what happens! Thank's guys! ;)


Mustang(Posted 2004) [#7]
Usually it looks REALLY bad if you try to use real-time lights on levels that have been lightmapped... lightmaps are pre-calculated ligting and they don't look correct anymore if you disable full-bright mode and add real-time lights. If you have very dark corners on your lightmaps, no ("real") light is going to lit them anyway, they stay dark.


Paolo(Posted 2004) [#8]
hmmmmm, at the moment I have found a solution for this but it is not going to be so useful if your levels has a lot of polys.

The solution is load your lightmapped level, then load the same level but WITHOUT lightmaps (only textures) and ENTITYBLEND(3) this level, this way a hardware light will affect this new level and will produce a really nice bright effect over the lightmapped one... :)
But as you may guess, this means doble the polycount... so...

Paolo.


John Blackledge(Posted 2004) [#9]
That's no go on that one Paulo.
But let me add one more thing: Maplet created meshes/lightmaps _will_ respond to harware lights, but Quill3D meshes/lightmaps _won't_ (arrgghh! I paid for that prog!).
Anyone using Quill who has found a solution?
How do I set _not_ full bright on export?
@Rob: EntityFX set to what?
@DoctorWho: dying to see your level!
Keep at it guys, I really appreciate the help.


Beaker(Posted 2004) [#10]
Try EntityFX with flags set to 0.


John Blackledge(Posted 2004) [#11]
No. EntityFX set to 0 produces no change.
Somebody, please.....
How can Maplet do this fine, but Quill's output disables hardware lights?
C'mon let's hear from one of the geniuses!
Rob, sswift, anybody...... take pity.


Dreamora(Posted 2004) [#12]
inexistant hardware light -> no normals in the model. Realtime light needs normals as the brightness is calculated basing on lightdirection - lightintensity and the surfaces normal

try updatenormals mesh, perhaps it helps


John Blackledge(Posted 2004) [#13]
Dreamora, you've cracked it! - UpdateNormals mesh.
Who would have thought?
Unfortunately now some of my surfaces are strangely extra dark next to very light ones, but on the whole my flickering torches work - maybe I just need to check my vertices.
Thanks for that.


Zenith(Posted 2004) [#14]
Since when was Rob a genius? He's an ogre! *hides behind his ogre mug*


John Blackledge(Posted 2004) [#15]
OK. Just for info, but especially for DoctorWho, these are the steps I _had_ to take:
1) Create model in favourite modeller.
2) Export as .X
3) Load into Decorator.
4) Immediately save out as .B3D
5) Load into Quill.
6) Create and save lightmap.
7) Save scene out of Quill as .B3D.
The Decorator step is essential, else the model will _still_ not react to hardware lights.
By the way, I'd really like to know what other lightmappers people are using?


Mustang(Posted 2004) [#16]
By the way, I'd really like to know what other lightmappers people are using?


There can be only one:

http://www.frecle.net/giles/home.htm


_PJ_(Posted 2004) [#17]
Dunno if the answers I received here are any help:
sounds kinda similar...

http://www.blitzbasic.com/Community/posts.php?topic=30707


John Blackledge(Posted 2004) [#18]
Thanks Malice - some interesting questions and answers there.
I think it would be worth me reiterating that Maplet produced a 'torch-lightable' lightmapped model, no problem.
But my .X model put through Quill would not.
ExtityFx model,0 had _no_ effect.
Only by loading the .X into Decorator, saving as .B3D, loading into Quill, lightmapping, saving again as .B3D, and _also_ using 'UpdateNormals model' could I get it to react to torch lights.
So does everyone else use Giles for lightmapping?


JoshK(Posted 2004) [#19]
You need to use "decal" lights on your walls, like Half-Life does.


John Blackledge(Posted 2004) [#20]
I think I understand what you mean, but I'm more interesting in the 'flickering torch' effect generally around a dark (previously) lightmapped room.
And hardware lights are ok for that as long as the room reacts properly, as bescribed above.


JoshK(Posted 2004) [#21]
You could just create a second copy of the lightmap, slightly lighter in the places you want, and set the texture blend of one lightmap to 0, then switch them back and forth every 40 milliseconds or so.


D4NM4N(Posted 2004) [#22]
Sussed it!!!

my code is for cartogrtaphy shop 4 B3d files, but i think the principals are the same.
This code extracts all the entity data, creates lights and blends the textures to accept HW lights.

Its a bit messy (took me an hour), it does not attach the light entities to the parent, clear up tempory textures or brushes. But you can do that yourself (may need doing to prevent memory probs).

http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=1053


D4NM4N(Posted 2004) [#23]
Ahh bugger, the code archive thing is limeted to a few lines but if anyone wants it, email me : danontour2002@...


John Blackledge(Posted 2004) [#24]
I think we're losing track here; I don't want multiple renders or anything like that, just a hardware light flickering torch effect generally affecting a darkened room; and I've sussed it, as described above. Still, thanks to all who have thrown their ideas in.


D4NM4N(Posted 2004) [#25]
that thread ( www.blitzbasic.co.nz/codearcs/codearcs.php?code=1053 ) is now working. use this code wisely as it can really bugger up the look of the map.
For your torch, i recommend a realtime adjustment of the nearby lightmaps (using - EntityDistance(to lightrange) AND EntityVisable to either seriously brighten the maps when the torch is on or use a textureblend of 0 then switch it back to 3 when turned off.

Whos the man, DANZTHEMAN!


John Blackledge(Posted 2004) [#26]
Dan, my buildings are loaded in as separate entities from the terrain, so I guess this system is not for me. If you could send the b3d as well as the code I'll test it.
But as I said above, the problem is solved.


JoshK(Posted 2004) [#27]
You need to use two copies of your lightmap, one slightly brighter, and turn the textureblend on and off. This will give a flicker without eliminating shadows...and it's fast.