33 #ifdef WITH_CYCLES_STANDALONE_GUI
56 printf(
"\r%s",
str.c_str());
59 static int maxlen = 0;
63 for (
int i =
len; i < maxlen; i++)
72 string status, substatus;
79 status +=
": " + substatus;
82 status =
string_printf(
"Progress %05.2f %s", (
double)progress * 100, status.c_str());
131 #ifdef WITH_CYCLES_STANDALONE_GUI
145 #ifdef WITH_CYCLES_STANDALONE_GUI
175 #ifdef WITH_CYCLES_STANDALONE_GUI
176 static void display_info(
Progress &progress)
178 static double latency = 0.0;
179 static double last = 0;
181 string str, interactive;
183 latency = (elapsed - last);
186 double total_time, sample_time;
187 string status, substatus;
189 progress.
get_time(total_time, sample_time);
194 status +=
": " + substatus;
208 (
double)progress_val * 100,
210 interactive.c_str());
218 static void display()
225 static void motion(
int x,
int y,
int button)
237 else if (button == 2) {
271 static void keyboard(
unsigned char key)
286 else if (key ==
'p') {
296 else if (
options.
interactive && (key ==
'w' || key ==
'a' || key ==
's' || key ==
'd')) {
320 else if (
options.
interactive && (key ==
'0' || key ==
'1' || key ==
'2' || key ==
'3')) {
366 string device_names =
"";
367 string devicename =
"CPU";
373 if (device_names !=
"")
374 device_names +=
", ";
380 string ssname =
"svm";
384 bool help =
false, profile =
false, debug =
false, version =
false;
387 ap.options(
"Usage: cycles [options] file.xml",
393 (
"Devices to use: " + device_names).c_str(),
397 "Shading system to use: svm, osl",
401 "Render in background, without user interface",
404 "In background mode, don't print progress messages",
407 "Number of samples to render",
410 "File path to write output image",
413 "CPU Rendering Threads",
416 "Window width in pixel",
419 "Window height in pixel",
422 "Tile size in pixels",
425 "List information about all available devices",
428 "Enable profile logging",
429 #ifdef WITH_CYCLES_LOGGING
432 "Enable debug logging",
435 "Set verbosity of the logger",
439 "Print help message",
442 "Print version number",
445 if (ap.parse(argc, argv) < 0) {
446 fprintf(stderr,
"%s\n", ap.geterror().c_str());
458 printf(
"Devices:\n");
461 printf(
" %-10s%s%s\n",
482 else if (ssname ==
"svm")
485 #ifndef WITH_CYCLES_STANDALONE_GUI
497 bool device_available =
false;
500 device_available =
true;
505 fprintf(stderr,
"Unknown device: %s\n", devicename.c_str());
509 else if (!(ssname ==
"osl" || ssname ==
"svm")) {
510 fprintf(stderr,
"Unknown shading system: %s\n", ssname.c_str());
515 fprintf(stderr,
"OSL shading system only works with CPU device\n");
524 fprintf(stderr,
"No file path specified\n");
533 int main(
int argc,
const char **argv)
539 #ifdef WITH_CYCLES_STANDALONE_GUI
545 #ifdef WITH_CYCLES_STANDALONE_GUI
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
static vector< DeviceInfo > available_devices(uint device_type_mask=DEVICE_MASK_ALL)
static DeviceType type_from_string(const char *name)
static vector< DeviceType > available_types()
static string string_from_type(DeviceType type)
void get_status(string &status_, string &substatus_) const
void set_cancel(const string &cancel_message_)
void get_time(double &total_time_, double &render_time_) const
double get_progress() const
void set_update_callback(function< void()> function)
ShadingSystem shadingsystem
void set_pause(bool pause)
void set_display_driver(unique_ptr< DisplayDriver > driver)
void reset(const SessionParams &session_params, const BufferParams &buffer_params)
void set_output_driver(unique_ptr< OutputDriver > driver)
#define CCL_NAMESPACE_END
static void session_init()
int main(int argc, const char **argv)
static void session_print_status()
static void session_exit()
static void options_parse(int argc, const char **argv)
static BufferParams & session_buffer_params()
CCL_NAMESPACE_BEGIN struct Options options
static void session_print(const string &str)
static int files_parse(int argc, const char *argv[])
void xml_read_file(Scene *scene, const char *filepath)
#define DEVICE_MASK(type)
CCL_NAMESPACE_BEGIN void util_logging_init(const char *argv0)
void util_logging_verbosity_set(int verbosity)
void util_logging_start()
Vector< CPUDevice > devices
list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
string path_filename(const string &path)
void path_init(const string &path, const string &user_path)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
bool string_endswith(const string_view s, const string_view end)
string string_to_lower(const string &s)
SessionParams session_params
T * create_node(Args &&...args)
CCL_NAMESPACE_BEGIN double time_dt()
#define CYCLES_VERSION_STRING
void window_main_loop(const char *title, int width, int height, WindowInitFunc initf, WindowExitFunc exitf, WindowResizeFunc resize, WindowDisplayFunc display, WindowKeyboardFunc keyboard, WindowMotionFunc motion)
void window_opengl_context_disable()
bool window_opengl_context_enable()
void window_display_info(const char *info)
void window_display_help()