VMD
From MDWiki
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
- Add the following to your ~/.bashrc
alias tachyon="/usr/local/lib/vmd/tachyon_LINUXAMD64"
- 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.
- Render image using Tachyon.
- File > Render, select Tachyon from drop down list, change filename (extension is .dat), use default Render Command, click 'Start Rendering'
- Open new terminal and cd to dir with your image.dat
- 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.
- If you want to use Povray:
- Change renderer in VMD to POV-Ray 3.6
- In the render command box you can specify the pixel width and height (+W +H flags), specify file format (e.g. change +FT to +FN for png, along with the extension for the file output name -Ofilename.png)
- POV-Ray should be called automatically by VMD, however the filename.pov file that's also written can be kept and used by directly calling povray in the command line.
Movies
- Extensions > Visualisation > Movie Maker
- Set working directory
- Moving making requires large number of files to be genereated therefore probably best to be done locally under /data.
- Renderer > Tachyon
- Movie Settings > Trajectory
- Movie Settings > Delete image file off
- Make Movie
- Note VMD will make a movie at 24 frames per second.
- To generate a high qualtiy movie you have three options:
- Using ImageMagick:
convert -quality 100 image*ppm movie.mpg
- 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
formovie.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
.
- 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.
- Using ImageMagick: