Sign in to follow this  
Happy SDE

Glowing objects.

Recommended Posts

Hello, forum!

 

I have objects (cubes for example) with vertex position + normals data.

All vertices of any cube have the same color (in R8G8B8 format);

Different cubes may have different colors.

No other textures applied to cubes.

 

I would like to make several (not all) cubes to glow.

I know how to light simple cubes in deferred renderer to HDR texture.

I already have bloom effect.

 

I got several thoughts, but haven’t figure out how to combine them in implementation:

 

1. Multiply cube color by some scalar (irradiance), and store color do GBuffer, or just store “glow” scalar to separate channel of GBuffer.

Question: should I use different algorithm for such cubes in light pass?

 

2. Make the cube a point light.

In this case, other objects around the cube will be lighted.

Probably if there will be a lot of glowing cubes, performance may suffer.

 

3. It seems such objects need to be treated differently, but I can't understand how.

Such as white (0xff, 0xff, 0xff) for simple cube should be rendered differently than the same white (0xff, 0xff, 0xff) for object-emmiter.

 

Here is a screenshot from Doom:

(imagine in my case, they are all separate objects)

[attachment=34144:Glow.png]

It seems, that all glowing objects are not light sources.

Can anyone help me with theory behind such glowing objects?

 

Thanks in advance!

Edited by Happy SDE

Share this post


Link to post
Share on other sites
What you are talking about is normally called an emissive material because it "emits" light. You can also add a light source to it but you probably don't need to.

Thank you lipsryme for your answer!

 

Here are 4 things I wonder about:

 

1. In light pass, should the emissive object treated differently?

For example, if there is a green point light near red emissive object, should I multiply colors or do something different?

(I am tech guy, with no knowledge in color theory :) )

 

2. The other thing is about shadows: should I skip it or not in shadow map generation?

 

3. The third concern is about SSAO.

Do I need to change algorithm in some way?

 

4. Any other caveats?

Edited by Happy SDE

Share this post


Link to post
Share on other sites
If you look at how some other engines do it you'll see that emissive lights can be done by a post processing effect rather than true lighting and this can sometimes be faster and more efficient depending on what you want to do.

Take a look in the UE4 source code (which you can view in their github repository after signing up for free)

Hope this helps a bit! :)

Share this post


Link to post
Share on other sites

 

For example, if there is a green point light near red emissive object, should I multiply colors or do something different?

Lighting is always addative.

SSAO-> If your SSAO is a subtractive/multiplied approach then obviously it would be an issue. If however your SSAO is multiplied by your ambient light term and then added to your scene, then no you are fine. A lightbulb surface can surely receive more ambient light, and will still be fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this