Lighting is an important part of the graphical look of a simulation. It models the movement of photons in a scene. When you bring together the material definition of a mesh and the photons that affect it, you get the colors for the fragment of the image before post-processing
We support three types of lights in Vortex Studio
They are:
- The directional light emits photons from a source infinitely far.
- The point light emits photons from a point in all directions equally.
- The spot light emits photons from a point in a cone.
When these light types are created in the Vortex Studio Editor, they will affect your scene right away and provide lighting as described in standard OpenGL. The Vortex Studio Editor does offer some interesting variations away from the standard OpenGL definition of these lights:
- The directional light can be set to be finite by giving it a non-zero “beam width.”
- When a directional light is finite, both its position and its direction are used to generate a square prism lighting volume.
- The directional light’s “beam width” determines the extent of the square in the square prism lighting volume.
- You can set a distance fall-off on a spot light.
- On both the finite directional and spot light types, you can set a texture to replace the fall-off formula: we call that a projected-texture light.
- When a spot light uses a projected texture, its shape changes to square pyramid.
- Both the finite directional and the spot light types can be given a non-unit “beam aspect ratio”.
- This will scale the Y-axis of the light transform.
- For a spot light, this gives an ellipsoid cone lighting volume.
- For a finite directional light, this gives a rectangular prism lighting volume.
Other Notes / Tips
- Remember, casting shadows is by far the most expensive operation in lighting.
- You can achieve 60 FPS with 16 spot lights that do not cast shadows, on a large scene.
- Yet, it is hard to reach this level of performance with more than 4 shadow-casting lights.
- We do not support casting shadows on point lights.
- Using a projected texture on a finite directional light that covers the whole scene is a cheap way to “bake” together multiple static lights, such as lamp-posts.
- See the Explosive Ordnance Disposal Robot sample that comes with Vortex Studio for an example.
- We use one uniform block to push all the lights to the material shader.
- On my Nvidia GTX 1060, this means that I can have up to 125 lights in one scene before the shader refuses the compile.