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:
authorMatt Ebb <matt@mke3.net>2007-09-07 07:48:50 +0400
committerMatt Ebb <matt@mke3.net>2007-09-07 07:48:50 +0400
commit0ba5295404dd1c2ee04a9e7823eafc664562f4eb (patch)
tree816891a80322ecc06a5016cfb1e8ef4abba9f0ba /source/blender/blenlib
parentf85cd06873a991fec91766ea8cd5efe3eda17594 (diff)
* QMC Raytracing
This introduces QMC sampling for use in glossy reflections/refractions, soft raytraced shadows, and ambient occlusion. This work includes many new features and speed-ups, so check out the nice docs here: Glossy Reflection/Refraction http://www.blender.org/development/current-projects/changes-since-244/glossy-reflectionrefraction/ Raytraced Soft Shadows http://www.blender.org/development/current-projects/changes-since-244/raytraced-soft-shadows/ QMC Sampling http://www.blender.org/development/current-projects/changes-since-244/qmc-sampling/ Many thanks to Brecht van Lommel for some initial code snippets and for reviewing the patch, and especially to Alfredo de Greef who gave me a lot of guidance and help along the way!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_arithb.h2
-rw-r--r--source/blender/blenlib/intern/arithb.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index b2043bfcf93..fc132250fc6 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -244,6 +244,8 @@ void VecSubf(float *v, float *v1, float *v2);
void VecLerpf(float *target, float *a, float *b, float t);
void VecMidf(float *v, float *v1, float *v2);
+void VecOrthoBasisf(float *v, float *v1, float *v2);
+
float Vec2Lenf(float *v1, float *v2);
void Vec2Mulf(float *v1, float f);
void Vec2Addf(float *v, float *v1, float *v2);
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index d93f4b9c009..f95d102763a 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -2093,6 +2093,30 @@ void VecMulf(float *v1, float f)
v1[2]*= f;
}
+void VecOrthoBasisf(float *v, float *v1, float *v2)
+{
+ if (v[0] == 0.0f && v[1] == 0.0f)
+ {
+ // degenerate case
+ v1[0] = 0.0f; v1[1] = 1.0f; v1[2] = 0.0f;
+ if (v[2] > 0.0f) {
+ v2[0] = 1.0f; v2[1] = v2[2] = 0.0f;
+ }
+ else {
+ v2[0] = -1.0f; v2[1] = v2[2] = 0.0f;
+ }
+ }
+ else
+ {
+ float f = 1.0f/sqrt(v[0]*v[0] + v[1]*v[1]);
+ v1[0] = v[1]*f;
+ v1[1] = -v[0]*f;
+ v1[2] = 0.0f;
+
+ Crossf(v2, v, v1);
+ }
+}
+
int VecLenCompare(float *v1, float *v2, float limit)
{
float x,y,z;