Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] some questions


Chronological Thread 
  • From: James Bigler <bigler@cs.utah.edu>
  • To: MANTA <manta@sci.utah.edu>
  • Subject: Re: [Manta] some questions
  • Date: Thu, 31 Jan 2008 08:24:19 -0700

Yeah, you will want to call shade().

RayPacketData env_data;
RayPacket env_rays(env_data, RayPacket::UnknownShape, rays.begin(), rays.end(), 0, 0);

for(int i = env_rays.begin(); i < env_rays.end(); ++i) {
  // Set direction for each ray
  Vector dir;
  env_rays.setDirection(i, dir);
}

env->shade(context, env_rays);

for(int i = env_rays.begin(); i < env_rays.end(); ++i) {
  // Get out color
  Color c = env_rays.getColor(i);
}

The above should be correct, but I didn't compile or run it. ;)

James

On Jan 31, 2008, at 7:39 AM, Harsha Sri-Narayana wrote:

Sorry, I'm aware how large this mailing list is so I was kind of hoping the answer would drop into my head on its own.

I would like to be able to take a vector in world co-ordinates, say a normal of a particular vertex. And then use that vector to find which texel in the EnvMap it is currently pointing at so that I can get the radiance in that direction. I have the normals of my vertices and I can transform them into world-coords. But I'm not confident on how to map that vector to its corresponding texel value in the environment map.

I think something like envmap->shade() is the method I'm looking for, but I'm not sure.
-Harsha

James Bigler wrote:
I haven't heard back on this, yet.

On Jan 29, 2008, at 10:31 AM, James Bigler wrote:

Q3) Also I've loaded a HDR image into an EnvMapBackground object. Is there a way of looking up a radiance value from a vector? Or do I need to go through Texture<Color>* from within EnvMapBackground?

Could you be more specific about what you are trying to do?

James







Archive powered by MHonArc 2.6.16.

Top of page