I'd like to learn how the rendercode works in blender. The problem is that I don't have a clue how a scanline renderer works. So would it be possible to give a short description how it works. What happens step by step when you press the F12 button?
Ok, that question is maybe a little big. I will ask specific questions as I go through the source.
First question. What exactly is jittering? What is the purpose of the functions Re_jitterate1
? I don't fully understand this.
I cannot give you a detailed explanation of the functions in particular, but offer a brief answer about jitter in general::..
The term jitter
translates to 'irregular random movement' - the use of it in this case is to facilitate some sort of averaging when taking multiple samples of something. For instance, while rendering with motionblur activated, you get a composite image consisting of several snapshots of your scene with a small timeoffset between each shapshot. However, it is not only the IPO-controlled differences you see, but there is also a very small, subpixel sized offset of the camera POV - a.k.a jitter. This is the reason why motionblur actually improves the antialiasing as well as performing the blur induced by the timeoffset between subframe samples, because you get more samples "inbetween pixels" thanks to the jittering.
_________________eXo.Entity - the movie-in-progress-project
Thanks. That explanation is very clear. Makes me understand the code a lot better too.
In the function prepareScene ()
, another function Re_local_get_renderdata ()
is called. That function is located in callbacks.c
. But what does this function actually do. It calls an other function, but then it seems to me like this is a dead end, nothing happens after that. Is there something I don't understand?
It seems that I don't get to much response here. Maybe this isn't the right place to ask specific code things? Does anyone know a place where I can ask such things?
Don't expect immediate replies about code stuff. The few people who can answer this kind of thing without a few hours of reading code are busy with lots of other stuff.
Having said that, I am willing to look into this for you, but nothing beats doing it yourself
As for where to post... I haven't found a specific forum devoted to figuring out the code
. I don't think that there are enough people who are consistenly curious about this to support one. Oh well.
Hopefully, I'll be able to post an (incomplete, most likely) answer to your question today, but don't give up if I don't
Okay, here you go:
The RE_callbacks.c basically defines a group of functions which call other functions. The process goes like this:
Step 1: Define a function which will get render data. Call it anything you want, like my_get_renderdata(). It should have the same number of parameters and should return the same type of data as is defined in on line 87 of RE_callbacks.c (in this case, none and none).
Step 2: Set your function to be the "get render data" function that blender calls by:
I think that that is the syntax... I didn't look for where the blender code actually uses this set function.
Step 3: Now blender can call:
and it will run the code in my_get_renderdata(). It's just like magic!
So, somewhere before blender calls the prepareScene() functions, it sets the renderdata function.
This is my interpretation, and I don't know if it is 100% correct. Anyone who knows better, please correct me if I'm wrong
|Having said that, I am willing to look into this for you, but nothing beats doing it yourself . |
I'm busy with that. Till now I've read and understood most of the code, from pressing F12 to this point. I just couldn't understand the RE_callbacks.c file.
And for your second post : thanks a lot, man. This helps me very very much. I will dive into the code immediately to continue my journey
well, I've taken a look at the code before the function RE_local_getrender_data() was called, but I can't find a place where this function is called : RE_set_getrenderdata_callback(...).
Does anyone have an idea where this function could be called in the source?
Ah, there you go. I've found the function it refers to.
RE_set_getrenderdata_callback is declared all the way back in creator.c and it sets f to RE_RotateBlenderScene which is defined/declared in RE_renderconverter.h/c.