2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup render
|
2011-02-27 19:31:27 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* Global includes */
|
|
|
|
|
|
|
|
|
|
#include <math.h>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <stdio.h>
|
2002-10-12 11:37:38 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BLI_ghash.h"
|
|
|
|
|
#include "BLI_math.h"
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#include "DNA_camera_types.h"
|
|
|
|
|
|
2011-11-05 13:00:39 +00:00
|
|
|
#include "BKE_camera.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* this module */
|
2020-11-06 10:36:51 -05:00
|
|
|
#include "pipeline.h"
|
2020-11-06 10:43:50 -05:00
|
|
|
#include "render_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* Own includes */
|
|
|
|
|
#include "initrender.h"
|
|
|
|
|
|
2006-12-05 16:43:01 +00:00
|
|
|
/* ****************** MASKS and LUTS **************** */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2005-11-23 15:20:45 +00:00
|
|
|
static float filt_quadratic(float x)
|
|
|
|
|
{
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x < 0.0f) {
|
2010-03-22 09:30:00 +00:00
|
|
|
x = -x;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 0.5f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.75f - (x * x);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 1.5f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.50f * (x - 1.5f) * (x - 1.5f);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2010-03-22 09:30:00 +00:00
|
|
|
return 0.0f;
|
2005-11-23 15:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float filt_cubic(float x)
|
|
|
|
|
{
|
2012-06-16 16:57:16 +00:00
|
|
|
float x2 = x * x;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x < 0.0f) {
|
2010-03-22 09:30:00 +00:00
|
|
|
x = -x;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x < 1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.5f * x * x2 - x2 + 2.0f / 3.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 2.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return (2.0f - x) * (2.0f - x) * (2.0f - x) / 6.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2010-03-22 09:30:00 +00:00
|
|
|
return 0.0f;
|
2005-11-23 15:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float filt_catrom(float x)
|
|
|
|
|
{
|
2012-06-16 16:57:16 +00:00
|
|
|
float x2 = x * x;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x < 0.0f) {
|
2010-03-22 09:30:00 +00:00
|
|
|
x = -x;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 1.5f * x2 * x - 2.5f * x2 + 1.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 2.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return -0.5f * x2 * x + 2.5f * x2 - 4.0f * x + 2.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2010-03-22 09:30:00 +00:00
|
|
|
return 0.0f;
|
2005-11-23 15:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
static float filt_mitchell(float x) /* Mitchell & Netravali's two-param cubic */
|
2005-11-23 15:20:45 +00:00
|
|
|
{
|
2012-06-16 16:57:16 +00:00
|
|
|
float b = 1.0f / 3.0f, c = 1.0f / 3.0f;
|
|
|
|
|
float p0 = (6.0f - 2.0f * b) / 6.0f;
|
|
|
|
|
float p2 = (-18.0f + 12.0f * b + 6.0f * c) / 6.0f;
|
|
|
|
|
float p3 = (12.0f - 9.0f * b - 6.0f * c) / 6.0f;
|
|
|
|
|
float q0 = (8.0f * b + 24.0f * c) / 6.0f;
|
|
|
|
|
float q1 = (-12.0f * b - 48.0f * c) / 6.0f;
|
|
|
|
|
float q2 = (6.0f * b + 30.0f * c) / 6.0f;
|
|
|
|
|
float q3 = (-b - 6.0f * c) / 6.0f;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x < -2.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < -1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return (q0 - x * (q1 - x * (q2 - x * q3)));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 0.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return (p0 + x * x * (p2 - x * p3));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return (p0 + x * x * (p2 + x * p3));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
|
if (x < 2.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return (q0 + x * (q1 + x * (q2 + x * q3)));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2011-08-20 17:39:13 +00:00
|
|
|
return 0.0f;
|
2005-11-23 15:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
/* x ranges from -1 to 1 */
|
|
|
|
|
float RE_filter_value(int type, float x)
|
|
|
|
|
{
|
2012-06-16 16:57:16 +00:00
|
|
|
float gaussfac = 1.6f;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2020-03-06 17:18:10 +01:00
|
|
|
x = fabsf(x);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (type) {
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_BOX:
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x > 1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2011-08-20 17:39:13 +00:00
|
|
|
return 1.0f;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_TENT:
|
2019-04-22 09:08:06 +10:00
|
|
|
if (x > 1.0f) {
|
2012-06-16 16:57:16 +00:00
|
|
|
return 0.0f;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2012-06-16 16:57:16 +00:00
|
|
|
return 1.0f - x;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_GAUSS: {
|
2014-10-31 12:15:38 +01:00
|
|
|
const float two_gaussfac2 = 2.0f * gaussfac * gaussfac;
|
|
|
|
|
x *= 3.0f * gaussfac;
|
2019-03-25 11:55:36 +11:00
|
|
|
return 1.0f / sqrtf((float)M_PI * two_gaussfac2) * expf(-x * x / two_gaussfac2);
|
2014-10-31 12:15:38 +01:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_MITCH:
|
2012-06-16 16:57:16 +00:00
|
|
|
return filt_mitchell(x * gaussfac);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_QUAD:
|
2012-06-16 16:57:16 +00:00
|
|
|
return filt_quadratic(x * gaussfac);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_CUBIC:
|
2012-06-16 16:57:16 +00:00
|
|
|
return filt_cubic(x * gaussfac);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-02-03 20:39:36 +00:00
|
|
|
case R_FILTER_CATROM:
|
2012-06-16 16:57:16 +00:00
|
|
|
return filt_catrom(x * gaussfac);
|
2006-02-03 20:39:36 +00:00
|
|
|
}
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
2011-04-30 04:29:36 +00:00
|
|
|
struct Object *RE_GetCamera(Render *re)
|
|
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
Object *camera = re->camera_override ? re->camera_override : re->scene->camera;
|
|
|
|
|
return BKE_camera_multiview_render(re->scene, camera, re->viewname);
|
2011-04-30 04:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
2020-09-04 20:59:13 +02:00
|
|
|
void RE_SetOverrideCamera(Render *re, Object *cam_ob)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
2020-09-04 20:59:13 +02:00
|
|
|
re->camera_override = cam_ob;
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
|
|
2021-02-05 16:23:34 +11:00
|
|
|
/**
|
|
|
|
|
* Per render, there's one persistent view-plane. Parts will set their own view-planes.
|
|
|
|
|
*
|
|
|
|
|
* \note call this after #RE_InitState().
|
|
|
|
|
*/
|
2011-11-18 15:52:00 +00:00
|
|
|
void RE_SetCamera(Render *re, Object *cam_ob)
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
{
|
2011-11-18 15:52:00 +00:00
|
|
|
CameraParams params;
|
|
|
|
|
|
|
|
|
|
/* setup parameters */
|
2012-05-05 00:58:22 +00:00
|
|
|
BKE_camera_params_init(¶ms);
|
|
|
|
|
BKE_camera_params_from_object(¶ms, cam_ob);
|
2021-01-21 14:29:20 +01:00
|
|
|
BKE_camera_multiview_params(&re->r, ¶ms, cam_ob, re->viewname);
|
2011-11-18 15:52:00 +00:00
|
|
|
|
|
|
|
|
/* compute matrix, viewplane, .. */
|
2012-05-05 00:58:22 +00:00
|
|
|
BKE_camera_params_compute_viewplane(¶ms, re->winx, re->winy, re->r.xasp, re->r.yasp);
|
|
|
|
|
BKE_camera_params_compute_matrix(¶ms);
|
2011-04-15 12:08:17 +00:00
|
|
|
|
2011-11-18 15:52:00 +00:00
|
|
|
/* extract results */
|
2021-01-21 14:29:20 +01:00
|
|
|
copy_m4_m4(re->winmat, params.winmat);
|
|
|
|
|
re->clip_start = params.clip_start;
|
|
|
|
|
re->clip_end = params.clip_end;
|
|
|
|
|
re->viewplane = params.viewplane;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2020-08-02 17:17:31 +10:00
|
|
|
void RE_GetCameraWindow(struct Render *re, struct Object *camera, float r_winmat[4][4])
|
2007-12-01 19:29:50 +00:00
|
|
|
{
|
|
|
|
|
RE_SetCamera(re, camera);
|
2020-08-02 17:17:31 +10:00
|
|
|
copy_m4_m4(r_winmat, re->winmat);
|
2007-12-01 19:29:50 +00:00
|
|
|
}
|
|
|
|
|
|
2018-10-31 18:31:14 +01:00
|
|
|
/* Must be called after RE_GetCameraWindow(), does not change re->winmat. */
|
2020-08-02 17:17:31 +10:00
|
|
|
void RE_GetCameraWindowWithOverscan(struct Render *re, float overscan, float r_winmat[4][4])
|
2018-10-31 18:31:14 +01:00
|
|
|
{
|
|
|
|
|
CameraParams params;
|
|
|
|
|
params.is_ortho = re->winmat[3][3] != 0.0f;
|
2019-02-16 12:21:44 +11:00
|
|
|
params.clip_start = re->clip_start;
|
|
|
|
|
params.clip_end = re->clip_end;
|
2018-10-31 18:31:14 +01:00
|
|
|
params.viewplane = re->viewplane;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-31 18:31:14 +01:00
|
|
|
overscan *= max_ff(BLI_rctf_size_x(¶ms.viewplane), BLI_rctf_size_y(¶ms.viewplane));
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-31 18:31:14 +01:00
|
|
|
params.viewplane.xmin -= overscan;
|
|
|
|
|
params.viewplane.xmax += overscan;
|
|
|
|
|
params.viewplane.ymin -= overscan;
|
|
|
|
|
params.viewplane.ymax += overscan;
|
|
|
|
|
BKE_camera_params_compute_matrix(¶ms);
|
2020-08-02 17:17:31 +10:00
|
|
|
copy_m4_m4(r_winmat, params.winmat);
|
2018-10-31 18:31:14 +01:00
|
|
|
}
|
|
|
|
|
|
2020-08-02 17:17:31 +10:00
|
|
|
void RE_GetCameraModelMatrix(Render *re, struct Object *camera, float r_modelmat[4][4])
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
2020-08-02 17:17:31 +10:00
|
|
|
BKE_camera_multiview_model_matrix(&re->r, camera, re->viewname, r_modelmat);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
|
|
2021-01-21 14:29:20 +01:00
|
|
|
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
|
|
|
|
|
{
|
|
|
|
|
*r_viewplane = re->viewplane;
|
|
|
|
|
|
|
|
|
|
/* make disprect zero when no border render, is needed to detect changes in 3d view render */
|
|
|
|
|
if (re->r.mode & R_BORDER) {
|
|
|
|
|
*r_disprect = re->disprect;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
BLI_rcti_init(r_disprect, 0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* ~~~~~~~~~~~~~~~~ part (tile) calculus ~~~~~~~~~~~~~~~~~~~~~~ */
|
2004-12-01 19:46:58 +00:00
|
|
|
|
2012-11-21 10:20:38 +00:00
|
|
|
void RE_parts_free(Render *re)
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
{
|
2019-05-19 21:51:18 +02:00
|
|
|
if (re->parts) {
|
|
|
|
|
BLI_ghash_free(re->parts, NULL, MEM_freeN);
|
|
|
|
|
re->parts = NULL;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2012-11-21 10:20:38 +00:00
|
|
|
void RE_parts_clamp(Render *re)
|
|
|
|
|
{
|
|
|
|
|
/* part size */
|
2013-08-05 06:08:58 +00:00
|
|
|
re->partx = max_ii(1, min_ii(re->r.tilex, re->rectx));
|
|
|
|
|
re->party = max_ii(1, min_ii(re->r.tiley, re->recty));
|
2012-11-21 10:20:38 +00:00
|
|
|
}
|
|
|
|
|
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
void RE_parts_init(Render *re)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
Recoded Panorama rendering.
The old implementation was added quite hackish (talking about 10 yr ago).
You also had to make a small image slice, which was extended Xparts in
size. That also required to adjust the camera angle. Very clumsy.
Now; when enabling the Panorama option, it will automatically apply the
panorama effect on the vertically aligned tiles. You can just enable or
disable the "Pano" button, to get a subtle lens effect like this:
(without pano)
http://www.blender.org/bf/rt.jpg
(with pano)
http://www.blender.org/bf/rt1.jpg
For Panorama render, the minimum slice size has been hardcoded to be 8
pixels. The XParts button goes up to 512 to allow that. In practice,
rendering 64 slices will already give very good images for a wide angle
lens of 90 degrees, the curvature of straight lines then is equal to
a circle of 256 points.
Rendering a full 360 degree panorama you do by creating an extreme wide
angle camera. The theory says camera-lens 5 should do 360 degrees, but
for some reason my tests reveil it's 5.1... there's a rounding error
somewhere, maybe related to the clipping plane start? Will look at that
later. :)
Also note that for each Xpart slice, the entire database needs to be
rotated around camera to correct for panorama, on huge scenes that might
give some overhead.
Threaded render goes fine for Panorama too, but it can only render the
vertically aligned parts in parallel. For the next panorama slice it has
to wait for all threads of the current slice to be ready.
On reading old files, I convert the settings to match as closely as
possible the new situation.
Since I cannot bump up the version #, the code detects for old panorama
by checking for the image size. If image width is smaller than height, it
assumes it's an old file (only if Panoroma option was set).
2006-02-27 12:39:36 +00:00
|
|
|
int nr, xd, yd, partx, party, xparts, yparts;
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
int xminb, xmaxb, yminb, ymaxb;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-11-21 10:20:38 +00:00
|
|
|
RE_parts_free(re);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-19 21:51:18 +02:00
|
|
|
re->parts = BLI_ghash_new(
|
|
|
|
|
BLI_ghashutil_inthash_v4_p, BLI_ghashutil_inthash_v4_cmp, "render parts");
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* just for readable code.. */
|
2012-06-16 16:57:16 +00:00
|
|
|
xminb = re->disprect.xmin;
|
|
|
|
|
yminb = re->disprect.ymin;
|
|
|
|
|
xmaxb = re->disprect.xmax;
|
|
|
|
|
ymaxb = re->disprect.ymax;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-11-21 10:20:38 +00:00
|
|
|
RE_parts_clamp(re);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-11-21 10:20:38 +00:00
|
|
|
partx = re->partx;
|
|
|
|
|
party = re->party;
|
2012-11-05 08:05:14 +00:00
|
|
|
/* part count */
|
|
|
|
|
xparts = (re->rectx + partx - 1) / partx;
|
|
|
|
|
yparts = (re->recty + party - 1) / party;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
for (nr = 0; nr < xparts * yparts; nr++) {
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
rcti disprect;
|
|
|
|
|
int rectx, recty;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
xd = (nr % xparts);
|
|
|
|
|
yd = (nr - xd) / xparts;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
disprect.xmin = xminb + xd * partx;
|
|
|
|
|
disprect.ymin = yminb + yd * party;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* ensure we cover the entire picture, so last parts go to end */
|
2012-06-16 16:57:16 +00:00
|
|
|
if (xd < xparts - 1) {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.xmax = disprect.xmin + partx;
|
2019-04-22 09:08:06 +10:00
|
|
|
if (disprect.xmax > xmaxb) {
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
disprect.xmax = xmaxb;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2005-01-30 15:40:42 +00:00
|
|
|
}
|
2019-04-22 09:08:06 +10:00
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.xmax = xmaxb;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
if (yd < yparts - 1) {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.ymax = disprect.ymin + party;
|
2019-04-22 09:08:06 +10:00
|
|
|
if (disprect.ymax > ymaxb) {
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
disprect.ymax = ymaxb;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2005-06-09 11:02:06 +00:00
|
|
|
}
|
2019-04-22 09:08:06 +10:00
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.ymax = ymaxb;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-09-15 11:48:20 +00:00
|
|
|
rectx = BLI_rcti_size_x(&disprect);
|
|
|
|
|
recty = BLI_rcti_size_y(&disprect);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* so, now can we add this part? */
|
2012-06-16 16:57:16 +00:00
|
|
|
if (rectx > 0 && recty > 0) {
|
|
|
|
|
RenderPart *pa = MEM_callocN(sizeof(RenderPart), "new part");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-16 16:57:16 +00:00
|
|
|
pa->disprect = disprect;
|
|
|
|
|
pa->rectx = rectx;
|
|
|
|
|
pa->recty = recty;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-19 21:51:18 +02:00
|
|
|
BLI_ghash_insert(re->parts, &pa->disprect, pa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
}
|