VMD

From MDWiki
Revision as of 05:54, 17 November 2015 by MCorbett (talk | contribs) (→‎Movies)
Jump to navigationJump to search

Rendering with VMD and Tachyon

This is a basic flowchart to get you started on rendering high quality images and movies using VMD and Tachyon. Note, this is not using the Tachyon Internal renderer.

Images

  1. Add the following to your ~/.bashrc
    alias tachyon="/usr/local/lib/vmd/tachyon_LINUXAMD64"
  2. Load your structure. Make your colour and material changes.
    If using ambient occlusion (Display > Display settings > Amb. Occl) and shadows (Display > Display settings > Shadows) use AO-materials or diffuse materials.
    I've found using AO ambient at 0.70 and AO direct at 0.80, and lights 0-3 on, gives good amount of lighting.
    Try decrease AO direct first to darken/increase shading.
    I also use Display > Rendermode > GLSL.
  3. Render image using Tachyon.
    File > Render, select Tachyon from drop down list, change filename (extension is .dat), use default Render Command, click 'Start Rendering'
  4. Open new terminal and cd to dir with your image.dat
  5. Run Tachyon over image.dat to generate high quality image
    tachyon [options] image.dat -o image.tga
    Examples of options: -fullshade -res 800 800 -auto_skylight 0.5 -shade_blinn -aasample 20
    Decreasing the value for auto_skylight lightens the image. I've found anti-aliasing (aasample) needs to be higher (e.g >20) for ribbon/cartoon representations.
    For more options see http://manpages.ubuntu.com/manpages/natty/man1/tachyon.1.html
    The image.dat file can be kept and used to re-render with higher quality if needed e.g. for a poster.

Movies

  1. Extensions > Visualisation > Movie Maker
  2. Set working directory
    Moving making requires large number of files to be genereated therefore probably best to be done locally under /data.
  3. Renderer > Tachyon
  4. Movie Settings > Trajectory
  5. Movie Settings > Delete image file off
  6. Make Movie
    Note VMD will make a movie at 24 frames per second.
  7. To generate a high qualtiy movie you have three options:
    1. Using ImageMagick:
      convert -quality 100 image*ppm movie.mpg
    2. Using MEncoder:
      First convert the .ppm or .tga files to .jpg or .png images:
      for f in *.ppm; do convert -quality 100 $f  `basename $f .ppm`.jpg; done
      Note: change *.ppm to *.tga depending on which files you want to use.
      Then run MEncoder:
      mencoder "mf://*.jpg" -o movie.avi -ovc lavc -lavcopts vcodec=mjpeg
      Note: You can create an mp4 by swapping movie.avi for movie.mp4. Both containers have been tested and work on the Linux workstations, the Windows RDesktop and Mac.
      Further note: I haven't been able to get the MEncoder to use the high-quality H.264 video encoder x264. This is required if you want to embed your video into Microsoft Powerpoint. Low-quality AVI videos can be created using vcodec=wmv2 .
    3. Using ffmpeg to create high-quality videos.
      ffmpeg -i 'filename.%5d.png' -c:v libx264 -pix_fmt yuv420p videoname.mp4
      Note: ffmpeg can use .ppm files directly.