How to make a light bulb

Blitz3D Forums/Blitz3D Beginners Area/How to make a light bulb

SkyCube(Posted 2005) [#1]
Hello,

I have seen this really cool effect that creates a kind of light bulb, but I have been unable to replicate it. I know how to create lights in B3d, however, the source of the light can't be seen, just its reflection on the surfaces around it. In the effect I saw, the light seems to come from within a sphere, like it was a light bulb (I think it even has a lens flare). Does anyone know how I can create a light like this? Or where I can find a tutorial to do so? Thanks.


flying willy(Posted 2005) [#2]
look at the castle demo for 3d sprites. A visible sun or light bulb is just a sprite.


_PJ_(Posted 2005) [#3]
Plus there's some Lens Flare code in the Archives!


Rook Zimbabwe(Posted 2005) [#4]
Sprites and flares... IMHO


jfk EO-11110(Posted 2005) [#5]
yes, sprites in blendmode 3. You may use a method that first checks if the camera can see the lightbulb mesh (or pivot). If the lightbuld is visible (Entityvisible), you may show the sprite, if it's not then hide it. additionally you'll set the entityorder f the sprite in a way that it is drawn in front of everything else. Since the sprite is scaled bigger than the bulb you'll get the effect of blinding shiny light sources like here:

But it's a bit CPU costy when you have lots of lights in a scene. So adding a sprite to each light would to the job too. When the sprite is near a wall, it may look like the sprite was cut like this:



SkyCube(Posted 2005) [#6]
Thanks for your suggestions,

I will certainly try them out. I haven't used sprites yet (been a Blitz3D user for only two months) but I can read about it in the manual. Nice pics, jfk!