Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] TexCoordTexture


Chronological Thread 
  • From: Li-Ta Lo < >
  • To:
  • Subject: [Manta] TexCoordTexture
  • Date: Wed, 09 Jul 2008 08:44:33 -0600
  • Organization: Los Alamos National Lab

Hi,

This is more a follow up on the question of vertex color v.s. surface
color. If I understand Thiago's reply and the problem correctly, we
should be able to use the vertex's RGB color as its 3D texture 
coordinate. MeshTriangle will take these "t-coords" at vertices and 
interpolate them for interior points. The t-coords of interior points 
can then be treated as their RGB colors. The it will work exactly as 
how traditional smooth shading works. Is there any flaw in my idea?

BTW, why TexCoordTexture only uses 2 components of the texture
coordinates while 3D texture coordinates were computed?

void TexCoordTexture::mapValues(Packet<Color>& results,
                                const RenderContext& context,
                                RayPacket& rays) const
{
 
  // Compute the texture coordinates.
  rays.computeTextureCoordinates3( context );
    
  for( int i = rays.begin(); i < rays.end(); ++i ) {
    Vector texCoords = rays.getTexCoords(i);
    // Convert the coordinates to a color.  
    results.set(i, Color( RGB( (ColorComponent)texCoords[0],
                               (ColorComponent)texCoords[1],
                               (ColorComponent)0 ) ) );
  }
   
} // end mapValues

Ollie





Archive powered by MHonArc 2.6.16.

Top of page