##RenderMan RIB-Structure 1.0
#version 3.03

Option "searchpath" "shader" ["../../../shaders/light:../../../shaders/displacement:../../../shaders/surface:&"]
Option "limits" "bucketsize" [32 32]
Option "limits" "eyesplits" [10]
Declare "bias" "float"

Hider "hidden" "depthfilter" "midpoint"

# Output Z data only
Display "softshadow.zfile" "zfile" "z"

Clipping 0.01 10

Sides 2

Format 256 256 1
PixelFilter "box" 1 1
PixelSamples 1 1
ShadingRate 2

FrameBegin 1

# Placecam camera transform
Projection "perspective" "fov" [57.30]
Rotate -35.26 1.00 0.00 0.00
Rotate 45.00 0.00 1.00 0.00
Translate -5.00 -5.00 5.00

WorldBegin
  Surface "null"
  Sphere 1 -1 1 360
WorldEnd

FrameEnd

MakeShadow "softshadow.zfile" "softshadow.shad"

#
#
# Now render the scene using the shadow map just calculated.
#
#
Display "softshadow.tif" "file" "rgba"
Display "+softshadow.tif" "framebuffer" "rgb"
Format 480 360 1

PixelFilter "gaussian" 2 2
PixelSamples 2 2
Clipping 0.2 10
ShadingRate 1

FrameBegin 2

Projection "perspective" "fov" 45
Translate 0 0 5
Rotate -20 1 0 0

Declare "shadowname" "uniform string"
Declare "blur" "uniform float"

WorldBegin
  LightSource "ambientlight" 0 "intensity" [0.2]
  LightSource "shadowspot" 1 "intensity" [75] "from" [5 5 -5] "to" [0 0 0] "coneangle" [0.5] "shadowname" ["softshadow.shad"] "blur" [0.03]

  Color [0.4 0.4 0.1]
  Surface "matte"
  Sphere 1 -1 1 360

  Orientation "rh"
  Color [0.5 0 0]
  Patch "bilinear" "P" [-10 -1 -10
                         10 -1 -10
                        -10 -1  10
                         10 -1  10]
WorldEnd

FrameEnd
