Heuristic42
Blog
Opengl
Meta
Rendering
1
comment
Apr 19 at 11:24
Matrices
Please have whoever is in charge of the business call me at the…
–
anonymous
comment
Apr 13 at 0:25
Matrices
Hey there! Looking to save on energy costs? Look no further! …
–
anonymous
comment
Apr 5 at 9:43
Matrices
If you look closely in the Bible, there are very specific warni…
–
anonymous
comment
Mar 27 at 17:19
Matrices
Are you still in business? heuristic42.com
–
anonymous
comment
Mar 25 at 4:59
Matrices
Hey There I tried calling your phone number but it was unsuc…
–
anonymous
comment
Mar 5 at 15:39
Matrices
Hi, I hope this message finds you well. I'm reaching out to …
–
anonymous
comment
Feb 7 at 5:45
Microsoft Natural Ergonomic 4000 Replacement
Thank you so much for sharing your thoughts here, it tells me e…
–
anonymous
comment
Jan 28 at 23:31
Microsoft Natural Ergonomic 4000 Replacement
Oh man, I feel this post. Not sure if you've seen the "new" new…
–
anonymous
comment
Jan 25 at 12:06
Matrices
Hi, Mark here. If it is ok for your business processes to be…
–
anonymous
comment
Jan 20 at 3:11
Matrices
[deleted]
–
anonymous
reverted
Dec 21 '23
Route contention when running docker and a VPN
updating to latest
–
admin
edited
Dec 21 '23
Route contention when running docker and a VPN
Things have improved since the original post. It may have been …
–
pknowles
edited
Dec 21 '23
Route contention when running docker and a VPN
Things have improved since the original post. It may have been …
–
anonymous
edited
Dec 21 '23
Route contention when running docker and a VPN
This have improved since the original post. It may have been up…
–
anonymous
comment
Nov 24 '23
Matrices
[deleted]
–
anonymous
edited
Sep 17 '23
Writing custom C++ containers, iterators and value references
Generic containers are awesome. 1. The effort required to wr…
–
pknowles
created
Sep 17 '23
Writing custom C++ containers, iterators and value references
Generic containers are awesome. 1. The effort required to wr…
–
pknowles
comment
Sep 15 '23
DerBard: Custom Split Mechanical Keyboard Prototype
Hey. Thanks for your interest! I've uploaded the files here, bu…
–
pknowles
comment
Sep 13 '23
DerBard: Custom Split Mechanical Keyboard Prototype
Hi! Is it possible to get some models so I can also make it?
–
anonymous
edited
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
edited
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
created
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
comment
Jul 13 '23
Matrices
[deleted]
–
anonymous
comment
Jul 6 '23
Matrices
[deleted]
–
anonymous
…
View All
Log in
Lights
leave this field blank to prove your humanity
Slug
*
A URL path component
Parent page
<root>
3D Rendering (Computer Graphics)
--- Cameras
--- Matrices
------ Projection Matrix
--- Vectors
--- 3D Geometry
------ triangle_meshes
--- Shading
------ Transparency and Alpha Blending
--- Lights
--- rasterization
------ Deep Image
--- Shadows
--- Vector Spaces
------ Tangent Space
------ Clip Space
--- rotations
--- images
------ mipmapping
--- materials
OpenGL Tutorials
--- Order Independent Transparency (OIT)
--- The Framebuffer
Pages About This Site
--- Contributing
--- Bugs
--- Why does this website exist?
The parent page this belongs to.
Article title
*
Article revisions must have a non-empty title
Article body
*
A light in computer graphics is a light source, and a fundamental component of rendering. It's light bounces around a scene of objects and ultimately enters the camera to form a 2D image. Lights have colour and brightness and are often categorized by their geometry into directional, point, spot, area and volume lights. In these cases lights are quite separate to geometry, affecting geometry without being visible itself. Alternatively a material (e.g. for surface or volume geometry) with an emissive property can also be a light source. Having geometry with emissive properties in the scene matches reality better as light is emitted from matter, however supporting such generalized light sources can be expensive especially for rasterizers and especially when supporting [shadows](/17/rendering/shadows/). ## Directional Lights Directional lights are lights with infinitely far position and no attenuation, or reduction of intensity, over distance. For example, the sun is so far away that relative changes in position are insignificant. Because of this approximation, a globally constant light direction vector can be used in the lighting calculations. In the first real-time graphics applications, small optimizations such as this was important, particularly for Blinn-Phong specular highlights where both an infinite viewer and infinite light allow a constant half-vector. ## Point Lights Point lights have a world space position and a light direction vector is calculated at every shaded point. An attenuation is often applied to point lights, not because of any for or absorption effects, but because the light is "spread thin" as it moves outwards from a point. Think of a sphere growing in size, being the wavefront of traveling light. As it grows, the same amount of light on its surface must cover a greater area. This area increases with the square of the distance, $d^2$. Likewise the intensity is scaled down by $\frac{1}{d^2}$. ## Spot Lights A spot light is really just a point light with a cover so that light only goes in one direction, which although more expensive could be modeled with geometry and shadows. A direction vector and angle for the width of the beam are its attributes. Rather than a sharp cutoff for points outside the angle, a ramp is often used to simulate soft shadows at the spotlight edges. ##Area Lights Area lights are an extension of point lights, forming a flat surface. They are much more expensive and produce soft shadows. A common area light is a disc to model the silhouette of a sphere such as the sun or light bulb. Rather than a single point, the light from them is the integral over the lights area. They could be approximated as a collection of point lights distributed over the area. A raytracer essentially does this, numerically integrating the light by tracing rays to many points over the area. An emissive material applied to a triangle mesh of a light bulb could be considered many area lights, one for each triangle. A volume light is the same thing, but with light coming from everywhere within a volume. An example may be the flame of a candle, where the gas is so hot it emits light. To support arbitrary materials emitting light, a raytracer can employ multiple importance sampling, where rays are generated at higher density in the direction of known emissive surfaces, avoiding samples which do not affect the result. # Rendering Multiple lights can be added to the scene by simply adding the colour/intensity from each one. I.e. sum the result of all lighting equations. Lighting can be quite expensive with many lights. An easily solution was to turn on only the most significant lights for a given view. Computing the affect of a light on geometry can happen during [shading](https://www.heuristic42.com/14/rendering/shading/) while rendering, known as *forward rendering*. Alternatively, materials and other information can be saved to compute lighting effects in a subsequent stage, called *deferred shading*. A direct approach to lighting was to simply apply a lighting equation for every light during forward rendering. Of course not all lights significantly affect all surfaces. Additionally not all surfaces are visible. Deferred shading typically stores only visible surface information. This avoids some unnecessary lighting computation. However, small lights may only affect a little part of the image. Rather than check all lights per geometry sample, deferred shading allows computation for each light. I.e. for each light, work out and apply lighting to only those pixels it affects. These pixels, and even depth ranges, can be found by rendering simple bounding geometry for each light. A spatial data structure can be used during forward rendering to provide similar improvements to the above, where a search finds a list of lights affecting each geometry sample. The basic idea is don't do unnecessary work. Even checking to see if more work should be done is work itself. This becomes very important with lots of lights.
Toggle Preview
Edit message
*
A description of the changes made
Discard Draft
Save Draft
leave this field blank to prove your humanity
Flag
the thing you clicked
for moderator attention.
Reason choice:
Spam, promoting, advertising without disclosure
Rude, inappropriate, generally offensive
Too arrogant or demeaning to others
Other
Reason:
The reason for raising the flag
Error