Fake lighting.

Community Forums/Showcase/Fake lighting.

Aussie(Posted 2010) [#1]
G'day everyone.
I had been playing around with creating a fake lighting function a fair while ago & then it got put to the side. I decided to dig it out the other day & keep working on it.
I finaly got it to work so i thought i would share it with everyone & you may use it as you wish.
It uses Lightmesh & only supports Omni lights.
Hope someone finds it usefull.

For use with B3D



jhocking(Posted 2010) [#2]
Any chance you could explain what you mean by "fake lighting"?


Ross C(Posted 2010) [#3]
He must mean not using a DX hardware light. It seems to use LightMesh function built into blitz. Looks interesting :)


puki(Posted 2010) [#4]
'Fake' lighting is the way to go.

I only just ran this and have to go to bed.

The point of 'fake' lighting is to use it close range - ie take over from hardware lighting - especially considering DX7 limits.

You can add a lot of nice touches into your game world with it and, in doing so, allowing you to shift the/redundant hardware lights into the distance, ready to LOD in the vertex lighting as you approach.

'Fake' lighting can go far beyond point lighting - it's just a case of how you apply the light to the geometry that governs what type of light it is - directional, point, spot, shaped/volumetric. You can control what each 'fake' light illuminates to allow you LOD it on-the-fly.


MadJack(Posted 2010) [#5]
I was taken with 'fake lighting' a while ago too;

http://www.blitzbasic.com/codearcs/codearcs.php?code=249

but I was looking at using it with a lot of actors and each 'fake lit' mesh has to be unique - no entitycopy - which quickly bogs Blitz3d down FPS wise...


Aussie(Posted 2010) [#6]
@ Jhocking. What Ross C said. It uses Lightmesh instead of DX Lights although they can both be used together. My system will only allow for 8 DX lights & eventualy if i want a room lit from torches on the wall, or to have big balls of plasma firing from a weapon & lighting up its surroundings i can have as many lights as i want.

@ Puki. It was actually a pice of code you wrote that got me playing with the Lightmesh http://www.blitzbasic.com/codearcs/codearcs.php?code=2020 Cheers for posting it. :) I saw some of the lighting you where playing around with on a Youtube Vid. Was that all using Lightmesh?

@ Madjack. I just found out about the copy entity & it apeared to apply the lighting to all of the meshes in the same way it dose for the original entity.

I have just found a couple of bugs with the coding. If a Fklightentity gets deleted i get an "Entity dose not exist" & it would seem that you can not change the alpha level of an entity. Will keep going & try to fix the problems. : )


MadJack(Posted 2010) [#7]
Aussie

You'd probably need to adjust the alpha level for each vertex to get overall alpha changes.

Regards lightmesh needing unique meshes (causing slowdown), I suppose if you had a game that perhaps dealt with limited individual rooms (like Doom3) and low numbers of actors, you could get away with it.