Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] Groups, Acceleration Structures and Instances???


Chronological Thread 
  • From: "Christian Odom" <cnsodom@gmail.com>
  • To: manta@sci.utah.edu
  • Subject: Re: [Manta] Groups, Acceleration Structures and Instances???
  • Date: Sun, 21 Oct 2007 21:07:08 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=N9og/pYb4L+1CdPfsAtUSS/mdvoA+Jo7P0w4/DUU0jIR9uT+Vgwa2Y7Gz/q6fmmS6rEDTjgZZ0f2FlKHG+A8XZypi06ZE3rJcAv/yKQRCl5hJ4FbzaT/cDQTWXxlTjqdcfrdCbnnmhYRvXV2o0yWPM7j/EdM3zwRvSCOmN6ibHs=



On 10/21/07, Thiago Ize <thiago@cs.utah.edu> wrote:
An acceleration structure currently takes a Group (or a Mesh which
inherits from Group) and creates it's acceleration structure over the
immediate contents of the Group. In your case, the Group contained a
single item, the Mesh, so the acceleration structure was built over a
single item, a mesh, and not the many triangles in the mesh.
I'm guessing what you should do is feed the mesh to the acceleration
structure and then create instances of this acceleration structure which
you either render directly or place into another acceleration structure.

For example:

Mesh *mesh = functionThatGaveYouTheMesh();
AccelerationStructure *as = new DynBVH;
as->setGroup(mesh);
//as->rebuild(); //(you can probably get away without calling this for
DynBVH).
spinprim = as; //where spinprim is defined and used as in primtest.cc

Group *group = new Group;
for (i=0; i < number of instances; ++i) {
   //do something to create a fancy AffineTransform t.
   group->add(new InstanceRT(spinprim, t);
}
if number of instances is big
AccelerationStructure *as_for_instances = new DynBVH;
as->setGroup(group);

scene->setObject(group);


Let me know if this doesn't work or if you have other questions.
Thiago

Fantastic!  Thanks!

Dirk Reiners wrote:
>
>     Hi All,
>
> I'm trying to do some instancing to duplicate a model that we loaded,
> and I'm getting some weird performance problems.
>
> The basis is the triangle scene viewer. I would like to take the
> loaded object, create a bunch of translated/rotated/scaled instances
> and show all of them together. I looked at the primtest, which does
> something similar, and it seemed pretty straightforward.
>
> To test it I just added a new Group, added the loaded Mesh to that,
> and push_backed this group to the keyframe animation instead of the
> loaded Mesh itself. The result was a performance drop by a factor of 40.
>
> Does anybody have an explanation for that? My impression is that the
> DynBVH is not kicking in, but I couldn't see anything about how to add
> a DynBVH to a group. What is the correct way of doing this? I'm really
> confused about the fact that the AccelerationStructure is part of the
> keyframe animation, and that there doesn't seem to be any other place
> to put one. Can somebody give me a quick intro about how the graph,
> the Keyframe anim and the AS play together?
>
> Thanks
>
>     Dirk
>




--
Christian Odom
Graduate Student
Center for Advanced Computer Studies
http://www.cacs.louisiana.edu
Louisiana Immersive Technologies Enterprise
http://www.lite3d.com


Archive powered by MHonArc 2.6.16.

Top of page