# Last edited on 2011-05-07 08:19:32 by stolfi SHELL := /bin/bash ####################################################################### # Caller must define # ${OUT_DIR} = output directory. # ${NAME} = name of image to render minus "${OUT_DIR}/" and ".png". # ${WIDTH} = width of image(s). # ${HEIGHT} = height of image(s). # ${NRAYS} = subsampling order (1,2,...). # ${NFRAMES} = number of frames to render (required render-movie or render-strip). # # Optionally also: # ${CLOCK} = Clock value (required for render-still). # ${SHOW} = "YES" to display the image after rendering. ifneq "/${OUT_DIR}" "/" ifneq "/${NAME}" "/" ifneq "/${WIDTH}" "/" ifneq "/${HEIGHT}" "/" ifneq "/${NRAYS}" "/" ifneq "/${NFRAMES}" "/" .PHONY:: render-strip clean-strip CLOCK_FORMAT := "%8.6f" VIEW_STRIP := display -title "%f" CLOCKS := ${shell compute-movie-clocks.sh 0.0 1.0 ${NFRAMES} ${CLOCK_FORMAT}} FRAME_PNGS := ${addprefix ${OUT_DIR}/${NAME}-,${addsuffix .png,${CLOCKS}}} ${OUT_DIR}: mkdir -p ${OUT_DIR} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # "make render-strip" creates a strip with several frames: STRIP_NAME := ${NAME}-str STRIP_PNG := ${OUT_DIR}/${STRIP_NAME}.png render-strip: ${OUT_DIR} clean-strip ${STRIP_PNG} ${STRIP_PNG}: for clock in ${CLOCKS} ; do \ ${MAKE} -f POVRAY-FRAME.make \ NAME=${NAME} CLOCK=$$clock \ WIDTH=${WIDTH} HEIGHT=${HEIGHT} NRAYS=${NRAYS} \ SHOWOPT='+D' \ render-frame; \ done ./tile-movie-frames.sh \ -ncols 5 \ ${STRIP_PNG} \ ${FRAME_PNGS} @-if [[ -s ${STRIP_PNG} ]]; then \ if [[ "/${SHOW}" == "/YES" ]]; then ${VIEW_STRIP} ${STRIP_PNG} ; fi ;\ fi clean-strip: -/bin/rm -f ${OUT_DIR}/${NAME}.log ${OUT_DIR}/${NAME}-*.log -/bin/rm -f ${FRAME_PNGS} -/bin/rm -f ${STRIP_PNG} # End ${OUT_DIR}, ${NAME}, ${WIDTH}, ${HEIGHT}, ${NRAYS}, ${NFRAMES} section ###################################################################### endif endif endif endif endif endif