Saturday, September 10, 2011

LIGHT OBJECT: Geometry Light


Geometry Lights allow the user to select geometry and make that object emit light from its surface. This light is essentially an area light as it shares parameters under the Area Light Options tab.


To turn an object into a geometry light you can select the geometry node you would like to become a light and then select the 'Geometry Light' shelf button. The user can also turn an object into a light by changing the Light Type  of the Light Object node to Geometry and by putting the path to the geometry in the Geometry Object field. The user can also put a texture map on the geometry by placing an image in the Texture Map field.

LIGHT OBJECT: Distant Light


Distant Lights are made to simulate a point light that is infinitely far away from objects in the view port, like the sun. With distant lights you only need to determine the angle that the light is coming from, not its position. It is configured in such a way that the light will hit everything in the scene with parallel rays, consequentially causing parallel shadows much like the sun does.

 
Orthographic Width changes the width of the Distant Light in the view port.
 
Pros:
  • Great outdoor fill lighting
  • Possible environment lighting replacement
Cons:
  • Not easy to aim
  • Limited Use

LIGHT OBJECT: Area Light

Area Lights are lights that emit from an object other than a point in space. Unlike point lights and spot lights, where all rays originate from one point, area lights scatter rays from an entire surface.


The preset geometry to use as emitters include a grid, line, disk or sphere, but because this type of light emits so many more rays in all directions it is much more complicated to calculate. This results in slower render times, and since the rays are being scattered from the surface of the light, there is a much greater chance that areas may not be hit with rays accurately. This causes a noisy or grainy look to the renders. To fix this the user can bump up the sampling value in the lights parameters. The default is set to 1. Bumping up this value will make your area light emit more rays which will increase render times, but it will smooth out the noise.

Shading Rate:  01

Shading Rate:  10

Area Lights also give you much softer shadows since the light is able to "wrap" around the object. The larger you make your light--Area Size parameter--the softer your shadows will become.

Small Area Light, Sharper Shadows
Large Area Light, Softer Shadows
Normalize Light Intensity to Area - When this parameter is enabled, the intensity of the light does not change as the user changes the size of the Area Light. When it is disabled, the intensity of the light will scale with the size of the light.


Pros:
  • More realistic lighting
  • Softer shadows
Cons:
  • Longer render times
  • Sampling

LIGHT OBJECT: Spot Light

