* changes/additions to volume lighting

Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.

To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.

Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:

- Shadeless
  takes light contribution, but without shadowing or self-shading (fast)
  good for fog-like volumes, such as mist, or underwater effects
  
- Shadowed (new)
  takes light contribution with shadows, but no self-shading. (medium)
  good for mist etc. with directional light sources
  eg. http://vimeo.com/6901636
  
- Shaded
  takes light contribution with internal/external shadows, and self shading (slower)
  good for thicker/textured volumes like smoke
  
- Multiple scattering etc (still doesn't work properly, on the todo).
This commit is contained in:
2009-10-05 02:59:47 +00:00
parent 89df4a46fc
commit af522abf33
8 changed files with 99 additions and 24 deletions

View File

@@ -665,16 +665,17 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
split = layout.split()
col = split.column()
col.itemR(vol, "scattering_mode", text="")
col.itemR(vol, "lighting_mode", text="")
col = split.column()
if vol.scattering_mode == 'SINGLE_SCATTERING':
if vol.lighting_mode == 'SHADED':
col.itemR(vol, "external_shadows")
col.itemR(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
sub.itemR(vol, "cache_resolution")
elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
sub = col.column()
sub.enabled = True
sub.active = False