[Soc-2009-dev] Weekly Report

Jingyuan Huang jingyuan.huang at gmail.com
Fri Jul 24 20:18:38 CEST 2009


== What I did ==

Overall this week I haven't spent as much time on Blender as I would
like to. My research isn't in a good state. Anyway...shit happens. :P

1. Shadow coefficients / Octree integration
I spent a long time on this but I'm not getting the correct results.
What I'm trying to do is for each vertex on the mesh I create a number
of random sample rays (I tried a small number 100 rays and a larger
one 1000 rays) from that vertex. Then I do a ray intersection test to
see if it hits any other faces in the scene. If so, then it's in the
shadow area. The coefficients are summed up and averaged in the end.
The steps are:
a. create a ray tree and add faces
I created a struct ShFace to keep track of which face in which derived
mesh, with two functions to compute coords and transforms. I also
assign each vertex a face. (Each vertex can belong to multiple faces,
but I only assign one face to it.)
b.create Isect.
  isec.mode= RE_RAY_SHADOW;
  isec.lay= -1;
  isec.face_last= NULL;
  isec.faceorig = ri->faces_map[i][j]; // find the face based on vertex index
  isec.oborig = offset + RE_RAY_TRANSFORM_OFFS; // find the object in the scene

  VECCOPY(isec.start, verts[j].co); // ray starts from the vertex
  VECCOPY(isec.vec, samples[k]); // sample as its direction
  VECADD(isec.end, isec.start, samples[k]); // end point
c.visibility test
  visible = !RE_ray_tree_intersect(ri->tree, &isec);

The logic is straightforward to me, but the results are quite
wrong...I'd like to know if the workflow I list here is correct. If so
I may have made some mistakes in the bookkeeping part.
I'm currently not working on it since I've been staring at it for too
long. Shadow coeffs computation is still disabled. I will get back to
it and see if I can find my mistake.

2. Using the mixed lightenvs for rendering.
I didn't start this first because I was hoping to see how environment
map would be coded in 2.5.
I'm working on a quick and (probably dirty) solution for this. I added
an output lightenv node. So basically after mixing several lightenvs,
the output should go to an output lightenv node instead of a regular
output node. Then the user can choose to use the output lightenv in
lightenv panel for rendering.
I admit that this is a less than desirable solution. I thought about
it for a while and decided to go this way because it introduces a
small amount of changes and it can still demonstrate the idea of using
light node. After environment map comes back then I can code up a
better solution (possibly with different types of maps, etc.).
This part is not completed yet, but will be checked in before Sunday meeting.

3. I spent a small amount of time early this week to try windows
compilation, but I failed. There was a linking error and I mentioned
it to Nathan. However I haven't been able to go back and make it work.

So...it's pretty depressing week...


== What I will do ==
1. Hopefully I will make shadow coeffs work.
2. Add manual for lightenv node.
3. I noticed that one bug was not fully fixed yet, and I added a new
bug (http://wiki.blender.org/index.php/User:Yukishiro/Bug_List). I
will fix those next week.
4. Compile and link on different platforms. (need to make sure windows
version compiles and add libs for 64-bit machines. I also need to
change lapack to static link on linux.)

== Schedule ==
I'm heading to New Orleans early next week since I need to do some
pre-conference shifts in order to attend my poster sessions. I will
bring my work laptop with me so that I can still work during the week.
1. I probably won't be able to attend the Sunday meeting on Aug. 2nd.
2. I will work on docs, build fixing, and code clean-ups during SIGGRAPH week.




Best Wishes
Jingyuan Huang
------------------------------------
Computer Graphics Lab
University of Waterloo


More information about the Soc-2009-dev mailing list