Prev | Next



Variable Radius Segment Blob Implicit Field Plugin

January 2006


1 Introduction

PRMan 13 ships with an Implicit Field plugin that makes segment blobs of varying radius. The top blob in the image to the right is a single horizontal segment of length 2, whose radius is .7 at the left and .2 at the right. The middle blob has the segment divided into a sum of two pieces, each colored differently. The segment blob field is carefully defined so that arbitrary subdivision of a segment into a sum of shorter segments gives exactly the same field as the single segment, with no bulges at the joins. Having divided a segment, you can bend it, as on the bottom, still with no unexpected bulges.


2 Usage

The plugin is called impl_segblob. It should be located in ${RMANTREE}/etc, which prman will search if your rendermn.ini file contains something like

/proceduralpath @:${RMANTREE}/etc
or if your RIB file includes the appropriate directory via Option "searchpath" "procedural" [...].

The impl_segblob plugin expects 8 float arguments (and no strings!), specifying the object-space coordinates and blob radii of the segments two endpoints. Here is a complete RIB file for the example above:

FrameBegin 1
Display "seg1.tif" "tiff" "rgba"
Quantize "rgba" 0 0 0 0
Format 180 200 1
PixelSamples 4 4
Clipping 1e-3 1e5
Projection "perspective" "fov" 9
LightSource "distantlight" 1 "from" [-7 12 -14] "intensity" [0.7]
LightSource "distantlight" 2 "from" [7 10 -14] "intensity" [0.7]
LightSource "ambientlight" 3 "intensity" [0.1]
Translate 0 0 17
WorldBegin
Imager "background" "color" [1 1 1]
Color [.2 .3 .9]
Surface "plastic"
ShadingInterpolation "smooth"
Blobby 5 [
    1004 0 8  0 0 0                  # segment 0, dso with 8 floats, 0 strings
    1004 0 8  8 0 0                  # segment 1
    1004 0 8 16 0 0                  # segment 2
    1004 0 8 24 0 0                  # segment 3
    1004 0 8 32 0 0                  # segment 4
    0 2 1 2                          # sum of 1 and 2
    0 2 3 4                          # sum of 2 and 3
    2 3 0 5 6                        # max (csg union) of segment 0 & two sums)
  ]
  [
    -1.0  1.0 0 0.7  1.0  1.0 0 0.2  # segment 0, x0,y0,z0,r0, x1,y1,z1,r1

    -1.0  0.0 0 0.7  0.0  0.0 0 0.45 # segment 1
     0.0  0.0 0 0.45 1.0  0.0 0 0.2  # segment 2

    -1.0 -1.1 0 0.7  0.0 -0.7 0 0.45 # segment 3
     0.0 -0.7 0 0.45 1.0 -1.1 0 0.2  # segment 4
  ]
  ["impl_segblob"]
  "vertex color Cs" [
    .25 .625 .625                    # segment 0 color, cyan

    .25 1 .25			     # segment 1 color, green
    .25 .25 1			     # segment 2 color, blue

    .25 1 .25			     # segment 3 color, green
    .25 .25 1			     # segment 4 color, blue
  ]
WorldEnd
FrameEnd

3 Another Example

Here's a bigger example — 40 segments of a circle with sinusoidally varying width, made from this RIB file:

