Text archives Help
- From: arobison@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1945 - trunk/scenes
- Date: Tue, 25 Dec 2007 19:29:48 -0700 (MST)
Author: arobison
Date: Tue Dec 25 19:29:46 2007
New Revision: 1945
Modified:
trunk/scenes/hdritest.cc
Log:
Adding an option for bilinear filtering of env. maps and tweaking a few
things.
Modified: trunk/scenes/hdritest.cc
==============================================================================
--- trunk/scenes/hdritest.cc (original)
+++ trunk/scenes/hdritest.cc Tue Dec 25 19:29:46 2007
@@ -65,10 +65,10 @@
void addFloor(Group* group)
{
- Texture<Color>* tile_tex = new CheckerTexture<Color>(Color::white(),
Color::black(),
+ Texture<Color>* tile_tex = new CheckerTexture<Color>(Color::white()*.8,
Color::black(),
Vector(4,0,0),
Vector(0,4,0));
- Material* tile = new Phong( tile_tex, new
Constant<Color>(Color::white()*.8), 20, new Constant<ColorComponent>(.2) );
+ Material* tile = new Phong( tile_tex, new
Constant<Color>(Color::white()*.8), 32, new Constant<ColorComponent>(.2) );
Primitive* floor = new Parallelogram(tile, Vector(-2.5, -1.05, -2.5),
Vector(5, 0, 0), Vector(0, 0, 5));
@@ -79,7 +79,7 @@
void addLights( LightSet* lights)
{
- lights->add( new PointLight( Vector(0, 0, 30) , Color( RGB(0.8,0.8,0.8) )
) );
+ lights->add( new PointLight( Vector(0, 30, 0) , Color( RGB(0.8,0.8,0.8) )
) );
}
@@ -91,6 +91,7 @@
EnvMapBackground::MappingType mapping_type =
EnvMapBackground::CylindricalEqualArea;
bool create_floor = false;
bool create_glass = false;
+ bool filter = false;
for(size_t i = 0; i < args.size(); ++i) {
std::string arg = args[i];
@@ -109,6 +110,8 @@
create_floor = true;
} else if (arg == "-glass_sphere") {
create_glass = true;
+ } else if (arg == "-filter") {
+ filter = true;
} else {
std::cerr << "Unknown option: " << arg << "\n";
}
@@ -124,6 +127,8 @@
if ( !env_filename.empty() ) {
ImageTexture<Color>* t = LoadColorImageTexture( env_filename, &std::cerr
);
+ if(filter)
+ t->setInterpolationMethod(ImageTexture<Color>::Bilinear);
scene->setBackground( new EnvMapBackground( t,
mapping_type, right, up ) );
@@ -143,7 +148,7 @@
scene->setObject(all);
LightSet* lights = new LightSet();
- //addLights( lights );
+ addLights( lights );
lights->setAmbientLight(new ConstantAmbient( Color( RGB(0.2, 0.2, 0.2) ) )
);
- [Manta] r1945 - trunk/scenes, arobison, 12/25/2007
Archive powered by MHonArc 2.6.16.