PhotoRealistic RenderMan® Extension
Supplemental documentation for the shadow map generation feature of the "prman" render package.
![]() |
|
| fig.1 | fig.2 |
The light-shadows
gop is used to specify which light sources produce shadows.
(Light sources don't produce shadows by default.)
... (light "distantlight") ;; doesn't cast shadows (light-shadows #t) (light "distantlight") ;; does cast shadows ...Note that for the distant light which casts shadows, the same shader "distantlight" is specified. The only difference is that the distant light which casts shadows takes additional parameters necessary for various aspects of shadow map generation and use.
All shadow lights support the following parameters when producing shadows:
| shadow-map-res | real | 256 | shadow map resolution |
| shadow-map-dir | string | current directory | shadow map directory |
| options | list of uneval'd options | see below | light-source specific shadow map rendering options |
light "distantlight" paramlist)
| name | type | default | description |
|---|---|---|---|
| intensity | real | 1.0 | intensity |
| lightcolor | vec3 | #<1 1 1> | color |
| from | vec3 | #<0 0 0> | position |
| to | vec3 | #<0 0 1> | center of interest |
| shadowname | string | "shadowdistant~s" | shadow map filename |
| samples | real | 16 | sampling resolution |
| width | real | 1 | sampling filter width |
light "pointlight" paramlist)
| name | type | default | description |
|---|---|---|---|
| intensity | real | 1.0 | intensity |
| lightcolor | vec3 | #<1 1 1> | color |
| from | vec3 | #<0 0 0> | position |
| sfpx | string | "shadowpoint~spx" | shadow map filename +X axis |
| sfnx | string | "shadowpoint~snx" | shadow map filename -X axis |
| sfpy | string | "shadowpoint~spy" | shadow map filename +Y axis |
| sfny | string | "shadowpoint~sny" | shadow map filename -Y axis |
| sfpz | string | "shadowpoint~spz" | shadow map filename +Z axis |
| sfnz | string | "shadowpoint~snz" | shadow map filename -Z axis |
| samples | real | 16 | sampling resolution |
| width | real | 1 | sampling filter width |
light "spotlight" paramlist)
| name | type | default | description |
|---|---|---|---|
| intensity | real | 1.0 | intensity |
| lightcolor | vec3 | #<1 1 1> | color |
| from | vec3 | #<0 0 0> | position |
| to | vec3 | #<0 0 1> | center of interest |
| coneangle | real | (radians 30) | cone angle |
| conedeltaangle | real | (radians 5) | cone fuzziness angle |
| beamdistribution | real | 2 | drop off |
| shadowname | string | "shadowspot~s" | shadow map filename |
| samples | real | 16 | sampling resolution |
| width | real | 1 | sampling filter width |
casts-shadows
gop.
(casts-shadows #t)
Subsequent gprims will cast shadows. (The default.)
(casts-shadows #f)
Subsequent gprims will not cast shadows.
(casts-shadows "only")
Subsequent gprims will only cast shadows. That is, their shadows will be visible, but the geometry itself will not.
The default value for "shadow-map-options" is
'((ri-pixel-samples 1 1)
(ri-pixel-filter "box" 1 1)
(ri-hider "hidden" 'jitter 0))
Note: This single option specifies all rendering options for the generation of shadow maps. (Its use may be improved in the future.) You generally will want to retain the settings for the shadow map options show above. Therefore, if you need to specify an additional rendering option for the shadow map (e.g. "zthreshold"), you should include that option and those shown above. For example,
(render ... 'shadow-map-options '((ri-pixel-samples 1 1) (ri-pixel-filter "box" 1 1) (ri-hider "hidden" 'jitter 0) (ri-option "limits" 'zthreshold '(0 0 0)) ) ... )
Last updated: 4/15/96 / Steve May ( smay@cgrg.ohio-state.edu ) Any comments or suggestions appreciated.