Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1326 - in trunk: Engine/Shadows Model/Groups Model/Materials
- Date: Tue, 10 Apr 2007 15:17:38 -0600 (MDT)
Author: boulos
Date: Tue Apr 10 15:17:38 2007
New Revision: 1326
Modified:
trunk/Engine/Shadows/HardShadows.cc
trunk/Model/Groups/DynBVH.cc
trunk/Model/Materials/Dielectric.cc
trunk/Model/Materials/Lambertian.cc
Log:
Adding include for iostream and using std::cerr
(compiles on Macs now)
Modified: trunk/Engine/Shadows/HardShadows.cc
==============================================================================
--- trunk/Engine/Shadows/HardShadows.cc (original)
+++ trunk/Engine/Shadows/HardShadows.cc Tue Apr 10 15:17:38 2007
@@ -10,13 +10,14 @@
#include <Core/Exceptions/IllegalArgument.h>
#include <Core/Util/Args.h>
#include <Interface/Material.h>
-
+#include <iostream>
// TODO
// 0 copy in light stuff
// eliminate cleanup loops???
// 2-sided lighting
using namespace Manta;
+using std::cerr;
ShadowAlgorithm* HardShadows::create(const vector<string>& args)
{
@@ -44,7 +45,7 @@
void HardShadows::computeShadows(const RenderContext& context,
StateBuffer& stateBuffer,
- const LightSet* lights,
+ const LightSet* lights,
RayPacket& sourceRays, // Input rays.
RayPacket& shadowRays) // Output
shadow rays, already intersected.
{
@@ -53,9 +54,9 @@
cerr << "HardShadows::computeShadows called\n";
// cerr << SCIRun::getStackTrace();
}
-
+
int nlights = lights->numLights();
-
+
// Compute the hit positions.
sourceRays.computeHitPositions();
sourceRays.computeFFNormals( context );
@@ -85,7 +86,7 @@
if(Dot(dir, sourceRays.getFFNormal(i)) > 0) {
// If so normalize and compute length.
Real length = dir.normalize();
-
+
// Populate the shadow ray.
shadowRays.setRay(i, sourceRays.getHitPosition(i), dir );
shadowRays.resetHit(i, length );
@@ -101,10 +102,10 @@
for(;i<b;i++){
Vector dir = shadowRays.getDirection(i);
if(Dot(dir, sourceRays.getFFNormal(i)) > 0) {
-
+
// If so normalize and compute length.
Real length = dir.normalize();
-
+
// Populate the shadow ray.
shadowRays.setRay(i, sourceRays.getHitPosition(i), dir );
shadowRays.resetHit(i, length );
@@ -128,8 +129,8 @@
__m128 mask = _mm_cmple_ps(dir, _mm_setzero_ps());
#ifdef __x86_64
- _mm_store_ps((float*)&shadowData->hitMatl[i], _mm_unpacklo_ps(mask,
mask));
- _mm_store_ps((float*)&shadowData->hitMatl[i+2], _mm_unpackhi_ps(mask,
mask));
+ _mm_store_ps((float*)&shadowData->hitMatl[i], _mm_unpacklo_ps(mask,
mask));
+ _mm_store_ps((float*)&shadowData->hitMatl[i+2],
_mm_unpackhi_ps(mask, mask));
#else
_mm_store_ps((float*)&shadowData->hitMatl[i], mask);
#endif
@@ -143,7 +144,7 @@
inv_length = _mm_mul_ps(_mm_mul_ps(inv_length,
_mm_sub_ps(_mm_set1_ps(3.f), _mm_mul_ps(length2, _mm_mul_ps(inv_length,
inv_length)))), _mm_set1_ps(0.5f));
__m128 length = _mm_rcp_ps(inv_length);
length = _mm_mul_ps(length, _mm_sub_ps(_mm_set1_ps(2.f),
_mm_mul_ps(inv_length, length)));
-
+
// Populate the shadow ray.
_mm_store_ps(&shadowData->direction[0][i], _mm_mul_ps(dx,
inv_length));
_mm_store_ps(&shadowData->direction[1][i], _mm_mul_ps(dy,
inv_length));
@@ -166,10 +167,10 @@
for(;i<sourceRays.rayEnd;i++){
Vector dir = shadowRays.getDirection(i);
if(Dot(dir, sourceRays.getFFNormal(i)) > 0) {
-
+
// If so normalize and compute length.
Real length = dir.normalize();
-
+
// Populate the shadow ray.
shadowRays.setRay(i, sourceRays.getHitPosition(i), dir );
shadowRays.resetHit(i, length );
@@ -186,10 +187,10 @@
// Check to see if the light is on the front face.
Vector dir = shadowRays.getDirection(i);
if(Dot(dir, sourceRays.getFFNormal(i)) > 0) {
-
+
// If so normalize and compute length.
Real length = dir.normalize();
-
+
// Populate the shadow ray.
shadowRays.setRay(i, sourceRays.getHitPosition(i), dir );
shadowRays.resetHit(i, length );
Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc (original)
+++ trunk/Model/Groups/DynBVH.cc Tue Apr 10 15:17:38 2007
@@ -3,11 +3,11 @@
#include <stdlib.h>
#include <float.h>
#include <limits>
-
+#include <iostream>
#include <SCIRun/Core/Thread/Time.h>
using namespace Manta;
-
+using std::cerr;
// these constants control the SAH cost model
const float BVH_C_isec = 10.f;
const float BVH_C_trav = 10.f;
Modified: trunk/Model/Materials/Dielectric.cc
==============================================================================
--- trunk/Model/Materials/Dielectric.cc (original)
+++ trunk/Model/Materials/Dielectric.cc Tue Apr 10 15:17:38 2007
@@ -40,11 +40,13 @@
#include <Core/Math/Expon.h>
#include <Core/Color/ColorSpace_fancy.h>
+#include <iostream>
using namespace Manta;
using namespace SCIRun;
+using std::cerr;
Dielectric::Dielectric(const Texture<Real>* n, const Texture<Real>* nt,
- const Texture<Color>* sigma_a,
+ const Texture<Color>* sigma_a,
Real cutoff)
: n(n), nt(nt), sigma_a(sigma_a)
{
@@ -78,7 +80,7 @@
RayPacketData reflected_data;
RayPacketData refracted_data;
- RayPacket reflected_rays(reflected_data, RayPacket::UnknownShape,
+ RayPacket reflected_rays(reflected_data, RayPacket::UnknownShape,
0, 0, rays.getDepth()+1,
RayPacket::NormalizedDirections);
RayPacket refracted_rays(refracted_data, RayPacket::UnknownShape,
0, 0, rays.getDepth()+1,
RayPacket::NormalizedDirections);
@@ -94,7 +96,7 @@
int refl_source[RayPacket::MaxSize];
int num_refl = 0;
- int refr_source[RayPacket::MaxSize];
+ int refr_source[RayPacket::MaxSize];
int num_refr = 0;
Real cutoff = localCutoffScale *
context.scene->getRenderParameters().importanceCutoff;
@@ -137,7 +139,7 @@
Real cosine = Sqrt(cosine_sq);
Real k = 1 - cosine;
k*=(k*k)*(k*k);
-
+
Real r0 = (n_values.data[i] - nt_values.data[i]) / (n_values.data[i] +
nt_values.data[i]);
r0 *= r0;
Real R = r0*(1-k) + k;
Modified: trunk/Model/Materials/Lambertian.cc
==============================================================================
--- trunk/Model/Materials/Lambertian.cc (original)
+++ trunk/Model/Materials/Lambertian.cc Tue Apr 10 15:17:38 2007
@@ -35,8 +35,9 @@
#include <Interface/Context.h>
#include <Interface/ShadowAlgorithm.h>
#include <Model/Textures/Constant.h>
-
+#include <iostream>
using namespace Manta;
+using std::cerr;
Lambertian::Lambertian(const Color& color)
{
@@ -124,7 +125,7 @@
// We are interested in the rays that didn't hit anything
__m128 mask = shadowRays.wereNotHitSSE(i);
-
+
if(_mm_movemask_ps(mask) == 0)
// All hit points are in shadow
continue;
- [MANTA] r1326 - in trunk: Engine/Shadows Model/Groups Model/Materials, boulos, 04/10/2007
Archive powered by MHonArc 2.6.16.