A spot light, like a point light, is an infinitely small point in space. Unlike point lights, though, spot lights only emit light in a single direction and are also very customizable (the user gets control over things like the diameter of the beam--Cone Angle--and the falloff of the light's intensity--Cone Delta and Cone Rolloff. To turn the point light into a spot light, simply activate the Enable Spot Light parameter under the Spot Light Options tab.


In the diagram to the left, the area within the center ring receives full illumination. the light falls off between the inner ring (defined by the Cone Angle) and the outer ring (defined by the Cone Delta). The dashed line represents where illumination is half as bright as within the cone angle. The Cone Rolloff parameter moves this line between the center and outer rings.

No Cone Delta
Cone Delta set to 20
  • Cone Angle - (the inner ring) This parameter controls the diameter of the lights main beam. This value is in degrees calculated from the center. 
  • Cone Delta - (the outer ring) This is measured in degrees from the edge of the angle's radius (number of degrees of penumbra for spotlights). The delta controls the amount of falloff, and the higher the delta is the softer the edge of the light will appear. 
  • Cone Rolloff - (the dotted line) This parameter is basically a weighting exponent that can pull the falloff between the delta and the angle. It allows you to shape the falloff with more precision. By default it is set to 1, and this places it directly in the center of the outer and inner ring. The higher this value is the sharper your edge will be, and will pull it closer to the Cone Delta (outer ring).
Projection Map
Near Clipping Plane
Far Clipping Plane
  • Projection Map - Projection maps can be placed in this field, essentially turning your light into a projector. This can be used with gobos to filter out light in certain areas, and can also be used to create fake underwater caustic effects.
  • Near Clipping - Similar to the camera's clipping plane, this parameter determines how close the projection map can be to the light 
  • Far Clipping - Also similar to the camera's clipping plane, this parameter determines how far from the light the projection map can be.
Pros:
  • Falloff controls
  • Directs light exactly where it is needed
  • Efficient
Cons:
  • Not as useful for lighting large areas

Houdini Lights


There are actually only three major lights of regular consequence in Houdini:  the Light Object, the Environment Light, and the Indirect Light. Two other lights, the Ambient Light and the Light Template are available, and while they can be useful, they are not used regularly anymore.

Light Object:
  • Point Light - default
  • Spot Light - enable spot light check box
  • Area Light - light type is set to line, grid, disk, sphere
  • Geometry Light - light type is set to geometry
  • Distant Light - light type is set to distant
Environment Light:
  • Environment Light - default
  • Portal Light - enable portal geometry check box
  • Sky Light - enable sky environment map check box
Indirect Light:
  • Global Illumination Light (G.I.) - default
  • Caustic Light - light type is set to caustic photon

Each light option and its settings are covered in detail in their own posts.


There are several approaches you can pick from when positioning objects such as cameras, lights, or geometry:
  1. Just clicking on the shelf tool and moving the cursor around in the view port will enable the user to drop the camera anywhere on the construction plane (in the X and Z directions, but not in the Y direction). Holding down the 'alt' button while in the view port will affect the Y position of the object, and clicking in the view port will place said object.
  2. Clicking on the shelf tool and then hitting enter in the view port will place the object at the center of the construction plane (0,0,0).
  3. 'ctrl' clicking on the shelf tool will make the current view that object's view.

LIGHT OBJECT: Attenuation


In the real world, the further away an object is from a light source, the less light it receives. For example, areas immediately around a lamp will always be brighter than areas that are, say, 5 feet away. In Houdini (and other 3D applications), this process of decreasing the light intensity based on the distance from the source is referred to as attenuation. 

Within the Light object node, there is an Attenuation Options tab that gives the user control over how much the light's intensity will drop off over distance. The Attenuation drop down parameter list provides the user with three options:  No Attenuation, Half Distance Attenuation, and Physically Correct. The default setting is No Attenuation.
No Attenuation
Half Distance Attenuation:  The user specifies a distance at which the light attains half of the intensity that it is at the origin of the light. The default value is 10 meaning that if the intensity of the light is set to 1, the intensity on any surfaces 10 units away is 0.5. The formula used for this type of attenuation is   CI = H/(H+D)   where H is the half distance and D is the distance from the light source. When D is 0, we end up with H/H which is 1. When D = H (the half-distance), the intensity is H/(H+H), which is half of the intensity. In a sense, the light is never fully extinguished regardless of the distance from the source.
Half Distance Attenuation
Physically Correct Attenuation: In reality, light falls off based on a much more accurate algorithm called the inverse sqaure law. The formula for such is   CI = 1/(D*D)   where for every unit of measurement we move away from the light source, we drop to 1/4 of the intensity of the previous unit. A point that is 1 unit away from the light source will receive the light's full intensity, while a point that is 3 units away will only receive 1/9 of the original intensity.

Inverse Square Law

Physically Correct Attenuation
Other parameters under the Attenuation Options tab:
  • Attenuation Start This parameter specifies the distance away from the light source where the attenuation will start calculating. Anything within this area will have constant intensity, and anything outside of this area will have calculated attenuation.
  • Active Radius When enabled, Active Radius facilitates a cutoff for the lights attenuation. Anything outside of this radius will receive no light from this source. This method works well to reduce calculations of lights that attenuate into infinity and can also speed up renders by avoiding lighting and shadowing calculations for light sources that are outside this radius.
  • Attenuation Ramp Multiplier - Enables a ramp control for the user to directly adjust the attenuation at different distances. This ramp is multiplied with the existing light intensity and it allows the user to directly adjust the attenuation for different distances. This parameter can still be used even with attenuation turned to No Attenuation if you need very particular results from your light.

LIGHT OBJECT: Point Light

A Point Light is an infinitely small point in space that evenly emits light in all directions. Sometimes called omnidirectional lights, they closely simulate what an uncovered light bulb does in the real world. It is the easiest light to setup/place in a scene, but it is also the least customizable.

Pros:
  • Fills entire areas with light
  • Attenuation allows for appropriate falloff
  • Very easy to place it and go
Cons:
  • Wasted rays
  • Not very customizable

Friday, September 2, 2011

Clipping Planes

Clipping planes are distances from the camera defining the closest an object can be (near) and the farthest they can be (far) to still be allowed as part of the render.  That's why objects sometimes disappear when they get too close to the camera (depending on what your near clipping plane is set to).

Tuesday, August 23, 2011

INDIRECT LIGHT: Caustics


With Houdini 11, several areas of the lighting/shading/rendering pipeline have undergone some serious overhaul, caustics included. Instead of generating photon maps under the PBR tab of your Mantra node, all of the caustics set-up is done with the new Caustics Light (which can be found in the Indirect Light node).

 
Pros:
> Automatically generates and reads in a photon map (no more having to create and constantly update a separate mantra node just for baking out photon maps)
> Enables you to have most of the parameters you need on the object level

Cons:
> Not as much direct-ability
> There is a constant battle between wonderfully sharp but noisy caustics and amazingly smooth but blurred caustics

No Light Mask or Photon Target Defined
Light Mask or Photon Target Defined
Upon application, the caustics light may or may not give you a funky-looking caustic. That’s because, with default settings, the photon map is spreading out across the entire scene.  It is not collecting in specific areas. First things first, make sure that the caustic light's Light Mask parameter is set to a specific light and the Photon Target parameter is set to a specific target such as your main refracting/reflecting object (the more specific, the more direct-ability, and the more photons will accumulate in the areas you want them to). It’s good practice to have a separate caustic light for every light in the scene that you want to contribute to caustics (for better direct-ability).

Side note:  If you're not seeing any change in your render view, be sure that Auto-Update is unchecked. You have to reload your photon map in order to see the differences, and Auto-Update does not do that for you (despite the ‘auto’ in the name).

Filter Samples vs Prefilter Samples:

Is Filter and Prefiltering sampling similar to sampling in the render node (with raytracing)? You're doing a prefilter photon map and you have your samples set to 100. It samples each photon 100 times, takes the average of those 100 samples, and applies the result to the photon. If it works this way, maybe that is why a high filter and a high pre-filter sampling rate results in a 'blurier' caustic and lower rates give you a 'sharper' caustic.

The smaller the sample number,  the noiser it will be (more aliasing) but it will also be sharper

Filter Samples:  When reading from the photon map, this is the number of photons to filter (if you aren't pre-filtering, then you need a high number of Filter Samples)

Photon Map Generation
Filter @ Render Time (when it's reading the photon map to render)

Prefilter Photon Map:  After photon map generation but before rendering, prefilter the photon map so that much fewer photon samples are required for rendering

Prefilter Samples are the number of photons to filter during prefiltering (the higher the number, the "blurier" it is -- same for Filter Samples)

Photon map Generation
Filter
Render Time

The Prefilter Ratio is the ratio of prefiltered photons over photons that were initially sent out before cacheingThis means that if your pre-filter ratio is set to, say, 0.1, your pre-filtered photon map (the map used at render-time) will only store 1/10 of the photons in the original, non-filtered map. The larger the pre-filtered ratio number, the more photons in your pre-filtered map (( See example images ))
Prefilter Ratio set to 0.1
Prefilter Ratio set to 0.8

Photon Map Generation


Here’s a general idea of how photon map generation works in computer graphics:

  • A light fires a photon out into the scene within the light's cone angle (I assume along a ray of some sort -- depending on the render engine. The caustic photon distribution is pretty random)
  • That photon will either encounter a diffuse object or a reflected/refracted object and then a diffuse object
  • Once the photon encounters the diffuse object, the photon then records its position and the intensity of the refracted/reflected light that is hitting that photon/point in space
  • Lather, Rinse, Repeat until the number of photons is reached in the Photon Count parameter (in Houdini)
  • Come render time, the created photon map then contributes to the light intensity to which that map belongs (ex:  the light averages all of the points in the photon map that are within a certain distance of that point in space, then adds the results to the light intensity at that point on the object). Since photons do not hit every point on the object, the point that's getting rendered may not have a photon sample at that exact point, but if there are hits very close by, the renderer assumes their average will appropriately approximate the current location's caustic.