Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1057 - in trunk: Engine/Display Interface Model/Groups Model/Lights Model/Materials Model/Primitives Model/Textures SwigInterface fox/FManta fox/afr_demo/Engine/Control fox/afr_demo/Engine/ImageTraversers fox/disco_demo/Engine/ImageTraversers fox/disco_demo/Engine/Shaders
- Date: Thu, 11 May 2006 10:18:10 -0600 (MDT)
Author: bigler
Date: Thu May 11 10:17:51 2006
New Revision: 1057
Modified:
trunk/Engine/Display/PureOpenGLDisplay.cc
trunk/Interface/Light.h
trunk/Interface/Texture.h
trunk/Model/Groups/KDTree.cc
trunk/Model/Groups/KDTree.h
trunk/Model/Groups/KDTree2.cc
trunk/Model/Groups/KDTree2.h
trunk/Model/Lights/HeadLight.cc
trunk/Model/Lights/HeadLight.h
trunk/Model/Materials/AmbientOcclusion.cc
trunk/Model/Materials/Lambertian.cc
trunk/Model/Materials/Transparent.cc
trunk/Model/Primitives/ParticleBVH.cc
trunk/Model/Primitives/ParticleBVH.h
trunk/Model/Textures/Constant.h
trunk/Model/Textures/ImageTexture.h
trunk/Model/Textures/MarbleTexture.h
trunk/Model/Textures/NormalTexture.cc
trunk/Model/Textures/NormalTexture.h
trunk/Model/Textures/OakTexture.h
trunk/Model/Textures/TexCoordTexture.cc
trunk/Model/Textures/TexCoordTexture.h
trunk/Model/Textures/WoodTexture.h
trunk/SwigInterface/manta.i
trunk/fox/FManta/FMantaImageFrame.cc
trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
trunk/fox/afr_demo/Engine/ImageTraversers/AFImageTraverser.cc
trunk/fox/afr_demo/Engine/ImageTraversers/EGSRImageTraverser.cc
trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserSTPlane.cc
trunk/fox/afr_demo/Engine/ImageTraversers/STAFRImageTraverser.cc
trunk/fox/disco_demo/Engine/ImageTraversers/DiscoImageTraverser.cc
trunk/fox/disco_demo/Engine/Shaders/AOShader.cc
Log:
Mostly fixes for API changes recently made to Fragment, RayPacket,
Texture, and Light.
Engine/Display/PureOpenGLDisplay.cc
Look for GL_ARB_texture_rectangle in addition to
GL_EXT_texture_rectangle.
Interface/Light.h
Interface/Texture.h
Cosmetic changes.
Model/Materials/AmbientOcclusion.cc
Model/Materials/Lambertian.cc
Model/Materials/Transparent.cc
map is no longer used.
SwigInterface/manta.i
Added Packet.
Model/Groups/KDTree.cc
Model/Groups/KDTree.h
Model/Groups/KDTree2.cc
Model/Groups/KDTree2.h
Model/Lights/HeadLight.cc
Model/Lights/HeadLight.h
Model/Primitives/ParticleBVH.cc
Model/Primitives/ParticleBVH.h
Model/Textures/Constant.h
Model/Textures/ImageTexture.h
Model/Textures/MarbleTexture.h
Model/Textures/NormalTexture.cc
Model/Textures/NormalTexture.h
Model/Textures/OakTexture.h
Model/Textures/TexCoordTexture.cc
Model/Textures/TexCoordTexture.h
Model/Textures/WoodTexture.h
fox/FManta/FMantaImageFrame.cc
fox/afr_demo/Engine/Control/AFRPipeline.cc
fox/afr_demo/Engine/ImageTraversers/AFImageTraverser.cc
fox/afr_demo/Engine/ImageTraversers/EGSRImageTraverser.cc
fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserSTPlane.cc
fox/afr_demo/Engine/ImageTraversers/STAFRImageTraverser.cc
fox/disco_demo/Engine/ImageTraversers/DiscoImageTraverser.cc
fox/disco_demo/Engine/Shaders/AOShader.cc
Updates for new interface.
Modified: trunk/Engine/Display/PureOpenGLDisplay.cc
==============================================================================
--- trunk/Engine/Display/PureOpenGLDisplay.cc (original)
+++ trunk/Engine/Display/PureOpenGLDisplay.cc Thu May 11 10:17:51 2006
@@ -75,8 +75,14 @@
// that the code will still compile. It won't get executed due to logic in
// the setup code
#ifndef GL_EXT_texture_rectangle
-# define GL_EXT_texture_rectangle 0
-# define GL_TEXTURE_RECTANGLE_EXT 0
+// Check for ARB version
+# ifdef GL_ARB_texture_rectangle
+# define GL_EXT_texture_rectangle GL_ARB_texture_rectangle
+# define GL_TEXTURE_RECTANGLE_EXT GL_TEXTURE_RECTANGLE_ARB
+# else
+# define GL_EXT_texture_rectangle 0
+# define GL_TEXTURE_RECTANGLE_EXT 0
+# endif
#endif
#ifndef GL_APPLE_client_storage
# define GL_APPLE_client_storage 0
@@ -137,16 +143,22 @@
{
// Check for texturing extensions
have_texturerectangle = false;
- if(GL_EXT_texture_rectangle && have_extension("GL_EXT_texture_rectangle")){
- have_texturerectangle = true;
- }
+ if(GL_EXT_texture_rectangle &&
+ (have_extension("GL_EXT_texture_rectangle") ||
+ have_extension("GL_ARB_texture_rectangle")))
+ {
+ have_texturerectangle = true;
+ cout << "Have GL texture rectangle\n";
+ }
have_clientstorage = false;
if(GL_APPLE_client_storage && have_extension("GL_APPLE_client_storage")){
have_clientstorage = true;
+ cout << "Have GL client storage\n";
}
have_texturerange = false;
if(GL_APPLE_texture_range && have_extension("GL_APPLE_texture_range")){
have_texturerange = true;
+ cout << "Have GL texture range\n";
}
// We don't want depth to be taken into consideration
Modified: trunk/Interface/Light.h
==============================================================================
--- trunk/Interface/Light.h (original)
+++ trunk/Interface/Light.h Thu May 11 10:17:51 2006
@@ -18,10 +18,11 @@
virtual void preprocess(const PreprocessContext& context ) = 0;
- // This method is called on the light by the shadow algorithm. The color
and direction
- // produced by the light may change for each ray in the packet, and may
change based
- // on the render context.
- virtual void computeLight(RayPacket& destRays, const RenderContext
&context,
+ // This method is called on the light by the shadow algorithm. The
+ // color and direction produced by the light may change for each
+ // ray in the packet, and may change based on the render context.
+ virtual void computeLight(RayPacket& destRays,
+ const RenderContext &context,
RayPacket& sourceRays) const = 0;
private:
Modified: trunk/Interface/Texture.h
==============================================================================
--- trunk/Interface/Texture.h (original)
+++ trunk/Interface/Texture.h Thu May 11 10:17:51 2006
@@ -13,7 +13,9 @@
Texture();
virtual ~Texture();
- virtual void mapValues(Packet<ValueType>& results, const RenderContext&
context, RayPacket& rays) const = 0;
+ virtual void mapValues(Packet<ValueType>& results,
+ const RenderContext&,
+ RayPacket& rays) const = 0;
private:
Texture(const Texture&);
Texture& operator=(const Texture&);
Modified: trunk/Model/Groups/KDTree.cc
==============================================================================
--- trunk/Model/Groups/KDTree.cc (original)
+++ trunk/Model/Groups/KDTree.cc Thu May 11 10:17:51 2006
@@ -364,11 +364,12 @@
// KDTree Texture.
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-void KDTreeTexture::mapValues(const RenderContext& /*context*/,
- RayPacket& rays, Color results[]) const {
+void KDTreeTexture::mapValues(Packet<Color>& results,
+ const RenderContext& /*context*/,
+ RayPacket& rays) const {
for (int i=rays.begin();i<rays.end();++i) {
- results[i] = rays.scratchpad<Kdtree::KDTree::ScratchPadInfo>(i).payload;
+ results.set(i,
rays.scratchpad<Kdtree::KDTree::ScratchPadInfo>(i).payload);
}
}
Modified: trunk/Model/Groups/KDTree.h
==============================================================================
--- trunk/Model/Groups/KDTree.h (original)
+++ trunk/Model/Groups/KDTree.h Thu May 11 10:17:51 2006
@@ -402,8 +402,9 @@
///////////////////////////////////////////////////////////////////////////
class KDTreeTexture : public Texture<Color> {
public:
- virtual void mapValues(const RenderContext& context, RayPacket& rays,
- Color results[]) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const;
};
///////////////////////////////////////////////////////////////////////////
Modified: trunk/Model/Groups/KDTree2.cc
==============================================================================
--- trunk/Model/Groups/KDTree2.cc (original)
+++ trunk/Model/Groups/KDTree2.cc Thu May 11 10:17:51 2006
@@ -425,8 +425,10 @@
}
void
-KDTree2Texture::mapValues(const RenderContext& context, RayPacket& rays,
- Color results[]) const {
+KDTree2Texture::mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const
+{
if (kdtree->group_ids && kdtree->group_colors) {
// Have group ids and colors
const unsigned int* group_ids = kdtree->group_ids;
@@ -435,13 +437,13 @@
for ( int ray = rays.begin(); ray < rays.end(); ++ray) {
unsigned int tri_index =
rays.scratchpad<KDTree2::ScratchData>(ray).tri_index;
const int group_id = group_ids[tri_index];
- results[ray] = group_colors[group_id];
+ results.set(ray, group_colors[group_id]);
}
} else {
// No colors, so just assign something
Color default_color(RGBColor(0.7, 0.7, 0.7 ));
for ( int ray = rays.begin(); ray < rays.end(); ++ray) {
- results[ray] = default_color;
+ results.set(ray, default_color);
}
}
Modified: trunk/Model/Groups/KDTree2.h
==============================================================================
--- trunk/Model/Groups/KDTree2.h (original)
+++ trunk/Model/Groups/KDTree2.h Thu May 11 10:17:51 2006
@@ -136,8 +136,9 @@
public:
KDTree2Texture(): kdtree(0) {}
- virtual void mapValues(const RenderContext& context, RayPacket& rays,
- Color results[]) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
KDTree2* kdtree;
};
Modified: trunk/Model/Lights/HeadLight.cc
==============================================================================
--- trunk/Model/Lights/HeadLight.cc (original)
+++ trunk/Model/Lights/HeadLight.cc Thu May 11 10:17:51 2006
@@ -8,10 +8,9 @@
using namespace Manta;
-void HeadLight::computeLight( Color resultColor[RayPacket::MaxSize],
- Vector lightDirection[RayPacket::MaxSize],
- const RenderContext &context,
- RayPacket &rays) const
+void HeadLight::computeLight(RayPacket& destRays,
+ const RenderContext &context,
+ RayPacket& sourceRays) const
{
// Determine the camera position.
Vector camera = context.camera->getPosition();
@@ -20,9 +19,9 @@
// Determine light position.
Vector position = camera + (up * offset);
- rays.computeHitPositions();
- for(int i = rays.begin(); i < rays.end(); i++){
- resultColor[i] = color;
- lightDirection[i] = position - rays.getHitPosition(i);
+ sourceRays.computeHitPositions();
+ for(int i = sourceRays.begin(); i < sourceRays.end(); i++){
+ destRays.setColor(i, color);
+ destRays.setDirection(i, position - sourceRays.getHitPosition(i));
}
}
Modified: trunk/Model/Lights/HeadLight.h
==============================================================================
--- trunk/Model/Lights/HeadLight.h (original)
+++ trunk/Model/Lights/HeadLight.h Thu May 11 10:17:51 2006
@@ -12,10 +12,9 @@
HeadLight(const Real offset_, const Color &color_) : offset( offset_ ),
color( color_ ) { };
virtual void preprocess(const PreprocessContext&) { /* Does Nothing. */
};
- virtual void computeLight( Color resultColor[RayPacket::MaxSize],
- Vector lightDirection[RayPacket::MaxSize],
- const RenderContext &context,
- RayPacket &rays) const;
+ virtual void computeLight(RayPacket& destRays,
+ const RenderContext &context,
+ RayPacket& sourceRays) const;
void setOffset( Real offset_ ) { offset = offset_; };
Real getOffset() { return offset; };
Modified: trunk/Model/Materials/AmbientOcclusion.cc
==============================================================================
--- trunk/Model/Materials/AmbientOcclusion.cc (original)
+++ trunk/Model/Materials/AmbientOcclusion.cc Thu May 11 10:17:51 2006
@@ -121,7 +121,6 @@
bool firstTime = true;
bool done;
do {
- int map[RayPacket::MaxSize];
RayPacket shadowRays(data, RayPacket::UnknownShape, 0, 0,
rays.getDepth(), 0);
done = context.shadowAlgorithm->computeShadows(context, activeLights,
rays, shadowRays,
Modified: trunk/Model/Materials/Lambertian.cc
==============================================================================
--- trunk/Model/Materials/Lambertian.cc (original)
+++ trunk/Model/Materials/Lambertian.cc Thu May 11 10:17:51 2006
@@ -49,7 +49,6 @@
bool done;
int count = 0;
do {
- int map[RayPacket::MaxSize];
RayPacketData shadowData;
RayPacket shadowRays(shadowData, RayPacket::UnknownShape, 0, 0,
rays.getDepth(), 0);
@@ -68,13 +67,12 @@
for(int j=shadowRays.begin(); j < shadowRays.end(); j++){
if(!shadowRays.wasHit(j)){
// Not in shadow, so compute the direct and specular contributions.
- int to = map[j];
- Vector normal = rays.getNormal(to);
+ Vector normal = rays.getNormal(j);
Vector shadowdir = shadowRays.getDirection(j);
ColorComponent cos_theta = Dot(shadowdir, normal);
Color light = shadowRays.getColor(j);
for(int k = 0; k < Color::NumComponents;k++)
- totalLight[k][to] += light[k]*cos_theta;
+ totalLight[k][j] += light[k]*cos_theta;
}
}
firstTime = false;
Modified: trunk/Model/Materials/Transparent.cc
==============================================================================
--- trunk/Model/Materials/Transparent.cc (original)
+++ trunk/Model/Materials/Transparent.cc Thu May 11 10:17:51 2006
@@ -80,7 +80,6 @@
bool done;
int count = 0;
do {
- int map[RayPacket::MaxSize];
RayPacketData shadowData;
RayPacket shadowRays(shadowData, RayPacket::UnknownShape, 0, 0,
rays.getDepth(), 0);
Modified: trunk/Model/Primitives/ParticleBVH.cc
==============================================================================
--- trunk/Model/Primitives/ParticleBVH.cc (original)
+++ trunk/Model/Primitives/ParticleBVH.cc Thu May 11 10:17:51 2006
@@ -229,10 +229,10 @@
}
void ParticleBVH::ParticleTexture::mapValues(
+ Packet<Color>& results,
RenderContext const &context,
- RayPacket &rays,
- Color results[] ) const
+ RayPacket &rays) const
{
for ( int ray = rays.begin(); ray < rays.end(); ray++ )
- results[ ray ] = particlebvh->particles[ rays.scratchpad< int >(ray)
].color;
+ results.set(ray, particlebvh->particles[ rays.scratchpad< int >(ray)
].color);
}
Modified: trunk/Model/Primitives/ParticleBVH.h
==============================================================================
--- trunk/Model/Primitives/ParticleBVH.h (original)
+++ trunk/Model/Primitives/ParticleBVH.h Thu May 11 10:17:51 2006
@@ -51,7 +51,7 @@
public:
virtual ~ParticleTexture();
virtual void setParticleBVH( ParticleBVH const *particlebvh );
- virtual void mapValues( RenderContext const &context, RayPacket
&rays, Color results[] ) const;
+ virtual void mapValues(Packet<Color>& results, RenderContext const
&context, RayPacket &rays) const;
};
};
}
Modified: trunk/Model/Textures/Constant.h
==============================================================================
--- trunk/Model/Textures/Constant.h (original)
+++ trunk/Model/Textures/Constant.h Thu May 11 10:17:51 2006
@@ -15,8 +15,9 @@
Constant(const ValueType& value);
virtual ~Constant();
- virtual void mapValues(Packet<ValueType>& results, const RenderContext&
context, RayPacket& rays) const;
-
+ virtual void mapValues(Packet<ValueType>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
ValueType getValue() const { return value; }
void setValue( const ValueType value_ ) { value = value_; }
@@ -39,7 +40,8 @@
}
template<class ValueType>
- void Constant<ValueType>::mapValues(Packet<ValueType>& results, const
RenderContext&,
+ void Constant<ValueType>::mapValues(Packet<ValueType>& results,
+ const RenderContext&,
RayPacket& rays) const
{
for(int i=rays.begin();i<rays.end();i++)
Modified: trunk/Model/Textures/ImageTexture.h
==============================================================================
--- trunk/Model/Textures/ImageTexture.h (original)
+++ trunk/Model/Textures/ImageTexture.h Thu May 11 10:17:51 2006
@@ -80,9 +80,9 @@
ImageTexture(const Image* image);
virtual ~ImageTexture() {}
- virtual void mapValues(RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
template<class TU, class TV>
void setScale(const TU& u_scale, const TV& v_scale) {
@@ -225,9 +225,9 @@
}
template< class ValueType >
- void ImageTexture< ValueType >::mapValues(RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const
+ void ImageTexture< ValueType >::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
{
rays.computeTextureCoordinates2( context );
VectorT<ScalarType, 2> tex_coords[RayPacket::MaxSize];
@@ -260,7 +260,7 @@
texture(x_high, y_low )* x_weight_high);
b = ( texture(x_low, y_high)*(1-x_weight_high) +
texture(x_high, y_high)* x_weight_high);
- results[i] = a*(1-y_weight_high) + b*y_weight_high;
+ results.set(i, a*(1-y_weight_high) + b*y_weight_high);
}
}
break;
@@ -271,7 +271,7 @@
u_edge, texture.dim1());
int ty = NN_edge_behavior(static_cast<int>(tex_coords[i].y()*yres),
v_edge, texture.dim2());
- results[i] = texture(tx, ty);
+ results.set(i, texture(tx, ty));
}
}
break;
Modified: trunk/Model/Textures/MarbleTexture.h
==============================================================================
--- trunk/Model/Textures/MarbleTexture.h (original)
+++ trunk/Model/Textures/MarbleTexture.h Thu May 11 10:17:51 2006
@@ -26,10 +26,9 @@
Real const lacunarity,
Real const gain );
virtual ~MarbleTexture();
- virtual void mapValues(
- RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
private:
MarbleTexture(
MarbleTexture const & );
@@ -73,10 +72,9 @@
}
template< class ValueType >
- void MarbleTexture< ValueType >::mapValues(
- RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const
+ void MarbleTexture< ValueType >::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
{
rays.computeTextureCoordinates3( context );
for( int i = rays.begin(); i < rays.end(); i++ ) {
@@ -84,7 +82,7 @@
ColorComponent value = (Real)0.25 *
Cos( rays.getTexCoords(i).x() * scale + tscale *
(Real)Turbulence( T, octaves, lacunarity, gain ) );
- results[ i ] = SCIRun::Interpolate( value1, value2, value );
+ results.set(i, SCIRun::Interpolate( value1, value2, value ));
}
}
}
Modified: trunk/Model/Textures/NormalTexture.cc
==============================================================================
--- trunk/Model/Textures/NormalTexture.cc (original)
+++ trunk/Model/Textures/NormalTexture.cc Thu May 11 10:17:51 2006
@@ -45,7 +45,10 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-void NormalTexture::mapValues(const RenderContext&context, RayPacket& rays,
Color results[]) const {
+void NormalTexture::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
+{
// Compute the normal for each ray.
rays.computeNormals( context );
@@ -58,9 +61,9 @@
normal = (normal *(Real)0.5) + Vector( 0.5, 0.5, 0.5 );
- results[i] = Color( RGB( (ColorComponent)normal[0],
- (ColorComponent)normal[1],
- (ColorComponent)normal[2] ));
+ results.set(i, Color( RGB( (ColorComponent)normal[0],
+ (ColorComponent)normal[1],
+ (ColorComponent)normal[2] )));
}
}
@@ -70,7 +73,10 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-void RaySignTexture::mapValues(const RenderContext&, RayPacket& rays, Color
results[]) const {
+void RaySignTexture::mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const
+{
// Compute the directions for each ray.
rays.computeInverseDirections();
@@ -87,9 +93,9 @@
scale = 1.0;
}
- results[i] = Color( RGB( (scale*sign[0])*0.5+0.5,
- (scale*sign[1])*0.5+0.5,
- (scale*sign[2])*0.5+0.5 ));
+ results.set(i, Color( RGB( (scale*sign[0])*0.5+0.5,
+ (scale*sign[1])*0.5+0.5,
+ (scale*sign[2])*0.5+0.5 )));
}
@@ -147,7 +153,11 @@
}
template<class ScratchPadInfo, class ValueType>
-void
WireframeTexture<ScratchPadInfo,ValueType>::mapValues(Packet<ValueType>&
results, const RenderContext &context, RayPacket& rays) const {
+void WireframeTexture<ScratchPadInfo,ValueType>::
+mapValues(Packet<ValueType>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
+{
// Compute the normal for each ray.
rays.computeNormals( context );
Modified: trunk/Model/Textures/NormalTexture.h
==============================================================================
--- trunk/Model/Textures/NormalTexture.h (original)
+++ trunk/Model/Textures/NormalTexture.h Thu May 11 10:17:51 2006
@@ -45,7 +45,9 @@
NormalTexture() { }
virtual ~NormalTexture() { }
- virtual void mapValues(const RenderContext&, RayPacket& rays, Color
results[]) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
};
class RaySignTexture : public Texture<Color> {
@@ -53,7 +55,9 @@
RaySignTexture() { }
virtual ~RaySignTexture() { }
- virtual void mapValues(const RenderContext&, RayPacket& rays, Color
results[]) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
};
template<class ScratchPadInfo, class ValueType = Color >
@@ -64,7 +68,9 @@
WireframeTexture( const ValueType &color_, const ValueType &wire_value_
);
virtual ~WireframeTexture() { }
- virtual void mapValues(Packet<ValueType>& results, const RenderContext&,
RayPacket& rays) const;
+ virtual void mapValues(Packet<ValueType>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
private:
///////////////////////////////////////////////////////////////////////////
Modified: trunk/Model/Textures/OakTexture.h
==============================================================================
--- trunk/Model/Textures/OakTexture.h (original)
+++ trunk/Model/Textures/OakTexture.h Thu May 11 10:17:51 2006
@@ -28,10 +28,9 @@
Real const ringy,
Real const grainy );
virtual ~OakTexture();
- virtual void mapValues(
- RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
private:
OakTexture(
OakTexture const & );
@@ -90,10 +89,9 @@
}
template< class ValueType >
- void OakTexture< ValueType >::mapValues(
- RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const
+ void OakTexture< ValueType >::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
{
using SCIRun::SmoothStep;
rays.computeTextureCoordinates3( context );
@@ -131,7 +129,7 @@
amp *= (Real)0.5;
}
Real value = SCIRun::Interpolate( (Real)1, grain, inring * ringy );
- results[ i ] = SCIRun::Interpolate( value2, value1, value );
+ results.set(i, SCIRun::Interpolate( value2, value1, value ) );
}
}
}
Modified: trunk/Model/Textures/TexCoordTexture.cc
==============================================================================
--- trunk/Model/Textures/TexCoordTexture.cc (original)
+++ trunk/Model/Textures/TexCoordTexture.cc Thu May 11 10:17:51 2006
@@ -38,9 +38,9 @@
using namespace Manta;
-void TexCoordTexture::mapValues(RenderContext const &context,
- RayPacket &rays,
- Color results[] ) const
+void TexCoordTexture::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
{
// Compute the texture coordinates.
@@ -49,9 +49,9 @@
for( int i = rays.begin(); i < rays.end(); ++i ) {
Vector texCoords = rays.getTexCoords(i);
// Convert the coordinates to a color.
- results[i] = Color( RGB( (ColorComponent)texCoords[0],
- (ColorComponent)texCoords[1],
- (ColorComponent)0 ) );
+ results.set(i, Color( RGB( (ColorComponent)texCoords[0],
+ (ColorComponent)texCoords[1],
+ (ColorComponent)0 ) ) );
}
} // end mapValues
Modified: trunk/Model/Textures/TexCoordTexture.h
==============================================================================
--- trunk/Model/Textures/TexCoordTexture.h (original)
+++ trunk/Model/Textures/TexCoordTexture.h Thu May 11 10:17:51 2006
@@ -53,9 +53,9 @@
TexCoordTexture() { }
virtual ~TexCoordTexture() {}
- virtual void mapValues( RenderContext const &context,
- RayPacket &rays,
- Color results[] ) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const;
};
}
Modified: trunk/Model/Textures/WoodTexture.h
==============================================================================
--- trunk/Model/Textures/WoodTexture.h (original)
+++ trunk/Model/Textures/WoodTexture.h Thu May 11 10:17:51 2006
@@ -26,9 +26,9 @@
Real const lacunarity,
Real const gain );
virtual ~WoodTexture();
- virtual void mapValues(RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const;
+ virtual void mapValues(Packet<Color>& results,
+ const RenderContext&,
+ RayPacket& rays) const;
private:
WoodTexture( WoodTexture const & );
WoodTexture& operator=( WoodTexture const & );
@@ -72,10 +72,9 @@
}
template< class ValueType >
- void WoodTexture< ValueType >::mapValues(
- RenderContext const &context,
- RayPacket &rays,
- ValueType results[] ) const
+ void WoodTexture< ValueType >::mapValues(Packet<Color>& results,
+ const RenderContext& context,
+ RayPacket& rays) const
{
rays.computeTextureCoordinates3( context );
for( int i = rays.begin(); i < rays.end(); i++ ) {
@@ -83,8 +82,8 @@
Real distance = SCIRun::Sqrt( T.x() * T.x() + T.y() * T.y() ) * rscale;
Real fbm = tscale * ScalarFBM( T, octaves, lacunarity, gain );
Real value = (Real)0.5 * Cos( distance + fbm ) + (Real)0.5;
- results[ i ] = SCIRun::Interpolate( value2, value1,
- SCIRun::Pow( value, sharpness ) );
+ results.set(i, SCIRun::Interpolate( value2, value1,
+ SCIRun::Pow( value, sharpness ) ));
}
}
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Thu May 11 10:17:51 2006
@@ -333,12 +333,14 @@
// Textures
%{
#include <Interface/Texture.h>
+#include <Interface/Packet.h>
#include <Model/Textures/Constant.h>
#include <Model/Textures/CheckerTexture.h>
#include <Model/Textures/ImageTexture.h>
%}
%include <Interface/Texture.h>
+%include <Interface/Packet.h>
%include <Model/Textures/Constant.h>
%include <Model/Textures/CheckerTexture.h>
%include <Model/Textures/ImageTexture.h>
Modified: trunk/fox/FManta/FMantaImageFrame.cc
==============================================================================
--- trunk/fox/FManta/FMantaImageFrame.cc (original)
+++ trunk/fox/FManta/FMantaImageFrame.cc Thu May 11 10:17:51 2006
@@ -157,7 +157,7 @@
// Create a ray packet.
RayPacketData data;
- RayPacket rays( data, 0, 1, 0, 0 );
+ RayPacket rays( data, RayPacket::UnknownShape, 0, 1, 0, 0 );
// Set the debug packet flag if necessary.
if (debug_packet) {
Modified: trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc (original)
+++ trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc Thu May 11 10:17:51
2006
@@ -33,7 +33,7 @@
#include <Engine/Control/AFRPipeline.h>
#include <Core/Util/Args.h>
-#include <Engine/Control/RTRT_register.h>
+#include <Engine/Factory/RegisterKnownComponents.h>
#include <Interface/AmbientLight.h>
#include <Interface/Background.h>
#include <Interface/Callback.h>
@@ -718,7 +718,11 @@
currentImageTraverser->masterTask( myContext, afr_context, image,
getCurrentTime() );
if(proc == 0)
{
- DisplayContext myDisplayContext(proc, workersAnimAndImage);
+ long displayFrame =
(renderFrameState.frameNumber-1)%channel->pipelineDepth;
+ DisplayContext myDisplayContext(proc,
+ workersAnimAndImage,
+ displayFrame,
+ channel->pipelineDepth);
channel->display->displayImage(myDisplayContext, image);
}
}
Modified: trunk/fox/afr_demo/Engine/ImageTraversers/AFImageTraverser.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/AFImageTraverser.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/AFImageTraverser.cc Thu
May 11 10:17:51 2006
@@ -307,8 +307,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth, flags);
int i, j;
int start = xhairBlockStart[myID]+1;
const static double offset[5][2] = {
@@ -425,8 +425,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth,
flags);
int cx, cy, ox, oy;
int tindex = kdtree[myID].getRandomTile(myRandomNumber[myID]);
Modified: trunk/fox/afr_demo/Engine/ImageTraversers/EGSRImageTraverser.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/EGSRImageTraverser.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/EGSRImageTraverser.cc Thu
May 11 10:17:51 2006
@@ -329,8 +329,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth, flags);
int i, j;
int start = xhairBlockStart[myID]+1;
const static double offset[5][2] = {
@@ -488,8 +488,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth, flags);
for(i=0; i<size; i++)
{
int fi = f+i;
Modified: trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc Thu
May 11 10:17:51 2006
@@ -381,8 +381,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment f;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment f(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth, flags);
int i, j;
int start = lastxhairindex[myID]+1 ;
const static double offset[5][2] = {
@@ -502,8 +502,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, size, depth,
flags);
int cx, cy, ox, oy;
int tindex = kdtree[myMasterID].getRandomTile(myRandomNumber[myID]);
Modified: trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
Thu May 11 10:17:51 2006
@@ -380,8 +380,9 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, (sscount-start+1), depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape,
+ 0, (sscount-start+1), depth, flags);
int i, j;
j = 0;
//cout << "size = " << (sscount-start+1) << endl;
@@ -493,8 +494,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, numXhairPerRayPack*numFrontXhairSamples,
depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0,
numXhairPerRayPack*numFrontXhairSamples, depth, flags);
int cx, cy, ox, oy;
int tindex = kdtree[myMasterID].getRandomTile(myRandomNumber[myID]);
//int tindex = kdtree[myID].getPseudoRandomTile();
@@ -742,8 +743,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, numXhairPerRayPack*numFrontXhairSamples,
depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0,
numXhairPerRayPack*numFrontXhairSamples, depth, flags);
int cx, cy, ox, oy;
int tindex = kdtree[myMasterID].getRandomTile(myRandomNumber[myID]);
//int tindex = kdtree[myID].getPseudoRandomTile();
Modified:
trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserSTPlane.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserSTPlane.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserSTPlane.cc
Thu May 11 10:17:51 2006
@@ -379,8 +379,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, (sscount-start+1), depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, (sscount-start+1),
depth, flags);
int i, j;
j = 0;
//cout << "size = " << (sscount-start+1) << endl;
@@ -482,8 +482,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, size*numFrontXhairSamples, depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0,
size*numFrontXhairSamples, depth, flags);
bool validinfo[RayPacket::MaxSize];
//printf("edgecode = %d, size = %d\n", edgecode, size);
for(i=0; i<size; i++)
@@ -642,8 +642,8 @@
// Create a ray packet for set of crosshairs
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, numXhairPerRayPack*numFrontXhairSamples,
depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0,
numXhairPerRayPack*numFrontXhairSamples, depth, flags);
int cx, cy, ox, oy;
int tindex = kdtree[myMasterID].getRandomTile(myRandomNumber[myID]);
kdtree[myMasterID].getRandomSamplefromTile(tindex, cx, cy,
myRandomNumber[myID]);
Modified: trunk/fox/afr_demo/Engine/ImageTraversers/STAFRImageTraverser.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/STAFRImageTraverser.cc
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/STAFRImageTraverser.cc Thu
May 11 10:17:51 2006
@@ -365,8 +365,8 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, (sscount-start+1), depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0, (sscount-start+1),
depth, flags);
int i, j;
j = 0;
//cout << "size = " << (sscount-start+1) << endl;
@@ -474,8 +474,8 @@
// Create a ray packet
int depth = 0;
RayPacketData raydata;
- Fragment frag;
- RayPacket rays(raydata, 0, numXhairPerRayPack*numFrontXhairSamples,
depth, flags);
+ Fragment frag(Fragment::UnknownShape);
+ RayPacket rays(raydata, RayPacket::UnknownShape, 0,
numXhairPerRayPack*numFrontXhairSamples, depth, flags);
int cx, cy, ox, oy;
int tindex = kdtree[myMasterID].getRandomTile(myRandomNumber[myID]);
//int tindex = kdtree[myID].getPseudoRandomTile();
Modified: trunk/fox/disco_demo/Engine/ImageTraversers/DiscoImageTraverser.cc
==============================================================================
--- trunk/fox/disco_demo/Engine/ImageTraversers/DiscoImageTraverser.cc
(original)
+++ trunk/fox/disco_demo/Engine/ImageTraversers/DiscoImageTraverser.cc Thu
May 11 10:17:51 2006
@@ -169,7 +169,12 @@
int flags = RayPacket::HaveImageCoordinates | RayPacket::ConstantEye;
RayPacketData ray_data;
- RayPacket ray_packet( ray_data, 0, 0, 0, flags );
+ // Set the shape to be RayPacket::UnknownShape. Even though we
+ // are trying to fill a tile we fill the ray packet to compacity
+ // causing uneven shapes of packets when the number of rays is
+ // not the number in the tile.
+ RayPacket ray_packet( ray_data, RayPacket::UnknownShape,
+ 0, 0, 0, flags );
// Total number of rays in packet.
int packet_size = 0;
@@ -234,7 +239,7 @@
/////////////////////////////////////////////////////////////////////////
// Call the neighborhood shader and write image results.
- Fragment fragment;
+ Fragment fragment(Fragment::UnknownShape);
for (int i=0;i<packet_sent; ++i) {
// Since we don't where the overlap is in the packets, the shader is
Modified: trunk/fox/disco_demo/Engine/Shaders/AOShader.cc
==============================================================================
--- trunk/fox/disco_demo/Engine/Shaders/AOShader.cc (original)
+++ trunk/fox/disco_demo/Engine/Shaders/AOShader.cc Thu May 11 10:17:51
2006
@@ -101,7 +101,8 @@
// Create a ray packet for shooting secondary rays.
RayPacketData secondary_data;
- RayPacket secondary_packet( secondary_data, 0, 0, 1, 0 );
+ RayPacket secondary_packet( secondary_data, RayPacket::UnknownShape,
+ 0, 0, 1, 0 );
// Keep track of which primary rays each secondary ray maps to.
int secondary_map[RayPacket::MaxSize];
- [MANTA] r1057 - in trunk: Engine/Display Interface Model/Groups Model/Lights Model/Materials Model/Primitives Model/Textures SwigInterface fox/FManta fox/afr_demo/Engine/Control fox/afr_demo/Engine/ImageTraversers fox/disco_demo/Engine/ImageTraversers fox/disco_demo/Engine/Shaders, bigler, 05/11/2006
Archive powered by MHonArc 2.6.16.