blender scanline renderer

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

blender scanline renderer

Postby hannibar » Fri May 30, 2003 11:59 am

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?

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Sat May 31, 2003 6:56 pm

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.

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Postby Jamesk » Sat May 31, 2003 8:03 pm

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.

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Sat May 31, 2003 11:50 pm

Thanks. That explanation is very clear. Makes me understand the code a lot better too.

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Sun Jun 01, 2003 3:03 pm

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?

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Mon Jun 02, 2003 6:53 pm

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?

cmccad
Posts: 48
Joined: Mon Apr 07, 2003 11:58 pm

Postby cmccad » Mon Jun 02, 2003 7:08 pm

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 :) .

Casey

cmccad
Posts: 48
Joined: Mon Apr 07, 2003 11:58 pm

Postby cmccad » Mon Jun 02, 2003 8:17 pm

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! ;)

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 :) .

HTH,
Casey

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Tue Jun 03, 2003 8:07 pm

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 :D

[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?

hannibar
Posts: 69
Joined: Wed Oct 16, 2002 3:02 pm

Postby hannibar » Wed Jun 04, 2003 5:21 pm

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.


Return to “Rendering”

Who is online

Users browsing this forum: No registered users and 0 guests