How to make a light bulb
Blitz3D Forums/Blitz3D Beginners Area/How to make a light bulb
| ||
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. |
| ||
look at the castle demo for 3d sprites. A visible sun or light bulb is just a sprite. |
| ||
Plus there's some Lens Flare code in the Archives! |
| ||
Sprites and flares... IMHO |
| ||
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: ![]() |
| ||
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! |