Fujiyama Documentation





Table of Contents

Back to Fujiyama Home


The Architecture of Fujiyama

The architecture of Fujiyama is very simple.


How to compile

  1. Download source package
  2. Make sure that all headers and libraries in proper paths
  3. Run commands the below in the shell
    $ tar xvzf fujiyama-xxx.tar.gz
    $ cd fujiyama-xxx/
    $ make
    
  4. Core library and shader DSOs are created in lib/ directory
  5. Tools are created in individual directories under tools/
  6. Run commands the below to check the unit testing
    $ make check | grep FAIL
    
  7. If you see any FAILs, the distribution is broken. Please contact me
  8. To install the core library, shaders, scene parser and tools, run this
    $ make prefix=/path/to/install install
    
  9. The core library and shaders are installed to prefix/lib
  10. The scene parser and tools are installed to prefix/bin

  • dlfcn.h and sys/stat.h are required for loading DSOs (UNIX-like system)
  • OpenGL/GLUT are required for FrameBuffer Viewer
  • OpenEXR is required for fb2exr

  • How to render sample scenes

    1. Download ply models or make your own
    2. Download hdr images or make your own
    3. Make sure LD_LIBRARY_PATH points to the directory you installed library
    4. Make sure PATH points to the directory you installed tools
    5. Run commands the below to convert data
      $ ply2mesh teapot.ply teapot.mesh
      $ hdr2tex pisa.hdr pisa.tex
      
    6. Run scene file parser
      $ scene ./scenes/teapot.scn
       or
      $ cat ./scenes/teapot.scn | scene
      
    7. Run FrameBuffer Viewer to view the *.fb or convert the output to *.exr
      $ fbview teapot.fb
       or
      $ fb2exr teapot.fb teapot.exr
      


    Tools

    • FrameBuffer Viewer
      • Displays *.fb and *.mip
      • Assumes it runs on PC and does gamma correction when loading images
      • *.fb is the output file of the renderer
      • *.fb can store data that is only within valid data
      • *.mip is the mipmap file for the image texture
      • Run this command to see more information
        $ fbview --help
        
    • fb2exr
      • Converts *.fb to *.exr
      • Run this command to see more information
        $ fb2exr --help
        
    • hdr2mip
      • Converts *.hdr to *.mip
      • Compute mipmap resolution (power of 2) automatically
      • If the input image resolution is not power of 2, then the output image will be stretched
      • Tile size is currently 64 by 64 pixels only
      • Run this command to see more information
        $ hdr2mip --help
        
    • ply2mesh
      • Converts *.ply to *.mesh
      • All polygons are divided into triangles
      • Normals are computed if they don't exist
      • Run this command to see more information
        $ ply2mesh --help
        
    • obj2mesh
      • Converts *.obj to *.mesh
      • All polygons are divided into triangles
      • Normals are computed if they don't exist
      • Run this command to see more information
        $ obj2mesh --help
        


    Basics of Scene Interfaces

    Basic syntax is very simple and straight-forward.

    • Command-like language - One line does one operation
    • Command name and arguments are separated by spaces
    • A line starts with "#" means comment
    • Most of commands have the entry name in the first argument
    • Entry name is the thing that you want to create or operate
      Command arg0 arg1 arg2...
      

    For example, the line below creates a new mesh with name of "mesh1" in scene.

    NewMesh mesh1 /path/to/bunny.mesh
    
    the next line below creates a new object instance with name of "obj1" referenced to "mesh1".
    NewObjectInstance obj1 mesh1
    

    Scene Interface commands are corresponding to ones for C Binding. SiOpenScene() and SiCloseScene() are implicitly called by scene description file parser. So, there is no command corresponding to them.


    Python Binding

    Fujiyama provides Python interfaces to write scene description file. Python 2.5 or higher version is supported. Note that Python 3 is not supported.

    To run fujiyama scene written in python, fujiyama.py needs to be put in the path where python finds it. For example, you can run it like this,

    $ env PYTHONPATH=tools/PythonAPI scens/volume_and_bunny.py
    
    Python Binding of scene interface is very straight forward. Before calling any scene interface, you need to import fujiyama module like this,
    import fujiyama
    si = fujiyama.SceneInterface()
    
    The most of methods correspond to scene interface. Higher level of interfaces will be implemented in the future like this,
    si.OpenPluginDirectory('/path/to/python_modules')
    
    To see help of Python interfaces, type this
    pydoc tools/PythonAPI/fujiyama.py
    


    Scene Interfaces Reference Manual


    OpenPlugin filepath

    filepath full or relative path to the actual DSOs filepath

    RenderScene renderer

    renderer renderer name to run

    SaveFrameBuffer framebuffer filepath

    framebuffer framebuffer name to save
    filepath file path to save to

    RunProcedure procedure

    procedure procedure name to run

    AddObjectToGroup object_group object

    object_group object group name to add to
    object object name to add

    NewObjectInstance name mesh

    name object name to create
    mesh mesh name to instance

    NewFrameBuffer name type

    name framebuffer name to create
    type type of framebuffer. only rgba for now

    NewObjectGroup name

    name object group name to create

    NewTubulence name

    name turbulence name to create

    NewProcedure name plugin

    name procedure name to create
    plugin procedure plugin name to instance

    NewRenderer name

    name renderer name to create

    NewTexture name filepath

    name texture name to create
    filepath file path to load

    NewCamera name type

    name camera name to create
    type type of camera. only PerspectiveCamera for now

    NewShader name plugin

    name shader name to create
    plugin shader plugin name to instance

    NewVolume name

    name volume name to create

    NewCurve name filepath

    name curve name to create
    filepath file path to load

    NewLight name type

    name light name to create
    type type of light. only PointLight for now

    NewMesh name filepath

    name mesh name to create
    filepath file path to load

    AssignFrameBuffer renderer framebuffer

    renderer renderer name to assign to
    framebuffer framebuffer name to assign

    AssignObjectGroup entry property object_group

    entry entry name for the property
    property property name to assign to
    object_group object group name to assign

    AssignTurbulence entry property turbulence

    entry entry name for the property
    property property name to assign to
    object_group turbulence name to assign

    AssignTexture shader property texture

    shader shader name to assign to
    property property name to assign to
    texture texture name to assign

    AssignShader object shader

    object object name to assign to
    shader shader name to assign

    AssignCamera renderer camera

    renderer renderer name to assign to
    camera camera name to assign

    AssignVolume entry property volume

    entry entry name for the property
    property property name to assign to
    volume volume name to assign

    SetProperty1 entry property value0

    entry entry name for the property
    property property name to assign to
    value0 1st element of the value to assign

    SetProperty2 entry property value0 value1

    entry entry name for the property
    property property name to assign to
    value0 1st element of the value to assign
    value1 2nd element of the value to assign

    SetProperty3 entry property value0 value1 value2

    entry entry name for the property
    property property name to assign to
    value0 1st element of the value to assign
    value1 2nd element of the value to assign
    value2 3rd element of the value to assign

    SetProperty4 entry property value0 value1 value2 value3

    entry entry name for the property
    property property name to assign to
    value0 1st element of the value to assign
    value1 2nd element of the value to assign
    value2 3rd element of the value to assign
    value3 4th element of the value to assign

    SetSampleProperty3 entry property value0 value1 value2 time

    entry entry name for the property
    property property name to assign to
    value0 1st element of the value to assign
    value1 2nd element of the value to assign
    value2 3rd element of the value to assign
    time sample time where to assign property

    ShowPropertyList type

    type type name (ObjectInstance, Volume, ...) or plugin name (PlasticShader, ...) to show property list of
    Copyright (c) 2011-2021 Hiroshi Tsubokawa