University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin

Home Goals Publications People Gallery Assignments Distributions

SLIDE
Scene Language for Interactive Dynamic Environments
Outline

Jordan Smith
May 8, 1999

  1. Ideas which are probably out of range of this paper:
    1. Comparsion to Compilers and Computer Architecture
      1. User Program (C++) => Compiler (Assembly) => Computer Architecture
      2. 3D Application (SLIDE) => 3D Renderer (OpenGL) => OpenGL 3D Pipeline
  2. Abstract
  3. Introduction
    1. The field of 3D Computer Graphics has been rapidly changing and maturing.
    2. There is a set of concepts which should taught.
    3. On what level should these concepts be taught?
      1. Vocational education -- marketable on graduation
      2. Low level education -- understand it well enough that to learn an API would be very easy
      3. Balance of both
    4. How should be taught in an undergraduate Computer Graphics course?
      1. Lecture and Reading Material
      2. Written assignments exercise theoretical understanding of material
      3. Application of concepts can give students a deeper concept of them, but it is easy to use something without really understanding how it works.
      4. Implementation of Concepts forces students to understand concepts in order to teach computer how perform them.
    5. Providing a Framework for students to implement algorithms in
    6. SLIDE System as a panacea
      1. SLIDE Language
        1. Representative of concepts of RenderMan, VRML, Open Inventor, OpenGL, and Java3D
        2. Simple yet Powerful
      2. SLIDE Renderer
        1. Program for viewing SLIDE files much like a VRML browser
        2. Programmed in a style similar to Open Inventor or Java3D.
      3. SLIDE Pipeline Assignments
        1. Get under hood of Graphics API's like Open Inventor, Java3D, and OpenGL to learn how they work not just how to use them. (Mesa is an example of this)
        2. Learn full system instead of small unrelated assignments
        3. Software Engineering
    7. Brief overview of paper
  4. Background
    1. GLIDE
      1. Evolution of CS184 teaching languages
      2. Attribes of GLIDE language
      3. Failings of GLIDE
      4. Recompile per dynamic scene
      5. Lights and Cameras
      6. Lack of structure to laboratories
    2. Nachos
      1. Inspiration for SLIDE lab framework
      2. Provide working solution executable to compare and experiment with
      3. Makefiles and account setup
      4. Designing structure of program (skeleton), system vs. unrelated modules
      5. Fresh start policy (not as clean as SLIDE's, which is good and bad)
      6. Start up application code tricky and hard to debug
      7. Provide modules as black boxes which the students will later need to implement
      8. Tedious coding provided
      9. Extra help in debugging
      10. Extra nice features which students might not think to create
    3. OpenGL
      1. Widely supported industry standard API for 3D graphics which the SLIDE renderer is built on top of
      2. SLIDE educational software pipeline based on the OpenGL system architecture
      3. SLIDE language has been in fluenced and extended due to OpenGL
      4. OpenGL not appropriate for teaching
    4. Mesa 3D
      1. Almost same idea as software pipeline, but its main purpose is to create an OpenGL interface on non-SGI machines
      2. SLIDE does not try to be a replacement for OpenGL, but instead implements the algorithms present in OpenGL on top of OpenGL
    5. Tcl and Tk
      1. What are Tcl and Tk?
      2. Tcl and Tk as utilities
      3. Tcl's model for applications
    6. RenderMan
      1. RenderMan is a renderer independent graphics description format
      2. Too Complicated
      3. Static description (repeat scene in a sequence of frames)
      4. Slow user feedback no widget UI's
      5. Left Handed Coordinate Systems (unintuitive based on Math defaults)
    7. Open Inventor
      1. Scene Graph very similar to SLIDE
      2. Built on top of OpenGL
      3. Has a file format
      4. Inventor Feature Packed vs. SLIDE Small kernel
      5. SLIDE more manageable to implement
      6. Open Inventor oddities (lights and cameras, maybe surface properties)
    8. VRML
      1. Web standard for 3D dynamic scenes
      2. Based on Open Inventor
      3. Describe dynamic worlds and navigate through them
      4. No cameras, just viewpoints
      5. Directional Lights only affect siblings
    9. Java 3D
      1. Java equivalent of Open Inventor
      2. Did not exist when SLIDE was started
  5. SLIDE System
    1. Goals
      1. Education
        1. Teach about real time rendering and modeling
        2. Hands on approach forces student to use the material
      2. Modularity and extensibility
        1. Provide a modular framework for students to implement graphics algorithms
        2. Extensible so that new features can be easily added
      3. Portability
        1. Make SLIDE available over the net for any computer
        2. Only use standard interfaces such as OpenGL and Tcl/Tk
        3. Why not Java?
    2. SLIDE Language
      1. Simple enough to be implemented in a semester
      2. Powerful enough to make interesting models and scenes
      3. Find the minimal set of general utilities
    3. SLIDE Renderer
      1. OpenGL and Software
      2. Stand alone app which runs dynamic scenes
      3. Optimized for real time rendering
      4. Mechanism for aiding in the creation of photo-realistic renderings
      5. Debugging features for geometry
      6. Extensible
    4. SLIDE Laboratories
      1. Incrementally build software pipeline
      2. Simplified enough to complete in a semester
      3. Explore details of rendering algorithms
  6. SLIDE Language
    1. Core Educational
      1. Goals
        1. Simple for education
        2. Powerful to be useful
        3. Minimal basis set
        4. Originally a reimplementation of GLIDE
        5. Hierarchical BREP
        6. Topology of scene graph is static
        7. All floating point values and flags are dynamic
      2. Geometry Primitives
        1. Points
        2. Faces
        3. Objects
      3. Scene Graph Hierarchy
        1. Group
        2. Instance
        3. Node can be Group, Object, Camera, or Light
      4. Minimal set of Transformations
        1. Can be represented with 4D Homogeneous matrices
        2. Scale
        3. Rotate
        4. Translate
        5. LookAt
      5. Surfaces, Shading, and LOD
      6. Cameras
        1. Frustum only, distinction between projection and placement
        2. Oblique Parallel and Perspective
      7. Lights
        1. Types: ambient, directional, point, and spot
        2. Default location within its own coordinate system
        3. Follows example of camera
        4. ambient
        5. directional
        6. point
        7. spot
      8. Rendering a scene
        1. Window
        2. Viewport
          1. Overlapping viewports will produce unexpected results
      9. The render statement
        1. World contains a forest of DAG's
        2. Linking together viewport with camera, lighting, and geometry
        3. Camera and Light paths
        4. Multiple cameras and light situations by multiple renderstatements in the same viewport
        5. LOD to switch between cameras
        6. UI controls
      10. Dynamics
        1. Polling
        2. Tcl
        3. SLF_TIME, SLF_FRAME
        4. tclinit
        5. Tcl procedures and Tk UI's
        6. tclupdate
        7. Tcl value scripts
      11. Wrap up: This is the core functionality which students will actually implement
    2. Extensions
      1. OpenGL
        1. fog
        2. stencils
      2. RenderMan
        1. Smooth Surfaces (quadrics, spline patches)
        2. Area Light sources
        3. Rib comment strings
      3. Tcl and Tk
        1. Tcl interface to parser enables procedural modeling in tclinit
  7. SLIDE Renderers
    1. Introduction: 2 Implementations
      1. SLIDE language useless without rendering program
      2. Renderer similar to VRML browser
      3. Software version: Teach rendering pipeline algorithms
      4. OpenGL version: Optimization for real time rendering
    2. Similarities between 2 Renderers
      1. Portable: Use ANSI C++, Tcl/TK, and OpenGL
      2. Optimization
      3. Differ mainly in rendering pass only
    3. C++ class hierarchy
      1. Nodes hierarchy
      2. Vector Package
    4. C++ Utility Libraries
      1. Datalib: lists and hash tables
      2. 4D Vector and Matrix Package
    5. Tcl/TK
      1. System independent Windowing API
      2. Scripting Language of SLIDE
      3. Interpreter
    6. OpenGL
      1. Rendering API
      2. Software: Only uses 2D version
      3. OpenGL: Uses full API including optimization mechanisms
      4. Display Lists and Texture Objects
    7. Outline of Execution of a Scene
      1. Initialization
        1. Parser
        2. World Preprocess
        3. World Preprocess Graph
        4. World Create Dynamics List
        5. World Create All Windows
          1. Window Prerender Display Lists and Texture Objects
        6. World Create Timer Event to start dynamics
      2. World Update
        1. World Update
        2. World Update Graph
        3. World Post Redisplay All Windows
        4. World Create Timer Event for next frame
      3. Window Render
        1. Static Scene Graph abstraction
        2. Run rendering traversal
    8. Example for Discussion
    9. Parsing
      1. Built with Flex and Bison (GNU versions of Lex and Yacc)
      2. Will not resource a file which has already been read, checks for circular file inclusion
      3. ID hash table in scanner, so that ID comparisons can be pointer comparisons instead of strcmp's
      4. Structure of a SLIDE file is rather flat which makes it easy to parse
      5. A SLIDE scene describes a single World, World has bins for
        1. tclinit blocks
        2. tclupdate blocks
        3. surfaces
        4. points
        5. faces
        6. transforms
        7. instances
        8. nodes
        9. viewports
        10. windows
        11. render statements
        12. fog?
      6. All nodes share the same name space
      7. tclinit done which can produce more geometry
    10. Check Semantics
      1. Objectives
        1. Resolve all references
      2. Execution
        1. After tclinit blocks, all geometry has been created
        2. World calls Check Semantics and dereferences all ID's linking up the structure
    11. Preprocess
      1. Objectives
        1. Initialize all Tcl controlled values
        2. Mark dynamic entities
        3. Initialize nodes in preparation for the Preprocess Graph traversal
      2. Execution
        1. World calls Preprocess on all entities and Tcl controlled values are initialized
        2. Entities with dynamic components are marked dynamic
        3. Nodes are marked unvisited (bounding boxes invalidated) in preparation for the depth first graph traversal of PreprocessGraph
        4. Diagram of World's forest after Preprocess
    12. Preprocess Graph
      1. Objectives
        1. Compute the bounding boxes for all nodes
        2. Mark nodes who's bounding boxes could possibly change as having a dynamic bounding box
        3. Make a list of the changing nodes and store that for fast updates
      2. Execution
        1. World calls PreprocessGraph on each of the render statements (any nodes which are not descended from any render statement can never be viewed)
        2. Each render statement begins a depth first traversal of the scene graph DAG which begin at its geometry root
        3. In this depth first traversal, bounding boxes are computed hierarchically and all nodes which will need to be updated as the scene runs are marked as being in some way dynamic
        4. Bounding boxes computed by:
        5. Nodes are classified as dynamic (bound vs. surface properties)
        6. Difference between software and OpenGL versions
    13. Create Dynamics List
      1. Objectives
        1. World stores a list of the changing nodes and store that for fast updates
      2. Execution
        1. World runs through its lists of surfaces, points, faces, transforms, instances, nodes, viewports, and renders in this order.
        2. If any of these have anything dynamic about they are added to the dynamics list.
        3. Saves on searching through all nodes to find the dynamic ones on each update.
    14. Preprocess Windows
      1. Objectives
        1. Window objects are created and initialized (Togl Area and Frame)
        2. In OpenGL version, Static geometry and texture maps are registered with OpenGL for faster rendering
      2. Execution
        1. Windows created
        2. In OpenGL version, each window calls prerender on all of its viewports' render nodes
        3. Prerender is for completely static branches of the scene graph and texture maps
        4. For these static objects it is the only time there geometry will need to passed to OpenGL
        5. Once all of the windows have been created, the World set a timer event (the heart beat) and goes to sleep)
    15. Update
      1. Objectives
        1. For all entities on Dynamics list, update all Tcl controlled values
        2. Mark any nodes on the list as unvisited (bounding box invalid)
      2. Execution
        1. World wakes up from timer event
        2. World records current system time
        3. World updates SLF_TIME and SLF_FRAME
        4. World calls tclupdate blocks
        5. World traverses Dynamics list calling update on each entity
        6. Update any Tcl controlled values
        7. Instances smash matrices
        8. Nodes marked as unvisited (bounding boxes invalidated)
    16. Update Graph
      1. Objectives
        1. Update the hierarchical bounding boxes
      2. Execution
        1. World calls UpdateGraph on all render nodes
        2. If render LOD == OFF return
        3. Call recursive UpdateGraph on root node
        4. Per Node: if LOD == OFF or bound valid (visited) return
        5. call UpdateGraph on all children
        6. Calculate bounding box from children
        7. Set bound valid (visited)
        8. Send all windows redraw events
        9. World Records update ending time
        10. World Creates timer event for 1/30 second - update elapsed time (tries to maintain a constant 30 frames a second) and goes to sleep
    17. Rendering
      1. Objectives
        1. Render the current state of the scene graph into the 2D window
      2. Differences between Software and OpenGL renderers
        1. OpenGL is a state machine which you alter at the right times
        2. Software renderer passes in formation down the C call stack and everything resolved finally at the faces
        3. I will describe the software renderer and I will make notes of how similar tasks are achieved using OpenGL
        4. Passes down transform matrices and their inverses for transforming normals
      3. Execution
        1. Window
          1. Window receives a redraw event
          2. Window activates its OpenGL drawing context
          3. Window resets the OpenGL to default values
          4. Window calls Render on viewports passing its current pixel dimensions
        2. Viewport
          1. Modifies pixel dimensions to be the size of subwindow
          2. OpenGL: calls glViewport
          3. Calls Render on each of its renders passing in modified pixel window
        3. Render
          1. If LOD == OFF returns
          2. Gets camera from camera path
          3. Software: Uses pixel window and camera frustum to create a normalized Half Cube to viewport mapping matrix
          4. Gets the Projection matrix from the camera (OpenGL: Multiplies it onto the GL Projection Matrix Stack )
          5. Initializes the modeling matrix with the inverse of the camera path matrix
          6. Sets up the lights
          7. Software: creates VRC->light matrix and stores it in the light path
          8. Passes Obj->VRC, VRC->CUBE, CUBE->VP and all of the light paths with their VRC->LIGHTi matrices recursively down the scene graph starting at the root
        4. Group
          1. LOD == OFF return
          2. Bounding box cull against canonical half cube
          3. OpenGL: Static => call Display List
          4. Save on stack then Modify LOD flag, Shading flag, and surface pointer (OpenGL: glPushAttrib)
          5. Modify LOD flag, Shading flag, and surface pointer
          6. Call on all instances passing current state
          7. OpenGL: glPopAttrib on way back up
        5. Instance
          1. LOD == OFF return
          2. Save on stack then Modify LOD flag, Shading flag, and surface pointer (OpenGL: glPushAttrib)
          3. Modify LOD flag, Shading flag, and surface pointer
          4. Save current Obj->VRC transform on stack (OpenGL: glPushMatirx)
          5. Multiply Obj->Parent * Obj->VRC (OpenGL: glMultMatrix)
          6. Call child node passing current state
          7. OpenGL: glPopMatrix and glPopAttrib
        6. Object
          1. LOD == OFF return
          2. Bounding box cull against canonical half cube
          3. OpenGL: Static => call Display List
          4. Save on stack then Modify LOD flag, Shading flag, and surface pointer (OpenGL: glPushAttrib)
          5. Modify LOD flag, Shading flag, and surface pointer
          6. Call on all faces passing current state and the solid flag(back face culling?)
          7. OpenGL: glPopAttrib on way back up
        7. Face
          1. Check for back face culling if solid
          2. Make a copy of the points into a list of vertices which can be modified by the lighting and clipping routines
          3. Compute intesity value for vertices based on the list of lights (Flat vs. Gouraud shading) (Transform point into light's coordinate system)
          4. Transform points to CUBE space
          5. Perform 4D polygon clipping (Sutherland-Hodgman)
          6. Homogeneous division by Z
          7. Apply CUBE->VP transform to vertices
          8. Run scan conversion on the modified polygon contour
        8. Scan Converter
          1. Rasterize using Winding Number or Parity rule
          2. Z-buffer
          3. Gouraud shade
          4. Creates rendered image
          5. Transfer pixels to OpenGL and swap to the screen
    18. Extra Features
      1. RenderMan RIB Output
      2. Dot Output for Debugging and Optimizing Scene Graph
  8. Laboratory Assignments
    1. Get behind scenes and implement algorithms, learn by doing
    2. Full pipeline is complicated, especially when learning
    3. Reasonable steps which teach and progress system
    4. Fresh start
    5. Documentation per Lab - Specification, On line Text Book, and Commented Code
    6. OpenGL on top of OpenGL
    7. Enable/Disable algorithms to understand effects - perspective projection
    8. Our list of steps
    9. 2D Polygon Building
    10. 2D Polygon Editing and Morphing
    11. 2D Dynamic Hierarchical Scene Renderer
    12. 2D Bounding Box Rejection and Polygon Clipping
    13. 3D Parallel Viewing and Crystal Ball Interface
    14. 3D Perspective Viewing
    15. Polygon Scan Conversion and Software Z-Buffering
    16. Lighting and Shading
    17. Final Projects -- Using the SLIDE system
    18. Procedural Modeling and Photo-realistic Rendering
    19. Animation
  9. Results and Discussion
  10. Conclusion
  11. Bibliography
[an error occurred while processing this directive]