Previous Thread  Next Thread

chat icon blender scanline renderer

hannibar

Posted: Fri May 30, 2003 10:59 am
Joined: 16 Oct 2002
Posts: 69
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?
Reply with quote


hannibar

Posted: Sat May 31, 2003 5:56 pm
Joined: 16 Oct 2002
Posts: 69
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 and Re_jitterate2 in blender/source/blender/render/intern/source/jitter.c ? I don't fully understand this.
Reply with quote


Jamesk

Posted: Sat May 31, 2003 7:03 pm
Joined: 14 Oct 2002
Posts: 239
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
Reply with quote


hannibar

Posted: Sat May 31, 2003 10:50 pm
Joined: 16 Oct 2002
Posts: 69
Thanks. That explanation is very clear. Makes me understand the code a lot better too.
Reply with quote


hannibar

Posted: Sun Jun 01, 2003 2:03 pm
Joined: 16 Oct 2002
Posts: 69
another question

In the function prepareScene () in renderPreAndPost.c, 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?
Reply with quote


hannibar

Posted: Mon Jun 02, 2003 5:53 pm
Joined: 16 Oct 2002
Posts: 69
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?
Reply with quote


cmccad

Posted: Mon Jun 02, 2003 6:08 pm
Joined: 07 Apr 2003
Posts: 48
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 Wink .

As for where to post... I haven't found a specific forum devoted to figuring out the code Sad . 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 Smile .

Casey
Reply with quote


cmccad

Posted: Mon Jun 02, 2003 7:17 pm
Joined: 07 Apr 2003
Posts: 48
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:
RE_set_getrenderdata_callback(my_get_renderdata());

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:

RE_local_get_renderdata()

and it will run the code in my_get_renderdata(). It's just like magic! Wink

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 Smile .

HTH,
Casey
Reply with quote


hannibar

Posted: Tue Jun 03, 2003 7:07 pm
Joined: 16 Oct 2002
Posts: 69
Quote:
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 Very Happy

[edit]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?
Reply with quote


hannibar

Posted: Wed Jun 04, 2003 4:21 pm
Joined: 16 Oct 2002
Posts: 69
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.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group