[Soc-2009-dev] Raytrace api
Brecht Van Lommel
brecht at blender.org
Mon May 11 17:47:43 CEST 2009
On Mon, 2009-05-11 at 16:12 +0100, André Pinto wrote:
> Hi all,
> this week I have been coding a more generic raytrace api and I have
> some questions:
> * In the new files (rayobject.h, rayobject*.c), I copied the GPL
> license block from other files and changed copyright to "2009 Blender
> Foundation". I also set the properties svn:keywords and svn:eol-style.
> Is this all that needs to be done for created files?
> And Is there any sample GPL licence block? i noticed those sligtly
> change between files.
I don't think we have a policy on svn properties and the license block
details, just do the same as another file in the directory.
> * The exported functions from render, should all started with RE_ ?
> That means the functions I added should be:
Yes, use the RE_ prefix.
> * Is it safe to assume that all MEM_callocN are aligned to 4bytes?
Yes (though obviously make a comment in the raytracing code that you
rely on this).
> ==API details==
> Details about the ray trace design implementation
> I denoted RayObject as everything where its possible to raycast
> including a single face or a complex data structure.
> Thus allowing to create compound structures (eg.: a bvh of octrees
> (like 1 octree per object)).
> In order to allow an eficient type-detectation mechanism, all
> RayObjects are aligned to 4bytes, leaving 2bits of adress to determine
> the type, so far 2 types exist:
> RayFace - struct with coords, object and face.
> RayObject - struct to an abstract raytrace aceleration, with callbacks
> to generic stuff like: add faces, free struct and raycast
> All callbacks like get coordinates/transform_coords, check_hit, where
> removed for now.. as the functionality of those will be coded as
> needed in a better way.
> For now only API and Isect structure were modified.
> Daniel Salazar(ZanQdo) reported an 9% improve on his quad core2 :)
> At the moment only shadow rays work/were tested.
OK, design sounds good, and 9% is a nice start :).
More information about the Soc-2009-dev