39 #ifdef WITH_CYCLES_STANDALONE_GUI
62 printf(
"\r%s",
str.c_str());
65 static int maxlen = 0;
69 for (
int i =
len; i < maxlen; i++)
78 string status, substatus;
85 status +=
": " + substatus;
88 status =
string_printf(
"Progress %05.2f %s", (
double)progress * 100, status.c_str());
97 unique_ptr<ImageOutput> out = unique_ptr<ImageOutput>(ImageOutput::create(
options.
output_path));
102 ImageSpec spec(
w, h, channels, TypeDesc::UINT8);
109 TypeDesc::UINT8, pixels + (h - 1) *
w * channels, AutoStride, -
w * channels, AutoStride);
124 return buffer_params;
155 #ifdef WITH_CYCLES_STANDALONE_GUI
181 #ifdef WITH_CYCLES_STANDALONE_GUI
182 static void display_info(
Progress &progress)
184 static double latency = 0.0;
185 static double last = 0;
187 string str, interactive;
189 latency = (elapsed - last);
192 double total_time, sample_time;
193 string status, substatus;
195 progress.
get_time(total_time, sample_time);
200 status +=
": " + substatus;
214 (
double)progress_val * 100,
216 interactive.c_str());
224 static void display()
233 static void motion(
int x,
int y,
int button)
245 else if (button == 2) {
246 float4 r1 =
make_float4((
float)
x * 0.1f, 0.0f, 1.0f, 0.0f);
279 static void keyboard(
unsigned char key)
294 else if (key ==
'p') {
304 else if (
options.
interactive && (key ==
'w' || key ==
'a' || key ==
's' || key ==
'd')) {
328 else if (
options.
interactive && (key ==
'0' || key ==
'1' || key ==
'2' || key ==
'3')) {
372 string device_names =
"";
373 string devicename =
"CPU";
379 if (device_names !=
"")
380 device_names +=
", ";
386 string ssname =
"svm";
390 bool help =
false, debug =
false, version =
false;
393 ap.options(
"Usage: cycles [options] file.xml",
399 (
"Devices to use: " + device_names).c_str(),
403 "Shading system to use: svm, osl",
407 "Render in background, without user interface",
410 "In background mode, don't print progress messages",
413 "Number of samples to render",
416 "File path to write output image",
419 "CPU Rendering Threads",
422 "Window width in pixel",
425 "Window height in pixel",
428 "Tile width in pixels",
431 "Tile height in pixels",
434 "List information about all available devices",
435 #ifdef WITH_CYCLES_LOGGING
438 "Enable debug logging",
441 "Set verbosity of the logger",
445 "Print help message",
448 "Print version number",
451 if (ap.parse(argc, argv) < 0) {
452 fprintf(stderr,
"%s\n", ap.geterror().c_str());
464 printf(
"Devices:\n");
467 printf(
" %-10s%s%s\n",
486 else if (ssname ==
"svm")
489 #ifndef WITH_CYCLES_STANDALONE_GUI
500 bool device_available =
false;
503 device_available =
true;
508 fprintf(stderr,
"Unknown device: %s\n", devicename.c_str());
512 else if (!(ssname ==
"osl" || ssname ==
"svm")) {
513 fprintf(stderr,
"Unknown shading system: %s\n", ssname.c_str());
518 fprintf(stderr,
"OSL shading system only works with CPU device\n");
527 fprintf(stderr,
"No file path specified\n");
539 int main(
int argc,
const char **argv)
545 #ifdef WITH_CYCLES_STANDALONE_GUI
551 #ifdef WITH_CYCLES_STANDALONE_GUI
_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
_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 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
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
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 set_cancel(const string &cancel_message_)
void get_status(string &status_, string &substatus_)
void get_time(double &total_time_, double &render_time_)
void set_update_callback(function< void()> function)
ShadingSystem shadingsystem
function< bool(const uchar *pixels, int width, int height, int channels)> write_render_cb
bool draw(BufferParams ¶ms, DeviceDrawParams &draw_params)
void set_pause(bool pause)
void reset(BufferParams ¶ms, int samples)
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 bool write_render(const uchar *pixels, int w, int h, int channels)
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)
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
Vector< CPUDevice > devices
list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
SessionParams session_params
void util_logging_init(const char *argv0)
void util_logging_verbosity_set(int verbosity)
void util_logging_start()
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,...)
CCL_NAMESPACE_BEGIN double time_dt()
#define CYCLES_VERSION_STRING
void view_main_loop(const char *title, int width, int height, ViewInitFunc initf, ViewExitFunc exitf, ViewResizeFunc resize, ViewDisplayFunc display, ViewKeyboardFunc keyboard, ViewMotionFunc motion)
void view_display_info(const char *info)