FrameBegin 1
Display "seg2.tif" "tiff" "rgb"
Quantize "rgba" 0 0 0 0
Format 200 200 1
PixelSamples 4 4
Clipping 1e-3 1e5
Projection "perspective" "fov" 9
LightSource "distantlight" 1 "from" [-7 12 -14] "intensity" [0.7]
LightSource "distantlight" 2 "from" [7 10 -14] "intensity" [0.7]
LightSource "ambientlight" 3 "intensity" [0.1]
Translate 0 0 17
WorldBegin
Imager "background" "color" [1 1 1]
Color [.9 .3 .2]
Surface "plastic"
ShadingInterpolation "smooth"
Sides 2
Rotate 10 0 1 0
Rotate 10 1 1 1
Blobby 40 [
    1004  0 8 0 0 0
    1004  0 8 8 0 0
    1004  0 8 16 0 0
    1004  0 8 24 0 0
    1004  0 8 32 0 0
    1004  0 8 40 0 0
    1004  0 8 48 0 0
    1004  0 8 56 0 0
    1004  0 8 64 0 0
    1004  0 8 72 0 0
    1004  0 8 80 0 0
    1004  0 8 88 0 0
    1004  0 8 96 0 0
    1004  0 8 104 0 0
    1004  0 8 112 0 0
    1004  0 8 120 0 0
    1004  0 8 128 0 0
    1004  0 8 136 0 0
    1004  0 8 144 0 0
    1004  0 8 152 0 0
    1004  0 8 160 0 0
    1004  0 8 168 0 0
    1004  0 8 176 0 0
    1004  0 8 184 0 0
    1004  0 8 192 0 0
    1004  0 8 200 0 0
    1004  0 8 208 0 0
    1004  0 8 216 0 0
    1004  0 8 224 0 0
    1004  0 8 232 0 0
    1004  0 8 240 0 0
    1004  0 8 248 0 0
    1004  0 8 256 0 0
    1004  0 8 264 0 0
    1004  0 8 272 0 0
    1004  0 8 280 0 0
    1004  0 8 288 0 0
    1004  0 8 296 0 0
    1004  0 8 304 0 0
    1004  0 8 312 0 0
       0 40 0  1  2  3  4  5  6  7  8  9 
           10 11 12 13 14 15 16 17 18 19 
           20 21 22 23 24 25 26 27 28 29 
           30 31 32 33 34 35 36 37 38 39
  ]
  [
     1.000  0.000  0.000  0.370  0.988  0.156  0.000  0.419
     0.988  0.156  0.000  0.419  0.951  0.309  0.000  0.440
     0.951  0.309  0.000  0.440  0.891  0.454  0.000  0.419
     0.891  0.454  0.000  0.419  0.809  0.588  0.000  0.370
     0.809  0.588  0.000  0.370  0.707  0.707  0.000  0.321
     0.707  0.707  0.000  0.321  0.588  0.809  0.000  0.300
     0.588  0.809  0.000  0.300  0.454  0.891  0.000  0.321
     0.454  0.891  0.000  0.321  0.309  0.951  0.000  0.370
     0.309  0.951  0.000  0.370  0.156  0.988  0.000  0.419
     0.156  0.988  0.000  0.419  0.000  1.000  0.000  0.440
     0.000  1.000  0.000  0.440 -0.156  0.988  0.000  0.419
    -0.156  0.988  0.000  0.419 -0.309  0.951  0.000  0.370
    -0.309  0.951  0.000  0.370 -0.454  0.891  0.000  0.321
    -0.454  0.891  0.000  0.321 -0.588  0.809  0.000  0.300
    -0.588  0.809  0.000  0.300 -0.707  0.707  0.000  0.321
    -0.707  0.707  0.000  0.321 -0.809  0.588  0.000  0.370
    -0.809  0.588  0.000  0.370 -0.891  0.454  0.000  0.419
    -0.891  0.454  0.000  0.419 -0.951  0.309  0.000  0.440
    -0.951  0.309  0.000  0.440 -0.988  0.156  0.000  0.419
    -0.988  0.156  0.000  0.419 -1.000  0.000  0.000  0.370
    -1.000  0.000  0.000  0.370 -0.988 -0.156  0.000  0.321
    -0.988 -0.156  0.000  0.321 -0.951 -0.309  0.000  0.300
    -0.951 -0.309  0.000  0.300 -0.891 -0.454  0.000  0.321
    -0.891 -0.454  0.000  0.321 -0.809 -0.588  0.000  0.370
    -0.809 -0.588  0.000  0.370 -0.707 -0.707  0.000  0.419
    -0.707 -0.707  0.000  0.419 -0.588 -0.809  0.000  0.440
    -0.588 -0.809  0.000  0.440 -0.454 -0.891  0.000  0.419
    -0.454 -0.891  0.000  0.419 -0.309 -0.951  0.000  0.370
    -0.309 -0.951  0.000  0.370 -0.156 -0.988  0.000  0.321
    -0.156 -0.988  0.000  0.321 -0.000 -1.000  0.000  0.300
    -0.000 -1.000  0.000  0.300  0.156 -0.988  0.000  0.321
     0.156 -0.988  0.000  0.321  0.309 -0.951  0.000  0.370
     0.309 -0.951  0.000  0.370  0.454 -0.891  0.000  0.419
     0.454 -0.891  0.000  0.419  0.588 -0.809  0.000  0.440
     0.588 -0.809  0.000  0.440  0.707 -0.707  0.000  0.419
     0.707 -0.707  0.000  0.419  0.809 -0.588  0.000  0.370
     0.809 -0.588  0.000  0.370  0.891 -0.454  0.000  0.321
     0.891 -0.454  0.000  0.321  0.951 -0.309  0.000  0.300
     0.951 -0.309  0.000  0.300  0.988 -0.156  0.000  0.321
     0.988 -0.156  0.000  0.321  1.000 -0.000  0.000  0.370
  ]
  ["impl_segblob"]
  "vertex color Cs" [
    1.000 0.250 0.250
    0.994 0.185 0.321
    0.976 0.128 0.396
    0.946 0.081 0.474
    0.905 0.043 0.552
    0.854 0.017 0.629
    0.794 0.003 0.703
    0.727 0.001 0.772
    0.655 0.011 0.835
    0.578 0.033 0.889
    0.500 0.067 0.933
    0.422 0.111 0.967
    0.345 0.165 0.989
    0.273 0.228 0.999
    0.206 0.297 0.997
    0.146 0.371 0.983
    0.095 0.448 0.957
    0.054 0.526 0.919
    0.024 0.604 0.872
    0.006 0.679 0.815
    0.000 0.750 0.750
    0.006 0.815 0.679
    0.024 0.872 0.604
    0.054 0.919 0.526
    0.095 0.957 0.448
    0.146 0.983 0.371
    0.206 0.997 0.297
    0.273 0.999 0.228
    0.345 0.989 0.165
    0.422 0.967 0.111
    0.500 0.933 0.067
    0.578 0.889 0.033
    0.655 0.835 0.011
    0.727 0.772 0.001
    0.794 0.703 0.003
    0.854 0.629 0.017
    0.905 0.552 0.043
    0.946 0.474 0.081
    0.976 0.396 0.128
    0.994 0.321 0.185
  ]
WorldEnd
FrameEnd


Prev | Next


Pixar Animation Studios
Copyright© Pixar. All rights reserved.
Pixar® and RenderMan® are registered trademarks of Pixar.
All other trademarks are the properties of their respective holders.