Ignore Objects from an Archive

Help
2007-07-23
2013-04-25
  • animator333
    animator333
    2007-07-23

    ##RenderMan RIB-Structure 1.0
    ##Creator Viper Version 0.1 (Beta)
    ##CreationDate Mon Jul 23 12:02:28 2007

    Option "limits" "int eyesplits" [ 10 ]
    Option "limits" "int gridsize" [ 256 ]
    Option "limits" "int texturememory" [ 65536 ]
    Option "limits" "int[2] bucketsize" [ 64 64 ]
    Option "searchpath" "shader" [ "&:@:.:~:rmanshader:C:/Program Files/Liquid/shaders" ]
    Option "searchpath" "texture" [ "&:@:.:~:rmantex:C:/Program Files/Liquid/rmantex:rmantex/" ]
    Option "searchpath" "archive" [ "&:@:.:~:rib:C:/Program Files/Liquid/rib:rib/" ]
    Option "searchpath" "procedural" [ "&:@:.:~" ]

    ReadArchive "objects_untitled.rib"

    ArchiveBegin "shadow_obj"

    #pSphereShape1

          AttributeBegin  # {
            Attribute "identifier" "string name" [ "pSphereShape1" ]
            Transform [ 1 0 0 0 0 1 0 0 0 0 1 0
                0 1.0129706 0 1 ]
          Surface "plastic"
            ObjectInstance 1
          AttributeEnd  # }

    #pPlaneShape1

          AttributeBegin  # {
            Attribute "identifier" "string name" [ "pPlaneShape1" ]
            Transform [ 1 0 0 0 0 1 0 0 0 0 1 0
                0 0 0 1 ]
          Surface "plastic"
            ObjectInstance 2
          AttributeEnd  # }
        
    ArchiveEnd    

    #directionalLightShape1

    FrameBegin 1  # {
      Display "temp_directionalLightShape1.tex" "shadow" "z"
      Orientation "rh"
      PixelSamples 2 2
      ShadingRate 2
      PixelFilter "box" 1 1
      Hider "hidden"
        "int jitter" [ 0 ]
      Hider "hidden"
        "depthfilter" [ "midpoint" ]
      Format 512 512 1
      Projection "orthographic"
      ScreenWindow -5 5 -4.5667676 5.4332324
      Translate 0 0 0.4231962
      Clipping 0 1e4
      Shutter 1 1
      Scale 1 1 -1
      ConcatTransform [ 1 -0 0 -0 -0 0.8351969 0.549951 0 0 -0.549951 0.8351969 -0
          -0 -0.40738126 -4.8598238 1 ]

      WorldBegin  # {

        AttributeBegin  # {

        ReadArchive "shadow_obj"

        AttributeEnd  # }

      WorldEnd  # }

    FrameEnd  # }

    Hi,

    In the RIB file above, the statement ReadArchive reads all the objects collected in archive. How do I ignore a particular object. I mean Read the entire archive but don't include some mentioned objects.

    This is basically for shadow generation pipeline. You can create an archive containing all the objects and call this archive for every light and write an ignoring syntax for named objects not to include in shadow generation.

    Thanks

     
    • George Harker
      George Harker
      2007-07-23

      Hi there,

      Conditional RIB should be able to help you out.  You can set some user attributes / options before including using ReadArchive, and conditionalize parts of the archive on the options / attributes.  This is quite often used for shadow pass management.

      See:

      http://www.george-graphics.co.uk/pixiewiki/Documentation/Conditional_RIB

      Feel free to post back if it's not very descriptive - or to add additional examples to that page.

      Cheers

      George

       
    • animator333
      animator333
      2007-07-23

      Thanks

      It would be great if you could give further explanation by using example.

      For example, in the RIB file mentioned above, how do I ignore "pSphereShape1" from shadow generation.

      Second, In case if I create an archive containing all the objects required to generate shadows and then use conditional  RIB to exclude object not required for a particular light would be an efficient way to generate shadow maps as in terms of parsing the RIB or else some memory issues.

      In case if there is no problem in this way then generating a shadow file from maya would be much easier.

      Thanks

       
    • animator333
      animator333
      2007-08-01

      Hi,

      Any help with examples would really be appreciated.

      Thanks

       
    • Okan Arikan
      Okan Arikan
      2007-08-04

         Hi Animator,

         Here's an example:

         Main rib:
        
         # Shadow pass
         Attribute "user" "int shadowPass" [1]
         ReadArchive "wholeScene.rib"

         # Beauty pass
         Attribute "user" "int shadowPass" [0]
         ReadArchive "wholeScene.rib"

         WholeSceneRib:
        
         Sphere 1 -1 1 360    # Gets rendered both in shadow and in beauty passes
      IfBegin "$Attribute:user:shadowPass==1"
         Disc 1 0 360             # Gets only rendered in shadow pass
      IfElse
         Polygon "P" ....          # Gets only rendered in beauty pass
      IfEnd

         This mechanism is actually much more powerful than this, sadly, there's not much public documentation yet.

          Unfortunately, I did not test this RIB yet, so it may not be %100 correct.

         Okan

       
    • animator333
      animator333
      2007-08-04

      Dear Okan,

      Thanks for the suggestion. I am investigating on your method.

      Actually I am looking for a method for shadow pass something like this:

      ##objects.rib##
      object_1
      object_2
      object_3
      object_4
      ##End

      ##shadow.rib

      light_1
          read objects.rib
          ignore object_2
          ignore object_3
         
      light_2
          read objects.rib
          ignore object_1
         
      light_3
          read objects.rib
          ignore object_4
         
      #End

      I don't know practically how I can achieve this in RIB. There are couple of advantages of this method.
      In general the number of objects that are not illuminated by lights are far less then number of illuminated objects.
      By considering this fact if we can find a way to write the shadow rib as mentioned above then it would help us in many ways.

      1. RIB size is less.
      2. objects.rib needs to be exported one time.

      I have seen couple of examples of shadow ribs but most of them are written in a way where after every light all the illuminated objects are passed. If a solution that goes in opposite direction to write only the objects that are not illuminated by light would surely help to write a small and easily manageable shadow rib from pipeline point of view.

      Cheers

      Animator.