Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-26 23:20:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-26 23:20:33 +0400
commitde4eeb96946943289ac898525f09fc9c7afd4157 (patch)
tree5887eac0f56db6ce226a25ae34eaaa1169c7ee3a /intern
parentce90b472afbe4f90af60e19a0a6cc6704d3a3549 (diff)
parent4514a4455be89bc0a789d78355321abe6cfd5112 (diff)
svn merge ^/trunk/blender -r43693:43733
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_session.cpp10
-rw-r--r--intern/cycles/kernel/kernel_film.h2
-rw-r--r--intern/cycles/kernel/kernel_passes.h15
-rw-r--r--intern/cycles/kernel/kernel_path.h6
-rw-r--r--intern/cycles/render/buffers.cpp15
-rw-r--r--intern/cycles/util/util_progress.h2
-rw-r--r--intern/ffmpeg/ffmpeg_compat.h1
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp50
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.h10
9 files changed, 81 insertions, 30 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index ff1c32831bb..5e3102fd7c7 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -203,6 +203,9 @@ void BlenderSession::render()
b_rlay = *b_iter;
/* add passes */
+ vector<Pass> passes;
+ Pass::add(PASS_COMBINED, passes);
+
if(session_params.device.type == DEVICE_CPU) { /* todo */
BL::RenderLayer::passes_iterator b_pass_iter;
@@ -211,12 +214,13 @@ void BlenderSession::render()
PassType pass_type = get_pass_type(b_pass);
if(pass_type != PASS_NONE)
- Pass::add(pass_type, buffer_params.passes);
+ Pass::add(pass_type, passes);
}
}
- scene->film->passes = buffer_params.passes;
- scene->film->need_update = true;
+ buffer_params.passes = passes;
+ scene->film->passes = passes;
+ scene->film->tag_update(scene);
/* update session */
session->reset(buffer_params, session_params.samples);
diff --git a/intern/cycles/kernel/kernel_film.h b/intern/cycles/kernel/kernel_film.h
index d0fb5402291..232049fb6cb 100644
--- a/intern/cycles/kernel/kernel_film.h
+++ b/intern/cycles/kernel/kernel_film.h
@@ -59,7 +59,7 @@ __device void kernel_film_tonemap(KernelGlobals *kg,
buffer += index*kernel_data.film.pass_stride;
/* map colors */
- float4 irradiance = *(float4*)buffer;
+ float4 irradiance = *((__global float4*)buffer);
float4 float_result = film_map(kg, irradiance, sample);
uchar4 byte_result = film_float_to_byte(float_result);
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h
index 0e775812eda..cfd73c98bad 100644
--- a/intern/cycles/kernel/kernel_passes.h
+++ b/intern/cycles/kernel/kernel_passes.h
@@ -20,31 +20,22 @@ CCL_NAMESPACE_BEGIN
__device_inline void kernel_write_pass_float(__global float *buffer, int sample, float value)
{
- float *buf = buffer;
+ __global float *buf = buffer;
*buf = (sample == 0)? value: *buf + value;
}
__device_inline void kernel_write_pass_float3(__global float *buffer, int sample, float3 value)
{
- float3 *buf = (float3*)buffer;
+ __global float3 *buf = (__global float3*)buffer;
*buf = (sample == 0)? value: *buf + value;
}
__device_inline void kernel_write_pass_float4(__global float *buffer, int sample, float4 value)
{
- float4 *buf = (float4*)buffer;
+ __global float4 *buf = (__global float4*)buffer;
*buf = (sample == 0)? value: *buf + value;
}
-__device_inline void kernel_clear_passes(__global float *buffer, int sample, int pass_stride)
-{
-#ifdef __PASSES__
- if(sample == 0 && pass_stride != 4)
- for(int i = 4; i < pass_stride; i++)
- buffer[i] = 0.0f;
-#endif
-}
-
__device void kernel_write_data_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L,
ShaderData *sd, int sample, int path_flag, float3 throughput)
{
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index c0bfa320405..1a42cf1ed7e 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -220,7 +220,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
path_radiance_init(&L, kernel_data.film.use_light_pass);
-#ifdef __EMISSION__
+#if defined(__EMISSION__) || defined(__BACKGROUND__)
float ray_pdf = 0.0f;
#endif
PathState state;
@@ -239,11 +239,13 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
if(kernel_data.background.transparent && (state.flag & PATH_RAY_CAMERA)) {
L_transparent += average(throughput);
}
+#ifdef __BACKGROUND__
else {
/* sample background shader */
float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
path_radiance_accum_background(&L, throughput, L_background, state.bounce);
}
+#endif
break;
}
@@ -377,8 +379,6 @@ __device void kernel_path_trace(KernelGlobals *kg,
rng_state += index;
buffer += index*pass_stride;
- kernel_clear_passes(buffer, sample, pass_stride);
-
/* initialize random numbers */
RNG rng;
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 08dda944111..56219482ef0 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -157,10 +157,17 @@ bool RenderBuffers::get_pass(PassType type, float exposure, int sample, int comp
assert(pass.components == components);
/* scalar */
- for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
- float f = *in;
-
- pixels[0] = f*scale_exposure;
+ if(type == PASS_DEPTH) {
+ for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
+ float f = *in;
+ pixels[0] = (f == 0.0f)? 1e10f: f*scale_exposure;
+ }
+ }
+ else {
+ for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
+ float f = *in;
+ pixels[0] = f*scale_exposure;
+ }
}
}
else if(components == 3) {
diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h
index acb00b03507..2cc2995bcfe 100644
--- a/intern/cycles/util/util_progress.h
+++ b/intern/cycles/util/util_progress.h
@@ -96,7 +96,7 @@ public:
{
thread_scoped_lock lock(progress_mutex);
- start_time = start_time;
+ start_time = start_time_;
}
void set_sample(int sample_, double sample_time_)
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index dfdad22e176..582086d130b 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -35,6 +35,7 @@
#include <libavcodec/avcodec.h>
#include <libavutil/rational.h>
+#include <libavutil/opt.h>
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 101))
#define FFMPEG_HAVE_PARSE_UTILS 1
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index db4ed306dbe..0f5149de037 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -77,6 +77,12 @@ static const char* ndof_button_names[] = {
"NDOF_BUTTON_8",
"NDOF_BUTTON_9",
"NDOF_BUTTON_10",
+ // more general-purpose buttons
+ "NDOF_BUTTON_A",
+ "NDOF_BUTTON_B",
+ "NDOF_BUTTON_C",
+ // the end
+ "NDOF_BUTTON_LAST"
};
#endif
@@ -169,7 +175,7 @@ static const NDOF_ButtonT SpaceMousePro_HID_map[] = {
};
/* this is the older SpacePilot (sans Pro)
- * thanks to polosson for the info in this table */
+ * thanks to polosson for info about this device */
static const NDOF_ButtonT SpacePilot_HID_map[] = {
NDOF_BUTTON_1,
NDOF_BUTTON_2,
@@ -194,6 +200,23 @@ static const NDOF_ButtonT SpacePilot_HID_map[] = {
NDOF_BUTTON_NONE // the CONFIG button -- what does it do?
};
+/* this is the older Spaceball 5000 USB
+ * thanks to Tehrasha Darkon for info about this device */
+static const NDOF_ButtonT Spaceball5000_HID_map[] = {
+ NDOF_BUTTON_1,
+ NDOF_BUTTON_2,
+ NDOF_BUTTON_3,
+ NDOF_BUTTON_4,
+ NDOF_BUTTON_5,
+ NDOF_BUTTON_6,
+ NDOF_BUTTON_7,
+ NDOF_BUTTON_8,
+ NDOF_BUTTON_9,
+ NDOF_BUTTON_A,
+ NDOF_BUTTON_B,
+ NDOF_BUTTON_C
+};
+
GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
: m_system(sys)
, m_deviceType(NDOF_UnknownDevice) // each platform has its own device detection code
@@ -237,12 +260,12 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
m_buttonCount = 15;
break;
case 0xC629:
- puts("ndof: using SpacePilotPro");
+ puts("ndof: using SpacePilot Pro");
m_deviceType = NDOF_SpacePilotPro;
m_buttonCount = 31;
break;
case 0xC62B:
- puts("ndof: using SpaceMousePro");
+ puts("ndof: using SpaceMouse Pro");
m_deviceType = NDOF_SpaceMousePro;
m_buttonCount = 27;
// ^^ actually has 15 buttons, but their HID codes range from 0 to 26
@@ -255,6 +278,12 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
m_buttonCount = 21;
break;
+ case 0xC621:
+ puts("ndof: using Spaceball 5000");
+ m_deviceType = NDOF_Spaceball5000;
+ m_buttonCount = 12;
+ break;
+
case 0xC623:
puts("ndof: SpaceTraveler not supported, please file a bug report");
m_buttonCount = 8;
@@ -385,8 +414,21 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64
default: sendButtonEvent(SpacePilot_HID_map[button_number], press, time, window);
}
break;
+ case NDOF_Spaceball5000:
+ // has no special 'keyboard' buttons
+ sendButtonEvent(Spaceball5000_HID_map[button_number], press, time, window);
+ break;
case NDOF_UnknownDevice:
- printf("ndof: button %d on unknown device (ignoring)\n", button_number);
+ printf("ndof: button %d on unknown device (", button_number);
+ // map to the 'general purpose' buttons
+ // this is mainly for old serial devices
+ if (button_number < NDOF_BUTTON_LAST - NDOF_BUTTON_1) {
+ printf("sending)\n");
+ sendButtonEvent((NDOF_ButtonT)(NDOF_BUTTON_1 + button_number), press, time, window);
+ }
+ else {
+ printf("discarding)\n");
+ }
}
int mask = 1 << button_number;
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h b/intern/ghost/intern/GHOST_NDOFManager.h
index 701f458ccf1..c4e980bb895 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -40,7 +40,8 @@ typedef enum {
NDOF_SpaceMousePro,
// older devices
- NDOF_SpacePilot
+ NDOF_SpacePilot,
+ NDOF_Spaceball5000
} NDOF_DeviceT;
@@ -87,7 +88,12 @@ typedef enum {
NDOF_BUTTON_8,
NDOF_BUTTON_9,
NDOF_BUTTON_10,
-
+ // more general-purpose buttons
+ NDOF_BUTTON_A,
+ NDOF_BUTTON_B,
+ NDOF_BUTTON_C,
+ // the end
+ NDOF_BUTTON_LAST
} NDOF_ButtonT;
class GHOST_NDOFManager