Skip to main content
gamedev.net
🔒 Locked

Lighting

Started by tjrr3d 3 replies 500+ views
Original Post
tjrr3d
tjrr3d
I am designing a particle engine and I was going over some of my ideas on what this thing might be able to do. I came up with a bunch of uses, but I was thinking about some sparks in particular. I was wondering, how would I go about emitting a red hot light from each spark, then let it die out as time progresses? I'm a bit new to lighting in gl and the only tutorials I've found talk about world lighting. I wasn't sure if creating a small light source for each spark would be too expensive or not. Anybody know of any good articles to read or a general way to do it?
nefthy
nefthy
do you mean emitting in the sence of lighting nearby objects or do you mean that they should apear as if they where emmiting light.
tjrr3d
tjrr3d
If possible, to emit light. As in when it is near other objects, the object is lit with the color of the spark.
Specchum
Specchum
Quote:
Original post by tjrr3d
I wasn't sure if creating a small light source for each spark would be too expensive or not. Anybody know of any good articles to read or a general way to do it?


Treating each spark as a light source would be waaay too expensive. Even a single light source may have an impact on rendering depending on the complexity of the model you are lighting.

One thing you could try is to create a single light source for the entire particle system. A reddish-yellow light source centered on the particle system would probably be a good enough effect.

"There is no dark side of the moon." - Pink Floyd
nefthy
nefthy
you could also use an emissive material color for the sparks. google for OpenGl material colors or something like that. Note this would not make the sparks a light surce, it would just change the color so that they seem to be self lit.

edit: heres an example:


The last column is selflit.

material.c

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.