Explanation about Dynamic Lights

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Explanation about Dynamic Lights

Post by Jay »

A while back someone asked which lights are considered dynamic lights by the engine. I didn't find the post/topic in which it was asked right away, and as not everyone checks all the posts, i thought i better post it here, since it might be interesting for other users aswell.

Ok, first of all there are two kinds of lights in the engine: Static and Dynamic lights.

But what makes them different? Well a static light is computed during level compiling and therefore (normally) is faster. A Dynamic Light is updating the surrounding lightmaps in real time. It is important to know that the Genesis engine BYPASSES Direct3d/Opengl lighting and does the calculation in software instead (->frame rate eater). Therefore it can use up to 40 dynamic lights (for the lightmaps!), instead of the normal 8 lights in a scene at a given time that standard hardware fixed function (hardware T&L) lighting gives you.

Static lights:
Sunlight entity
Sun entity
Light entity
SpotLight entity

Dynanic lights:
DynamicLight entity
DSpotLight entity
Flame entity
All lights used in effects and explosions defined in effect.ini and explosion.ini

I know for sure that the Light and DynamicLight entities can cast stencil shadows and the Sunlight entity cannot. To produce an effect similar to a sunlight make a Dynamic Light that follows the player around using a 'sun-pawn'. If you want you can even move it around and change the daytime this way. But of course you then have the problem that the other pawns get influenced by this light too and would need their own 'dynamic sun-light'. Doing this for all pawns, you can easily reach the 40-dynamic-lights limit, so this is not advised.

About the FogLight and the MorphingField i am not sure, as they are not volumetric (don't have their own polygons) and seem to change the color of the brushes they touch if you look through them (this is very similar to what a light does, a light does change the color of the lightmaps->the brushes too)

Hope this explains a bit. :wink:
Everyone can see the difficult, but only the wise can see the simple.
-----
Veleran
Posts: 903
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Explanation about Dynamic Lights

Post by Veleran »

They were 40 spotlights and crashed the levels,so i deleted them.
I used them to see the bump mapping because more than three years ago,when wxb1 started to implement dot3 per pixel lightning he added the spotlight to the dot3 calculations.
Last edited by Veleran on Tue Nov 04, 2008 12:38 am, edited 5 times in total.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Explanation about Dynamic Lights

Post by Jay »

Well then the error must be somewhere in the dot3 code, because spotlights are precalculated light sources, from what i know. (the lightmaps are precalculated i mean...). Strange though, that´a spot light is used for dot3 bump mapping and not the DSpotLight...
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: Explanation about Dynamic Lights

Post by paradoxnj »

instead of the normal 8 lights in a scene
That is 8 active lights per render pass. You can render using as many lights as you want, you just have to make an additional render pass for every 8 lights. For example, 24 active lights in view = 3 render passes. Make note that I said "in view". It's highly unlikely that you will have 24 lights in the view of the player. If you have 1 light in the camera's view, you will only have 1 active light.

The limitation by OpenGL and DX of 8 lights only means that 8 lights can be active in one render pass. It does not mean that you can only have 8 lights in a scene.
Many Bothans died to bring you this signature....
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Explanation about Dynamic Lights

Post by Jay »

ah ok... that explains it. thanks.
Everyone can see the difficult, but only the wise can see the simple.
-----
Post Reply