New LightType

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
ImpalerWrG
Gnoblar
Posts: 15
Joined: Sat Feb 27, 2010 7:42 am

New LightType

Post by ImpalerWrG » Sat Jan 01, 2011 9:49 am

Currently Ogre defines 3 Light types,

LT_POINT Point light sources give off light equally in all directions, so require only position not direction.
LT_DIRECTIONAL Directional lights simulate parallel light beams from a distant source, hence have direction but no position.
LT_SPOTLIGHT Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff.

I was recently trying to apply a light to my terrain which would create a gradient from dark in the valleys to bright at the top of the hills and mountains. I realized none of the existing lights could do this. My somewhat messy solution will likely involve a large number of Directional lights and lightMasks. But it gave me an idea for a new light type which could avoid this issue in the future. Call it 'Gradient Light" if you like, it would simply be a combination of Directional and Spotlight, having the infinite planar and parallel rays of Directional light along with the position and Attenuation of a Spotlight. The light intensity at a point is simply the distance to the plane modified by attenuation. Alternatively Directional light could be able to receive attenuation and position (with the default being none thus maintaining the present behavior), though I suspect this might not be possible given the likely implementation of Directional light.

I'm not sure how much effort is involved in writing a new light type but I figured if I found a need for something like this then others would too and some one out their might be inspired in to give it a try.
0 x
Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 996
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 20
Contact:

Re: New LightType

Post by Crashy » Tue Jan 04, 2011 5:51 pm

When this comes to this type of things, do it yourself using shaders.

Even if such a light type would be added to Ogre, this is not a behaviour supported by the fixed pipeline, so a custom shader is needed.
0 x
Follow la Moustache on Twitter or on Facebook
Image

User avatar
lordsme
Gremlin
Posts: 167
Joined: Sun Mar 11, 2007 1:11 pm
Location: Turin, Italy
Contact:

Re: New LightType

Post by lordsme » Tue Jul 05, 2011 11:40 am

I Think that this could be done using a large area light and the normal distance attenuation...
I'm looking for a way to implement area lights in OGRE: look at my thread if you want
http://www.ogre3d.org/forums/viewtopic.php?f=5&t=65403
0 x
My Portfolio
http://davidedigiannantonio.weebly.com

MESH - Mise-en-scene Helper
http://www.mesh-project.org/

ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: New LightType

Post by Zonder » Tue Aug 02, 2011 4:01 pm

Sounds more like you need a lightmap to me
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

Post Reply