Lots of lights.

Blitz3D Forums/Blitz3D Programming/Lots of lights.

Cold Harbour(Posted 2004) [#1]
I’m starting to write a game again and I have a question about lights.

I remember a game from ages ago called Forsaken. In this game when you (or an enemy) fired a bullet the nearby textures would all light up and this 'local' illumination would follow the bullets around.

How is this done? Is there a separate light in each of these bullets and rockets? It seems obvious that there are but I ask because there were at times maybe 50 odd of these lit buttons flying around. I seem to remember there being a severe limitation on the number of lights you can use. Or is this fake lighting?

This game is pretty old and I think it was 3dfx so it’s not like the hardware was that amazing.

Thanks a lot.


Mustang(Posted 2004) [#2]
Using many true real-time lights is not a good thing to do, it will slow down everything considerably. I wouldn't use more than two lights, even if their ranges do not overlap because in reality the light range is almost infinitive. In fact, I would not use true lights at all, just cubemap lighting. And you don't have to attach light to EVERY bullet, one light for burst of bullets will be enough.


JoshK(Posted 2004) [#3]
Why do you call yourself sulfuric acid? Is this some kind of pseudo-chemist nerd appeal?

Anyways, what you want involves real-time calculation of uv coords to map a circular gradient texture rendered in a second pass. Don't listen to these guys talking about DX lights, they are crap.


AntonyWells(Posted 2004) [#4]
So that way halo, basically your mapping a lightmap across the reciever to simulate a good light source.

So basically, you have two options,

1, layer it as a texture, max of 2 lights even on a g5(if the other two are textures and lightmap)
2, do a second pass render of the level mesh with lights, max of 4 lights on a good card. but double your framerate.


Blitz light's work fine, you just have to use sub 1 values. like lightcolor mylight,1,0,0 for red, and mylight,0.5,0.5,0.5 for grey. i think 0-255 is a misprint in the manual..


Rob(Posted 2004) [#5]
You need combiners at rendertime according to carmack.
It's one feature that would benefit any blitz game and mark should have it in.

Fake lights are a worthy engine feature.


Rob(Posted 2004) [#6]
This may not be possible in current blitz implimentation due to surface organisation. Surfaces are blitz's way of grouping.

A fake light, or combined textures must light up the lightmap to reveal detail.

Therefore they need to be told which texture channel to affect.


JoshK(Posted 2004) [#7]
You're so far in the dust.


sswift(Posted 2004) [#8]
As Rob knows I was considering such a lighting system, but I am no longer convinced it can be done fast enough, or in a way which is easy for people to use. Even with the professional-grade clipping algorthms I coded into my shadow system, it still struggles, and the number of polygons a shadow actually hits and has to build for the shadow mesh is might lower than for a light.

It is my opinion that it would be faster, and almost as good looking to simply come up with a way to subdivide the walls and floors in your level more so that the vertex lighting looks better.


Rob(Posted 2004) [#9]
You're so far in the dust.
Yeah? I expect yours doesn't exactly run that fast. Just having it working is not enough.


Rob(Posted 2004) [#10]
I think the solution is probably going to be as simply as drawing pixels to a lightmap.

Or you could project uvs every frame from the camera to all visible verts to create a much higher resolution lightmap texture space, render some flare sprites to a buffer, copy to texture. That would be a reasonable speed, but the trick is to translate the flare sprite positions to 2D space effectively.


Cold Harbour(Posted 2004) [#11]
Thanks for all the suggestions.

It's a top down vertical shooter not one of your fancy FPS's. The map is made up of meshes at different z positions to simulate parallax.

So basically it's like using a lightmap texture but I'm just taking a chunk of the lit texture and using something like a mask or alpha channel to blend it with the normal texture.

Cheers.


Ruz(Posted 2004) [#12]
so can we expect a fake ligting system from you guys soon?


IPete2(Posted 2004) [#13]
Hey team!

I was just wondering, What does Halo use in the Singularity Engine? You know, in the SE3.03 map when the light from a gun blast travels realtime down all the walls, the floor and ceiling and on meshes which are close by where you are shooting?

IPete2.


RetroBooster(Posted 2004) [#14]
Good old dynamic lighting with a circular gradient texture (it's fake lighting rendered in a second pass). It may be dated but it works. ;)