Real-time, dynamic, striplighting in Blitz3D

Community Forums/Showcase/Real-time, dynamic, striplighting in Blitz3D

puki(Posted 2009) [#1]


I've not seen this done before in Blitz3D. Although, I take into account it is not that hard to achieve.

The striplight pictured is irrelevent as it is not the actual striplight mesh/model. I just made the light mesh out of 2 spheres connected by cylinders to demonstrate it.

It is the light being cast on the surface that is important.

I have dropped the light close to a surface to show it is a striplight and is lighting as such. Obviously, as with a real striplight, if it is not near a surface then you cannot see it is a striplight casting the light.

The light can be moved and rotated dynamically over a surface, or multiple, surfaces and continue to real-time striplight a surface, or multiple surfaces.

This is real-time lighting. Of course, you can have whatever colour you want.

It doesn't have to be a striplight - this technique can create a square light, or a zig-zag light - even a "Mickey Mouse"-shaped light. It can also create multicoloured lights - ie imagine a neon sign which uses more than one tube colour.


Personally, I find it very exciting; however, I will understand if people deem it useless and boring.


EDIT:
I should have pointed out that no hardware (DX lights) are used.


Warner(Posted 2009) [#2]
Nice work!


ImaginaryHuman(Posted 2009) [#3]
Pretty neat, I can imagine a neon-encrusted game world.


RifRaf(Posted 2009) [#4]
Its only exciting if its fast. Show us a demo or video in a real scene :)


puki(Posted 2009) [#5]
Pretty fast. You can switch on and off the 'light-cells' in the tube, so you can control just how many are lighting a mesh - ie you can just enable every other cell of projected light or skip two, use one, skip 2, use one, etc.

Bare in mind you would only light very near services with the 'striplight' method. Other that that it is a glorified, stretched, point light.


Naughty Alien(Posted 2009) [#6]
Dr.Puki, do you mind to show your magic trick?


puki(Posted 2009) [#7]
It is part of the pLS - '"puki" Lighting System'.

I showed a picture of it in my first post.


*(Posted 2009) [#8]
You using vertex colour, EFPS (that was used in Hunted) now uses vertex lighting and sees what vertices the light can see and what the light will reach and in what intensity the good thing about that is I can have as many lights as I want and they dont slow the engine down a jot and work on old hardware.


puki(Posted 2009) [#9]


This is an example with 3 striplights with every other light-cell deactivated.

EDIT:
The red tube is pitching into the ground. The other two (red and blue) are just rotating flat.


*(Posted 2009) [#10]
would be nice to see a demo of this


puki(Posted 2009) [#11]
Stripey light (with a crude physical light mesh of cylinders and spheres):



EDIT:
The cylinders and spheres are scaled to .03,.03,.03


Uncle(Posted 2009) [#12]
Cool. Now strap it on top of cop car and make them spin around in real time, with the light bouncing off some walls :)


puki(Posted 2009) [#13]
Yeh, you can do that - they can light multiple surfaces/meshes.

It is just a case of projecting the transformation per surface or mesh. The lighting is unique per surface/mesh, so you can alter lighting density/strength and position uniquely, per surface/mesh.


nawi(Posted 2009) [#14]
Do you just loop through every vertex, then calculate how much light that vertex has from angle and distance, then apply that to vertex color?


puki(Posted 2009) [#15]
Looping through vertices is far too costly. There is no form of picking going on either - that also would be too costly.


MikhailV(Posted 2009) [#16]
Great ;)


nawi(Posted 2009) [#17]
Well, puki, why don't you describe your technique or release some sources? Otherwise this thread is quite pointless.


Wiebo(Posted 2009) [#18]
No nawi, it isn't, as this is the Showcase threat, not the code archives.

This is fun to watch develop. Add more stuff as you go along Puki!


skn3(Posted 2009) [#19]
Looks cool. Why would he have to share the "recipee", can you not admire the tasty cookies infront of you?

Would be interesting to see a little youtube video!

It kinda looks like it is proecting blob sprites onto the floor...


puki(Posted 2009) [#20]
No blob sprites - this is real-time, dynamic, lighting.


Ian Thompson(Posted 2009) [#21]
Looks like a nice effect, well done!


puki(Posted 2009) [#22]
I uploaded a video to YouTube: http://www.youtube.com/watch?v=qkLSi31v2F8

The footage seems choppy at the beginning - that is due to me moving the camera closer to the tube.

EDIT:
Having to convert and compress the footage didn't help the quality or fluidity, but you will get the idea of it.


InvisibleKid(Posted 2009) [#23]
thats pretty cool looking puki. i agree with Uncle in that you should attach it to a cop car, and have it go around a fake neibourhood block, that would deffinately be cool to see. or maybe have a soda machine in a corner casting a randomly flickering light (multiple colors for the effect of the light shining through the plastic front cover.)


RifRaf(Posted 2009) [#24]
Yeah the video looks very slugish from start to finish. Should have had fraps running to show fps.

I was curious about the light range as well, all the shots and your vid have a fairly small range, is this just your choice for show, or a limitation of the system ?


puki(Posted 2009) [#25]
Range is not a factor. The example shows micro-lighting.

If you pull the striplight away from a surface it will eventually blend the light, as it would do in real-life. The whole point of the video was to keep the light close to the surface. I was just proving the fact that it is real-time and that it can move and light at the same time.


puki(Posted 2009) [#26]
Anyway, this whole striplighting thing is just an offshoot of my lighting system. I'm just toying with it at the moment.

The main basis of the system is to put light on a leash. I was fed up of light passing through surfaces, so I decided to create my own real-time lighting system. So, if a wall is in the way of a light, it won't shine through, etc.


Kryzon(Posted 2009) [#27]
How fast is it? did you analyse the performance on extreme situations?


puki(Posted 2009) [#28]
Fast enough for me - I'm using high poly meshes.

You lot should make some striplights and test the performance.

I don't like the fake, textured, striplights on the doors/walls in Doom 3:



I wanted proper ones - so I went ahead and developed them. They work.


RifRaf(Posted 2009) [#29]
well doesnt look like you want to spill the beans :) so i took a crack at it.. about 15 minutes worth.

This could easily expand into somthing better, but I only did this while waiting on my dinner. Wich should be about ready now :).

EDIT.. updated I had a small typo in there , I also added a global light so that it wasnt two lights in complete darkness




puki(Posted 2009) [#30]
So how close is this puki ?

Not close enough.


RifRaf(Posted 2009) [#31]
Not close enough.


Close enough for ?
if theres a prize, it has to be over 500.00 USD, 15 minutes is all you get for free :)


Kryzon(Posted 2009) [#32]
Why did you use LightMesh?
Remember that puki posted a vertex lighting thread a while ago, so I think he's lighting manually the vertices, based on the distance from lights and stuff like that, simple occlusion verification using linepicks, etc.


RifRaf(Posted 2009) [#33]
Why did you use LightMesh?


Because lightmesh is faster than manually running through the verts and checking anything.


Remember that puki posted a vertex lighting thread a while ago, so I think he's lighting manually the verticesLooping through vertices is far too


...hm :)


puki (Posted 1 day ago) #15

Looping through vertices is far too costly. There is no form of picking going on either - that also would be too costly..


im pretty sure hes breaking the meshes apart to small peices and doing close to what i have posted there, but only he can clarify that, and I think hes enjoying the attention too much to let it go just yet :)


Kryzon(Posted 2009) [#34]
You're probably right :D


skn3(Posted 2009) [#35]
Looks cool however it is being done :)


MikhailV(Posted 2009) [#36]
And my simple example :)




RifRaf(Posted 2009) [#37]
I guess you really need a subdivided quad on the ground to show this. I hope you dont mind MikhailV, I added createsquare to my example too :)
Only I made a small array of squares so the light will not illuminate those sections not visible to each light entity.


MikhailV(Posted 2009) [#38]
@RifRaf: This is a simplest example, made for 5 minutes :) I think Puki too uses LightMesh function.


WERDNA(Posted 2009) [#39]
Very nice puki!

You seem to be pretty good at doing lights, because this isn't the first
time you've shown off your lights in the show case :)

I think it looks very cool.
(Although a cop car would look even cooler)

WALNUT


Nate the Great(Posted 2009) [#40]
I have unlocked puki's secret!

in this image


(I hope you dont mind me borrowing it puki)

look at the white light... does it not look like the white "strip" light is in reality 4 point lights? just pointing out the obvious...


RifRaf(Posted 2009) [#41]
does it not look like the white "strip" light is in reality 4 point


I thought this was out in the open from the start :)

This is an example with 3 striplights with every other light-cell deactivated.



Nate the Great(Posted 2009) [#42]
3 striplights with every other light-cell deactivated.


oh my bad..

so whats that supposed to mean?


Ked(Posted 2009) [#43]
It means the mesh is split up into a number of "light-cells", with every other light-cell deactivated.


Nate the Great(Posted 2009) [#44]
oh ok

so puki do you have shadow effects with this pLS (puki lighting system)? or no?


Snixx(Posted 2009) [#45]
Isnt it just a projected mesh for each "light" with a gradient texture on it?


puki(Posted 2009) [#46]
Here, have a free book (worth £45.99/ $59.99):
http://http.developer.nvidia.com/GPUGems/gpugems_copyrightpg.html

"puki" clutches his Blitz3D teddy bear and scampers off in search of sweeties.


Nate the Great(Posted 2009) [#47]
Isnt it just a projected mesh for each "light" with a gradient texture on it?


no that would be way too slow. Im sure MikhailV hit the nail on the head with his example.


Ross C(Posted 2009) [#48]
It certainly is an interesting way to do it. although i can see it not working any better than a dx light unless the mesh is split up appropriately. Nice stuff though.


puki(Posted 2009) [#49]
i can see it not working any better than a dx light unless the mesh is split up appropriately

Ah, but standard DX lights (unless 'hacked' not to) will pass through surfaces which will destroy the intended precision/micro-lighting effect.

Clinical, precision, dynamic, real-time lighting is the future of everything.


You have to open your mind to what else can be achieved.

How can you avoid multiple TFormPoint calls for multiple lights and multiple surfaces - all of which are dynamic and can be moving?

"puki" knows.


Nate the Great(Posted 2009) [#50]
haha puki I am determined to crack your secret... but first show us an example of multible lights and cubes/spheres casting shadows.. ;) this is the showcase after all


puki(Posted 2009) [#51]
I patch my shadows through FastExtension. I'm sure "MikhailV" will figure it out and steal it.


puki(Posted 2009) [#52]
Mmm, all of the images in the thread have died (not just mine).


Kryzon(Posted 2009) [#53]
No they haven't, at least I can see them.


Nate the Great(Posted 2009) [#54]
I patch my shadows through FastExtension


thats cheating... well if you plan to release pLS that is you will have to require all users with pLS to have fast extension.