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
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/util/util_projection.h')
-rw-r--r--intern/cycles/util/util_projection.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/intern/cycles/util/util_projection.h b/intern/cycles/util/util_projection.h
index 8073568046d..dbcb9877a48 100644
--- a/intern/cycles/util/util_projection.h
+++ b/intern/cycles/util/util_projection.h
@@ -35,7 +35,7 @@ typedef struct ProjectionTransform {
: x(tfm.x),
y(tfm.y),
z(tfm.z),
- w(tfm.w)
+ w(make_float4(0.0f, 0.0f, 0.0f, 1.0f))
{
}
#endif
@@ -69,6 +69,12 @@ ccl_device_inline float3 transform_perspective_direction(const ProjectionTransfo
#ifndef __KERNEL_GPU__
+ccl_device_inline Transform projection_to_transform(const ProjectionTransform& a)
+{
+ Transform tfm = {a.x, a.y, a.z};
+ return tfm;
+}
+
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform& a)
{
ProjectionTransform t;
@@ -81,12 +87,7 @@ ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTrans
return t;
}
-ccl_device_inline ProjectionTransform projection_inverse(const ProjectionTransform& a)
-{
- Transform t = {a.x, a.y, a.z, a.w};
- t = transform_inverse(t);
- return ProjectionTransform(t);
-}
+ProjectionTransform projection_inverse(const ProjectionTransform& a);
ccl_device_inline ProjectionTransform make_projection(
float a, float b, float c, float d,