[Bf-blender-cvs] [f746d90] master: Cycles Standalone: Various changes

Thomas Dinges noreply at git.blender.org
Sat Jan 25 18:58:53 CET 2014


Commit: f746d90398760b604c0b0037ab5d592dfd88c1ee
Author: Thomas Dinges
Date:   Sat Jan 25 18:57:02 2014 +0100
https://developer.blender.org/rBf746d90398760b604c0b0037ab5d592dfd88c1ee

Cycles Standalone: Various changes

* Change Info in header, put more important info to the left
* API: Move Camera width/height to camera, add some film properties
* Add ESC key to help menu

===================================================================

M	intern/cycles/app/cycles_standalone.cpp
M	intern/cycles/app/cycles_xml.cpp
M	intern/cycles/util/util_view.cpp

===================================================================

diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp
index 144d02e..9250994 100644
--- a/intern/cycles/app/cycles_standalone.cpp
+++ b/intern/cycles/app/cycles_standalone.cpp
@@ -163,8 +163,8 @@ static void display_info(Progress& progress)
 	if(substatus != "")
 		status += ": " + substatus;
 
-	str = string_printf("latency: %.4f        sample: %d        total: %.4f        average: %.4f        %s",
-		latency, sample, total_time, sample_time, status.c_str());
+	str = string_printf("%s        Time: %.2f        Latency: %.4f        Sample: %d        Average: %.4f",
+						status.c_str(), total_time, latency, sample, sample_time);
 
 	view_display_info(str.c_str());
 	
@@ -313,11 +313,11 @@ static void options_parse(int argc, const char **argv)
 		fprintf(stderr, "Unknown shading system: %s\n", ssname.c_str());
 		exit(EXIT_FAILURE);
 	}
-#endif
 	else if(options.scene_params.shadingsystem == SceneParams::OSL && options.session_params.device.type != DEVICE_CPU) {
 		fprintf(stderr, "OSL shading system only works with CPU device\n");
 		exit(EXIT_FAILURE);
 	}
+#endif
 	else if(options.session_params.samples < 0) {
 		fprintf(stderr, "Invalid number of samples: %d\n", options.session_params.samples);
 		exit(EXIT_FAILURE);
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index e6e047a..1e41525 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -223,28 +223,12 @@ static bool xml_read_enum(ustring *str, ShaderEnum& enm, pugi::xml_node node, co
 
 static void xml_read_film(const XMLReadState& state, pugi::xml_node node)
 {
-	Camera *cam = state.scene->camera;
-
-	xml_read_int(&cam->width, node, "width");
-	xml_read_int(&cam->height, node, "height");
-
-	float aspect = (float)cam->width/(float)cam->height;
-
-	if(cam->width >= cam->height) {
-		cam->viewplane.left = -aspect;
-		cam->viewplane.right = aspect;
-		cam->viewplane.bottom = -1.0f;
-		cam->viewplane.top = 1.0f;
-	}
-	else {
-		cam->viewplane.left = -1.0f;
-		cam->viewplane.right = 1.0f;
-		cam->viewplane.bottom = -1.0f/aspect;
-		cam->viewplane.top = 1.0f/aspect;
-	}
+	Film *film = state.scene->film;
+	
+	xml_read_float(&film->exposure, node, "exposure");
 
-	cam->need_update = true;
-	cam->update();
+	/* ToDo: Filter Type */
+	xml_read_float(&film->filter_width, node, "filter_width");
 }
 
 /* Integrator */
@@ -301,6 +285,24 @@ static void xml_read_camera(const XMLReadState& state, pugi::xml_node node)
 {
 	Camera *cam = state.scene->camera;
 
+	xml_read_int(&cam->width, node, "width");
+	xml_read_int(&cam->height, node, "height");
+
+	float aspect = (float)cam->width/(float)cam->height;
+
+	if(cam->width >= cam->height) {
+		cam->viewplane.left = -aspect;
+		cam->viewplane.right = aspect;
+		cam->viewplane.bottom = -1.0f;
+		cam->viewplane.top = 1.0f;
+	}
+	else {
+		cam->viewplane.left = -1.0f;
+		cam->viewplane.right = 1.0f;
+		cam->viewplane.bottom = -1.0f/aspect;
+		cam->viewplane.top = 1.0f/aspect;
+	}
+
 	if(xml_read_float(&cam->fov, node, "fov"))
 		cam->fov *= M_PI/180.0f;
 
diff --git a/intern/cycles/util/util_view.cpp b/intern/cycles/util/util_view.cpp
index 1e8db00..7a9019b 100644
--- a/intern/cycles/util/util_view.cpp
+++ b/intern/cycles/util/util_view.cpp
@@ -78,19 +78,19 @@ void view_display_help()
 {
 	const int w = V.width / 1.15;
 	const int h = V.height / 1.15;
-	
+
 	const int x1 = (V.width - w) / 2;
 	const int x2 = x1 + w;
-	
+
 	const int y1 = (V.height - h) / 2;
 	const int y2 = y1 + h;
-	
+
 	glEnable(GL_BLEND);
 	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-	glColor4f(0.4f, 0.4f, 0.4f, 0.8f);
+	glColor4f(0.5f, 0.5f, 0.5f, 0.8f);
 	glRectf(x1, y1, x2, y2);
 	glDisable(GL_BLEND);
-	
+
 	glColor3f(0.8f, 0.8f, 0.8f);
 
 	view_display_text(x1+20, y2-20, "Cycles Renderer");
@@ -99,7 +99,8 @@ void view_display_help()
 	view_display_text(x1+20, y2-100, "h:  Toggle this help message");
 	view_display_text(x1+20, y2-120, "r:  Restart the render");
 	view_display_text(x1+20, y2-140, "q:  Quit the program");
-	
+	view_display_text(x1+20, y2-160, "esc:  Cancel the render");
+
 	glColor3f(1.0f, 1.0f, 1.0f);
 }




More information about the Bf-blender-cvs mailing list