Directional vs Point lights

manu3d

Active Member
Contributor
Architecture
I am currently dealing with some pretty intricate lighting code.

In particular, the LightGeometryNode iterates through all entities with a LightComponent whether the component's type is directional or point and handles them accordingly.

However, while the rendering of point lights is quite obvious just by placing or holding torches, the only directional light I'm aware of is the sun/moon main light, which is handled in DirectionalLightsNode (the name is wrong: it really only deals with the one main light and will be renamed).

So, my question at this stage is: what is the envisioned use of directional lights? Because by my understanding these are light sources with parallel light rays, which are really only occurring with very large distances, i.e. in space.

I can think of one potential use in terms of large surfaces emitting light, i.e. a lava lake. It could perhaps make some sense to use directional lights with some distance limit for that. But uniformly distributed point light (not necessarily one per block) might achieve better visual results without much of a performance hit.

What do you guys think?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
As far as I have understood, the directional light is really only to simulate general lighting in a solar system. I do not foresee using more than one directional light as there are better ways to provide different kinds of lights like lava lakes and such (like you described).
 

manu3d

Active Member
Contributor
Architecture
Ok, thank you for the confirmation.

Meanwhile the plot thickens. I had a look into org.terasology.rendering.logic.LightComponent and one of the comments, describing variable lightSpecularPower, states:

A smaller number will make a wider cone of light. A larger number will make a narrower cone of light.
Except I cannot see any data structure or processing that could be associated with conical shapes. Everything seems to be much more consistent with the (imho) more "traditional" directional lights intended as having parallel rays coming from afar.

So, unless somebody would like me to do otherwise, I think I'll try to simplify the code and handle point lights and directional lights in separate nodes. And hopefully I'll be able to re-start the LightVolumes code for the point-lights.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
As I recall, there is no special directional light component, so we have a misused LightComponent in its place.

Hrm, I suppose that comment should be reworded. I was describing what the reflection light looked like, in my head it looked like a cone of light coming out from source.
 

manu3d

Active Member
Contributor
Architecture
I think I know what you mean: when you move your torch-in-hand close to a surface it looks like the circle of light produced by flashlight, bright at the center with a falloff. Which by the way doesn't make sense for most natural and non-natural surfaces in Terasology's landscape. I.e. a wood trunk shouldn't show a shrinking, well defined spot of light as the light gets closer to it. But that's for another time.

I also think that the concept of directional light in the LightComponent is either misused or only partially implemented. I'll see what I can do.
 
Top