[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56725] branches/soc-2011-tomato: Merging r56720 through r56724 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Sun May 12 21:05:45 CEST 2013
Revision: 56725
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56725
Author: nazgul
Date: 2013-05-12 19:05:45 +0000 (Sun, 12 May 2013)
Log Message:
-----------
Merging r56720 through r56724 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56720
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56724
Modified Paths:
--------------
branches/soc-2011-tomato/intern/cycles/kernel/kernel_camera.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
branches/soc-2011-tomato/source/blender/editors/render/render_internal.c
branches/soc-2011-tomato/source/blender/imbuf/IMB_colormanagement.h
branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-56719
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-56724
Modified: branches/soc-2011-tomato/intern/cycles/kernel/kernel_camera.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/kernel_camera.h 2013-05-12 19:01:23 UTC (rev 56724)
+++ branches/soc-2011-tomato/intern/cycles/kernel/kernel_camera.h 2013-05-12 19:05:45 UTC (rev 56725)
@@ -109,8 +109,7 @@
float2 lensuv = camera_sample_aperture(kg, lens_u, lens_v)*aperturesize;
/* compute point on plane of focus */
- float ft = kernel_data.cam.focaldistance/ray->D.z;
- float3 Pfocus = ray->D*ft;
+ float3 Pfocus = ray->D * kernel_data.cam.focaldistance;
/* update ray for effect of lens */
float3 lensuvw = make_float3(lensuv.x, lensuv.y, 0.0f);
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c 2013-05-12 19:01:23 UTC (rev 56724)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c 2013-05-12 19:05:45 UTC (rev 56725)
@@ -3115,8 +3115,8 @@
* aligned correct or not.
*/
if (!origin_set) {
- copy_m4_m4(imat, mat);
- invert_m4(imat);
+ invert_m4_m4(imat, mat);
+ unit_m4(mat);
origin_set = true;
}
else {
Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-56719
+ /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-56724
Modified: branches/soc-2011-tomato/source/blender/editors/render/render_internal.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/render/render_internal.c 2013-05-12 19:01:23 UTC (rev 56724)
+++ branches/soc-2011-tomato/source/blender/editors/render/render_internal.c 2013-05-12 19:05:45 UTC (rev 56725)
@@ -42,6 +42,7 @@
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
+#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_context.h"
@@ -1008,7 +1009,6 @@
engine->flag |= RE_ENGINE_DO_UPDATE;
// if (update)
// printf("changed ma %d res %d view %d\n", update & PR_UPDATE_MATERIAL, update & PR_UPDATE_RENDERSIZE, update & PR_UPDATE_VIEW);
-
}
return update;
@@ -1028,18 +1028,48 @@
RE_AcquireResultImage(re, &rres);
if (rres.rectf) {
- unsigned char *rect_byte = MEM_mallocN(rres.rectx * rres.recty * sizeof(int), "ed_preview_draw_rect");
-
- RE_AcquiredResultGet32(re, &rres, (unsigned int *)rect_byte);
-
- glEnable(GL_BLEND);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- glaDrawPixelsTex(rres.xof, rres.yof, rres.rectx, rres.recty, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, rect_byte);
- glDisable(GL_BLEND);
-
- MEM_freeN(rect_byte);
+ Scene *scene = CTX_data_scene(C);
+ bool force_fallback = false;
+ bool need_fallback = true;
+ float dither = scene->r.dither_intensity;
+
+ /* Dithering is not supported on GLSL yet */
+ force_fallback |= dither != 0.0f;
+
+ /* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */
+ force_fallback |= (U.image_draw_method != IMAGE_DRAW_METHOD_GLSL);
+
+ /* Try using GLSL display transform. */
+ if (force_fallback == false) {
+ if (IMB_colormanagement_setup_glsl_draw(NULL, &scene->display_settings, TRUE)) {
+ glEnable(GL_BLEND);
+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ glaDrawPixelsTex(rres.xof, rres.yof, rres.rectx, rres.recty, GL_RGBA, GL_FLOAT,
+ GL_LINEAR, rres.rectf);
+ glDisable(GL_BLEND);
+
+ IMB_colormanagement_finish_glsl_draw();
+ need_fallback = false;
+ }
+ }
+
+ /* If GLSL failed, use old-school CPU-based transform. */
+ if (need_fallback) {
+ unsigned char *display_buffer = MEM_mallocN(4 * rres.rectx * rres.recty * sizeof(char),
+ "render_view3d_draw");
+
+ IMB_colormanagement_buffer_make_display_space(rres.rectf, display_buffer, rres.rectx, rres.recty,
+ 4, dither, NULL, &scene->display_settings);
+
+ glEnable(GL_BLEND);
+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ glaDrawPixelsAuto(rres.xof, rres.yof, rres.rectx, rres.recty, GL_RGBA, GL_UNSIGNED_BYTE,
+ GL_LINEAR, display_buffer);
+ glDisable(GL_BLEND);
+
+ MEM_freeN(display_buffer);
+ }
}
RE_ReleaseResultImage(re);
}
-
Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-56719
+ /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-56724
Modified: branches/soc-2011-tomato/source/blender/imbuf/IMB_colormanagement.h
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/IMB_colormanagement.h 2013-05-12 19:01:23 UTC (rev 56724)
+++ branches/soc-2011-tomato/source/blender/imbuf/IMB_colormanagement.h 2013-05-12 19:05:45 UTC (rev 56725)
@@ -93,6 +93,11 @@
const struct ColorManagedDisplaySettings *display_settings,
struct ImageFormatData *image_format_data);
+void IMB_colormanagement_buffer_make_display_space(float *buffer, unsigned char *display_buffer,
+ int width, int height, int channels, float dither,
+ const struct ColorManagedViewSettings *view_settings,
+ const struct ColorManagedDisplaySettings *display_settings);
+
/* ** Public display buffers interfaces ** */
void IMB_colormanagement_display_settings_from_ctx(const struct bContext *C,
Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c 2013-05-12 19:01:23 UTC (rev 56724)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c 2013-05-12 19:05:45 UTC (rev 56725)
@@ -1863,6 +1863,30 @@
return colormanaged_ibuf;
}
+void IMB_colormanagement_buffer_make_display_space(float *buffer, unsigned char *display_buffer,
+ int width, int height, int channels, float dither,
+ const ColorManagedViewSettings *view_settings,
+ const ColorManagedDisplaySettings *display_settings)
+{
+ ColormanageProcessor *cm_processor;
+ size_t float_buffer_size = width * height * channels * sizeof(float);
+ float *display_buffer_float = MEM_mallocN(float_buffer_size, "byte_buffer_make_display_space");
+
+ memcpy(display_buffer_float, buffer, float_buffer_size);
+
+ cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings);
+
+ processor_transform_apply_threaded(display_buffer_float, width, height, channels,
+ cm_processor, TRUE);
+
+ IMB_buffer_byte_from_float(display_buffer, display_buffer_float,
+ channels, dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB,
+ TRUE, width, height, width, width);
+
+ MEM_freeN(display_buffer_float);
+ IMB_colormanagement_processor_free(cm_processor);
+}
+
static void imbuf_verify_float(ImBuf *ibuf)
{
/* multiple threads could request for display buffer at once and in case
Modified: branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c
===================================================================
--- branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c 2013-05-12 19:01:23 UTC (rev 56724)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list