Recording movies

Recording Dialog

Synthclipse is capable of recording movies of shaders. It does not generate a single video file (i.e. .avi, .mpeg, .mov) but instead it outputs a sequence of frames in one of four image formats:

Generated sequence can be easily converted to one video file, using for example FFmpeg:

ffmpeg -framerate 24 -i output.%05d.png -c:v libx264 -pix_fmt yuv420p movie.avi

Recording a movie (image sequence) with Synthclipse is very easy. Just launch a shader you want to record, go to the Recording View (see picture below), select Animation mode, choose FPS and duration, and press the START button.

Detecting recording format at runtime

One can detect recording image format during shader execution. There is special uniform called “SaveFormat” for that purpose. If a shader is not rendered during recording (ordinary rendering), its value is set to 0. If the shader is executed during recording, this variable will have one of the following values:

  • 1 - when PNG is used as image format
  • 2 - when JPG is used as image format
  • 3 - when BMP is used as image format
  • 4 - when EXR is used as image format

Sample usage can be found below.

#define NOT_RECORDING   0
#define SAVE_FORMAT_PNG 1
#define SAVE_FORMAT_JPG 2
#define SAVE_FORMAT_BMP 3
#define SAVE_FORMAT_EXR 4

// Automatically set by Synthclipse
uniform int SaveFormat;

void main() {
	vec3 col;

	switch (SaveFormat) {
	case NOT_RECORDING:
		col = vec3(0.0, 0.0, 0.0);
		break;
	case SAVE_FORMAT_PNG:
		col = vec3(1.0, 0.0, 0.0);
		break;
	case SAVE_FORMAT_JPG:
		col = vec3(0.0, 1.0, 0.0);
		break;
	case SAVE_FORMAT_BMP:
		col = vec3(0.0, 0.0, 1.0);
		break;
	case SAVE_FORMAT_EXR:
		col = vec3(1.0, 1.0, 1.0);
		break;
	default:
		col = vec3(0.0, 1.0, 1.0);
	}

	gl_FragColor = vec4(col, 1.0);
}