Archived

This topic is now archived and is closed to further replies.

Fairy dust?

This topic is 5236 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If this is a ridiculously difficult question to answer, I apologise, I''m just looking through a few demos and noting its absence... but it seems like the sort of thing that shouldn''t be too hard to do... How would one go about creating an object which actually radiates light (presumably decaying gradually around it over some set distance back to the ambient level) - instead of the illumination only being visible by its effect on other objects? Like a will-o-the-wisp or a candle-flame... -- Mercy

Share this post


Link to post
Share on other sites
I think that kind of thing is typically done by blending a "light flare" type texture around the object. That''s how I''ve seen it done in the past, and it''s a pretty good effect.

Share this post


Link to post
Share on other sites
My thoughts would be to re-render the object into a texture, and then blend that texture over the top of the scene as a post-process effect (use ortho). Making the texture quite low res and enabling filtering on it would automatically add a fading effect as well, for free. Not sure about it''s performance overhead, however.

Share this post


Link to post
Share on other sites
GL_EMISSION is just a material property like GL_AMBIENT or GL_DIFFUSE and it''s used exactly the same way. This property is basically adding color that isn''t affected by light.

Share this post


Link to post
Share on other sites
... hmm.
Sorry, now I''m more confused o.o
I thought GL_DIFFUSE and GL_AMBIENT were properties of a light?
I''m still working my way through the first couple dozen Nehe tutorials - the ones where Delphi code is available - so maybe this is hideously wrong...?

--
Mercy

Share this post


Link to post
Share on other sites
I'm not so sure about this on OpenGL's point-of-view (it's most likely the same), but in raytracing, diffuse light is the measure which describes the relation between incident (the light that falls on a surface) and excident (the light that leaves a surface). In a nutshell, diffuse describes the intrinsic brightness of a surface/body. Ambient light is the base brightness of a surface/body.

By default you have your light which has a certain color and doesn't change as it is reflected off a surface/body. Emission allows you to add a supplemental component that describes the sufrace's/body's color.

This adds up to something like this (off the top of my head):

eye_brightness = incident_brightness * surface_diffuse + surface_ambient (+ env_ambient)

[edited by - crispy on August 18, 2003 9:35:46 AM]

Share this post


Link to post
Share on other sites
Yeah, they are light properties, but they are also material properties.

First you call glMaterial to set the properties,
and OpenGL will then take them into account in the rendering of the object.

in materials you have:

GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR
these are the ambient (shadow area) diffuse, and specular(highlight) reflection color.

GL_EMISSION sets the color of the "glow"

GL_SHININESS controls the specular exponent (used to focus the "hightlight")

Share this post


Link to post
Share on other sites