[Soc-2009-dev] Several things to get started

Jingyuan Huang jingyuan.huang at gmail.com
Tue Apr 21 09:12:12 CEST 2009

Hey Martin,
Thank you for setting up things for me. :-)
I have a couple of things on my mind that I'd like to get some
comments on before I start making code changes.

1. File save & load
I'd like to add a new property to Mesh called mcoeffs to store
harmonic spherical (SH) coefficients. Essentially it's an array of
float numbers whose size is determined by the degree of the function
(if the degree is L, then the array size is (L+1) * (L+1)). However,
I'm not sure if we should pick a constant degree number (personally I
think L = 3 isn't a bad choice, which would make the array size 16),
or if we should leave the choice to the user. The pros and cons of
using a constant are:
a. I'm not 100% sure if makesdna would keep track of dynamically
allocated memory. My understanding is that it forms a tree of the
types and allocate space based on the declarations. I don't think that
if we allocate coeffs on the fly they would be properly stored, but I
can be wrong (and I didn't test that). Using a constant size of 16
avoids this problem.
b. Generating SH coefficients can be time consuming. Each time the
user changes degree value (L), the coefficents need to be regenerated.
Keeping it constant can reduce re-generation time.
c. We lose flexibility. L=3 may be satisfactory to approximate many
light probe images, but not all. The user cannot pick a different
degree if the results are not good.

There is also another parameter, number of random sample rays for the
unit sphere, that requires similar concerns. They are also a concern
for light node since light nodes has such coefficients as well, but I
haven't gotten that far. :P

2. Button space, layout
There has been quite some changes recently in 2.5 in UI. :-)
So far I figured out that we are rendering buttons using python and
rna. The actual layout can be changed by modifying the python files
under .blender/ui. The idea is really neat, but ... how can I add a
new context? Now we have buttons in object and render context, but
nothing else. If I want to start something experimental in editing
context, where should I start?

3. Render
I also have some concerns about drawing light paint mode. First of
all, rendering here requires more than what we have now for
vertex/texture paint. I would like to get rid of the grid and use the
light probe image as background.
view3d_main_area_draw is quite big already, so I'm not sure I should
spread code within it. I'm wondering if we can have a separate
subroutine for light paint mode (e.g. if v3d is in light paint mode,
the subroutine would handle all the drawing by itself and skip the
rest). Secondly, different shader (assuming that we are going to use
glsl) shall be used for rendering since the logic is not quite the

I hope I can get comments from everyone on this mailing list. However
if it's more appropriate to email offline, please let me know so that
I can send questions to your yahoo account directly.

Best Wishes
Jingyuan Huang
Computer Graphics Lab
University of Waterloo

More information about the Soc-2009-dev mailing list