light emitting objects
Blitz3D Forums/Blitz3D Programming/light emitting objects
| ||
So how can I place light emitting objects in my game? Do I have to use a DLL or some sort of shadow system? I would like to have the torches and braziers in my FPS actually emit some form of colored light to really create a mood. Is this possible? -RZ |
| ||
place a light where you want to see it. there are no light emitting objects |
| ||
Is this possible? Kind of... |
| ||
Use a quality lightmapper ( Gile[s] springs to mind ) and set the object as light-emitting. The object's light will then be taken into account in the lightmap. |
| ||
YOu could do the lightmap thing and then if your torches aren't too big just screen copy the area behind them. Load it into a paint program and make an animstrip of the grabbed area adding soft moving shadows then load it in as an animated sprite exactly where you cut it from. I guess that's a cheap solution but with a little care can give an adequate result. Better than nothing. |
| ||
I'd suggest projecting a light map from the origin of the mesh onto the lightmap of the entity. (Blend it in, same uv set) normal dx lights are rubbish for this sort of thing, so I wouldn't advise using them, unless your level is very high poly and has no big (Big as in big in screen/eye space) polys. |
| ||
I'd suggest projecting a light map from the origin of the mesh onto the lightmap of the entity. That is by far the most interesting idea I have heard yet! Since I don't know about dx lights... but I know a little about blending uv sets (I use that same command to light a map in an educational game I am building) Hmmm... Anyone eelse have any good ideas? : ) -RZ |
| ||
I'd suggest to use Gile[s] for the static Objects and sswifts Shadow system for the dynamic, animated things. I guess this is currently the best shadows (and lights) solution for blitz3d. |
| ||
What about vertex lighting? I've recently been playing around with this bit of code from EdzUp: http://www.blitzbasic.com/codearcs/codearcs.php?code=509 and I've had some fairly good results. |
| ||
so how does vertex lighting match up against SSwifts shadow system for dynamic lighting?? |
| ||
I can't say as I've yet to try sswift's system. Hopefully someone with experience using both techniques can comment. |
| ||
Swwifts doesn't do lighting, only shadows. But it does them very well(The best for blitz3D's built in engine easily.) |
| ||
Unlike static and dynamic lightmapping, Vertex lighting cannot be used to for shadow shapes other than the existing triangles AFAIK. |
| ||
vertex lighting is the same kind of lighting that directx uses. so whatever directx can do, EdzUp's system can't do any better. and as jfk said, vertex lighting is called that for a reason - the light is calculated per-vertex and interpolated across the faces. so with high-poly models, it looks pretty nice, but with low-poly models (which your levels usually are in comparison to the character), vertex lighting is rather inaccurate and ugly. there are a few methods to do what you want.. realtime lightmapping, and pixel lighting for two. pixel lighting requires shader support, so you can pretty much rule that out in blitz ;) and lightmapping, i guess if you can figure it out, that's great :) i haven't used sswift's system, but can you set the shadow color in it? possibly you could project colored shadows as light. then again, i wouldn't imagine they're soft shadows, are they? so they probably wouldn't look a whole lot like light.. probably a good method would be to render a lightmap at half brightness, then use the multiply by 2 blending flag for the lightmap on the level. then you could move lights around as you needed them (as you can only have 8) and since you've got the multiply by 2 blending flag on, it would light up the lightmap to brighter than usual, so you could make flickering lights. :) |
| ||
A very simple method is to have a sprite or quad which is set to entityblend mode 3 (add) with a grayscale circle which fades from bright to dark as you go away from the centre. Then place that near your torch. Not the best method but is quick and simple. |
| ||
I like that idea Matty... gonna try that! -RZ |
| ||
OK but we are back to the number of sprites and game slowdown question... I have a pretty good machine and occasionally the game stalls for just a sec... The more sprites the greater the stall... How many sprites are too many??? -RZ |