[Bf-committers] Render Panel Proprosal (Variable OSA, Render Sizes)
Robert Tiess
bf-committers@blender.org
Tue, 17 Feb 2004 23:44:16 -0500
Hello, everyone. This is my first time ever doing something like this,
so I hope with all my heart I do this properly.
For the longest time I have admired the efforts of the Blender coders
and enjoyed creating things based on the incredible program you've
created for us. THANK YOU for that. Your work is incredible and inspiring.
Today I have begun to study the Blender source code and examine where
there might be some minor opportunities for productivity enhancement. I
have tested three minor new changes I've introduced into the Render
panel with promising results using the Cygwin and the gcc compiler.
The coding guidelines ask us to send a separate mailing/patch per
feature change/addition, but almost all my changes occur in the same
section of code (with the exception of a necessary button name
definition in butspace.h), and since this is all in one area of the
Render window I thought it might be better this way -- especially since
I am hesitant to mess with the text outputted by cvs diff.
So I will divide this e-mail into three parts, beginning with the
variable OSA slider I added to replace the predefined OSA buttons. I am
enclosing the entire patch code at the end of this message.
Thank you for your time.
PART ONE: VARIABLE OSA SLIDER
OSA right now ranges from 5 to 16, with the preset button values of 5,
8, 11, 16. My slider allows users to go from 2 to 16 in increments of
1. There are several advantages to allowing users more control over OSA:
- Lower OSA values require less memory
- Lower OSA values result in faster renders
- Lower OSA values can also offer dramatic speed boosts for complex
renders - especially animations, where Motion Blur is used.
Using an early 100 frame animation I made involving a fish swimming
along a circular path, I tested OSA 2 with a Motion Blur factor of .5 at
a resolution of 640x480 (clicking the PC resolution button in the Render
pane). The complete animation rendered with motion blur (using AVI
Jpeg) in 1 minute and 25 seconds on a Pentium 4 2.4ghz system. Granted,
motion blur was not nearly as attractively distributed as would be
available with higher OSA values, but the fact that detectable motion
blur was produced using this minimal value helped move the animation
renders along quickly and for the computations to take up not as much
memory and processing time required by higher OSA values.
The same animation using the minimal OSA 5 value and the same criteria
mentioned above rendered in about 4 minutes 30 seconds, and the motion
blur wasn't much noticeably improved (at a slower frame rates/higher
resolutions it would be increasingly apparent though).
For static renders, greater OSA control can be very helpful, especially
when used in conjunction with the variable Gauss filter: for test
renders (i.e. those renders produced before the final render), this
means you can preview a model/scene/animation at a very low OSA value
while being able, later, to go slightly higher existing OSA presets
without overtaxing your computer -- for example, a user with not a
particularly powerful system may want slightly better OSA than 5 but may
be overly burdened by an attempt to do OSA 11 -- with the adjustable OSA
slider, OSA 7, 9, or 10 become available. This is just one example, but
you get the idea.
PART TWO: VARIABLE RENDER SIZE SLIDER
Render size buttons currently occupy a sizeable portion of the Render
pane. I have created a variable RendSize slider to replace these
buttons with the following advantages in mind:
- A simpler/cleaner interface
- Increased render size range capability (my slider goes from 10% up to
200%)
- The absence of the 25%, 50%, and 75% buttons leave room for possibly
another button or two or a slider
- To get larger renders (up to 200% larger) it is no longer necessary to
edit your SizeX and SizeY settings
- For test renders, especially ray tracing and or radiosity renders, the
ability to render really small and fast can be a major productivity
boost. For example, if you're using the FULL button to set resolution,
that produces a render size of 1280x1024. To get an extremely fast
preview, a user could swing the slider down to 10% and get a quick
thumbnail, or go higher... 15 or 20%. Such small renders would not be
good for checking details visible only at substantially higher
resolutions, but these micro renders could provide speedy previews for
key elements in a scene, particularly lighting and colors. The
advantages of these extremely small renders also become evident during
animation test renders, where you might be just checking on the motion
or rotation of an object or set of objects.
PART THREE: A "PC2" BUTTON
This is the simplest of changes proposed for the Render pane. Currently
there is a PC button that loads the values 640 and 480 respectively in
the SizeX and SizeY buttons. 640x480 is a standard VGA resolution.
Over the past few years, 800x600 SVGA displays became more common as
minimal resolutions. With the increase of 17" and larger displays,
resolutions such as 1024x768 are becoming increasingly common on end
user systems. My changes in the patch code below resize the current PC
button to half its horizontal size and use the extra pixel space gained
to establish a "PC2" button, which when clicked sets SizeX to 800 and
SizeY to 600.
A screen capture summarizing the proposed Render panel revisions is
available at
http://webusers.warwick.net/~u1019306/myblenderimages/blenderRenderWindow021704.jpg
What follows now is the patch code generated by the cvs diff patch
command prescribed by the coding guidelines. I deeply apologize in
advance if I have gone about any of this incorrectly. The Blender
coding team has my highest respect, so I am hoping to learn from this
experience so I might be able some day to help Blender evolve in
whatever way I can.
Take care everyone,
Robert
(aka RobertT on Elysiun and Blender.org)
Patch code begins with next line:
Index: source/blender/include/butspace.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/butspace.h,v
retrieving revision 1.18
diff -r1.18 butspace.h
257a258
> #define B_PR_PC2 1625
Index: source/blender/src/buttons_scene.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_scene.c,v
retrieving revision 1.37
diff -r1.37 buttons_scene.c
718a719,731
> case B_PR_PC2:
> G.scene->r.xsch= 800;
> G.scene->r.ysch= 600;
> G.scene->r.xasp= 100;
> G.scene->r.yasp= 100;
> G.scene->r.size= 100;
> G.scene->r.mode &= ~R_PANORAMA;
> G.scene->r.xparts= G.scene->r.yparts= 1;
>
> BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0);
> allqueue(REDRAWVIEWCAM, 0);
> allqueue(REDRAWBUTSSCENE, 0);
> break;
1031a1045,1049
> uiDefButS(block, NUM,B_DIFF,"Level:",
369,86,122,20,&G.scene->r.osa, 2.0, 16.0, 1, 2, "Sets oversample level");
>
> /*
> OLD OSA BUTTONS
>
1035a1054
> */
1057a1077,1082
>
> uiDefButS(block, NUM,B_DIFF,"RendSize:",
565,110,121,20,&G.scene->r.size, 10.0, 200.0, 1, 2, "Set render size
percentage");
>
> /*
> OLD RENDER BUTTONS
>
1061a1087,1088
> */
>
1195c1222,1223
< uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,100,18, 0,
0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100");
---
> uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,50,18, 0,
0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100");
> uiDefBut(block, BUT,B_PR_PC2, "PC2", 1196,90,50,18, 0,
0, 0, 0, 0, "Size preset: Image size - 800x600, Aspect ratio - 100x100");