2012-04-30 14:24:11 +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
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.
|
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
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2006 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 19:31:27 +00:00
|
|
|
/** \file blender/render/intern/source/pipeline.c
|
|
|
|
* \ingroup render
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
#include <math.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2011-04-12 15:55:38 +00:00
|
|
|
#include <stddef.h>
|
2016-01-11 12:32:29 +11:00
|
|
|
#include <errno.h>
|
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
|
|
|
|
2015-11-12 19:31:43 +05:00
|
|
|
#include "DNA_anim_types.h"
|
2006-06-10 16:30:44 +00:00
|
|
|
#include "DNA_image_types.h"
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
#include "DNA_node_types.h"
|
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
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "DNA_sequence_types.h"
|
2006-03-14 17:44:19 +00:00
|
|
|
#include "DNA_userdef_types.h"
|
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
|
|
|
|
2010-08-16 05:46:10 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
2013-01-10 16:37:48 +00:00
|
|
|
#include "BLI_math.h"
|
|
|
|
#include "BLI_rect.h"
|
|
|
|
#include "BLI_listbase.h"
|
|
|
|
#include "BLI_string.h"
|
|
|
|
#include "BLI_path_util.h"
|
2015-06-30 14:47:31 +10:00
|
|
|
#include "BLI_timecode.h"
|
2013-01-10 16:37:48 +00:00
|
|
|
#include "BLI_fileops.h"
|
|
|
|
#include "BLI_threads.h"
|
|
|
|
#include "BLI_rand.h"
|
|
|
|
#include "BLI_callbacks.h"
|
|
|
|
|
2015-08-16 17:32:01 +10:00
|
|
|
#include "BLT_translation.h"
|
2013-03-10 16:55:01 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
#include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */
|
2011-11-05 13:00:39 +00:00
|
|
|
#include "BKE_camera.h"
|
2015-10-27 19:00:51 +05:00
|
|
|
#include "BKE_colortools.h"
|
2013-12-26 17:24:42 +06:00
|
|
|
#include "BKE_depsgraph.h"
|
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
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_image.h"
|
2014-07-01 23:35:09 +09:00
|
|
|
#include "BKE_library.h"
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
#include "BKE_library_remap.h"
|
2006-12-20 17:57:56 +00:00
|
|
|
#include "BKE_main.h"
|
2013-12-26 17:24:42 +06:00
|
|
|
#include "BKE_modifier.h"
|
2006-01-24 21:50:23 +00:00
|
|
|
#include "BKE_node.h"
|
2011-03-27 23:11:22 +00:00
|
|
|
#include "BKE_pointcache.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "BKE_report.h"
|
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
|
|
|
#include "BKE_scene.h"
|
2009-12-13 14:56:45 +00:00
|
|
|
#include "BKE_sequencer.h"
|
2017-01-06 18:18:20 +01:00
|
|
|
#include "BKE_sound.h"
|
2012-06-13 17:23:44 +00:00
|
|
|
#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */
|
2015-04-06 10:40:12 -03:00
|
|
|
#include "BKE_object.h"
|
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
|
|
|
|
|
|
|
#include "PIL_time.h"
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
#include "IMB_colormanagement.h"
|
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
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
#include "IMB_imbuf_types.h"
|
Work in progress commit on saving OpenEXR with all render-layers and
passes in single file. Code is currently disabled, commit is mainly to
have a nicer method of excluding OpenEXR dependency from render module.
This should compile with disabled WITH_OPENEXR too.
Reason why EXR is great to include by default in Blender is its feature
to store unlimited layers and channels, and write this tile based. I
need the feature for saving memory; while rendering tiles, all full-size
buffers for all layers and passes are kept in memory now, which can go
into 100s of MB easily.
The code I commit now doesn't allocate these buffers while rendering, but
saves the tiles to disk. In the end is it read back. Overhead for large
renders (like 300 meg buffers) is 10-15 seconds, not bad.
Two more interesting aspects:
- Blender can save such multi-layer files in the temp directory, storing
it with .blend file name and scene name. That way, on each restart of Blender,
or on switching scenes, these buffers can be read. So you always see what was
rendered last. Also great for compositing work.
- This can also become an output image type for rendering. There's plenty of
cases where you want specific layers or passes saved to disk for later use.
Anyhoo, finishing it is another days of work, and I got more urgent stuff
now!
2006-02-23 20:57:31 +00:00
|
|
|
|
2011-10-22 16:24:28 +00:00
|
|
|
#include "RE_engine.h"
|
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
|
|
|
#include "RE_pipeline.h"
|
2008-05-18 13:01:52 +00:00
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
# include "FRS_freestyle.h"
|
|
|
|
#endif
|
2009-09-28 04:12:06 +00:00
|
|
|
|
Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 15:05:57 +05:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
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
|
|
|
/* internal */
|
2012-01-05 17:50:09 +00:00
|
|
|
#include "render_result.h"
|
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
|
|
|
#include "render_types.h"
|
|
|
|
#include "renderpipeline.h"
|
|
|
|
#include "renderdatabase.h"
|
|
|
|
#include "rendercore.h"
|
|
|
|
#include "initrender.h"
|
2008-01-28 16:33:59 +00:00
|
|
|
#include "pixelblending.h"
|
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
|
|
|
#include "zbuf.h"
|
|
|
|
|
|
|
|
/* render flow
|
2012-03-09 18:28:30 +00:00
|
|
|
*
|
|
|
|
* 1) Initialize state
|
|
|
|
* - state data, tables
|
|
|
|
* - movie/image file init
|
|
|
|
* - everything that doesn't change during animation
|
|
|
|
*
|
|
|
|
* 2) Initialize data
|
|
|
|
* - camera, world, matrices
|
|
|
|
* - make render verts, faces, halos, strands
|
|
|
|
* - everything can change per frame/field
|
|
|
|
*
|
|
|
|
* 3) Render Processor
|
|
|
|
* - multiple layers
|
|
|
|
* - tiles, rect, baking
|
|
|
|
* - layers/tiles optionally to disk or directly in Render Result
|
|
|
|
*
|
|
|
|
* 4) Composite Render Result
|
|
|
|
* - also read external files etc
|
|
|
|
*
|
|
|
|
* 5) Image Files
|
|
|
|
* - save file or append in movie
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
|
|
|
|
/* ********* globals ******** */
|
|
|
|
|
|
|
|
/* here we store all renders */
|
2010-02-09 19:37:37 +00:00
|
|
|
static struct {
|
|
|
|
ListBase renderlist;
|
2013-05-08 13:23:17 +00:00
|
|
|
} RenderGlobal = {{NULL, NULL}};
|
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
|
|
|
|
|
|
|
/* hardcopy of current render, used while rendering for speed */
|
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
|
|
|
Render R;
|
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
|
|
|
|
|
|
|
/* ********* alloc and free ******** */
|
|
|
|
|
2015-10-24 01:01:10 +11:00
|
|
|
static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const int totvideos, const char *name_override);
|
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
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
static volatile int g_break = 0;
|
2010-10-16 14:32:17 +00:00
|
|
|
static int thread_break(void *UNUSED(arg))
|
2006-02-02 17:54:22 +00:00
|
|
|
{
|
|
|
|
return g_break;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
/* default callbacks, set in each new render */
|
2010-10-16 14:32:17 +00:00
|
|
|
static void result_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr)) {}
|
|
|
|
static void result_rcti_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect)) {}
|
2014-05-02 14:52:19 +02:00
|
|
|
static void current_scene_nothing(void *UNUSED(arg), Scene *UNUSED(scene)) {}
|
2010-10-16 14:32:17 +00:00
|
|
|
static void stats_nothing(void *UNUSED(arg), RenderStats *UNUSED(rs)) {}
|
|
|
|
static void float_nothing(void *UNUSED(arg), float UNUSED(val)) {}
|
2014-04-01 11:34:00 +11:00
|
|
|
static int default_break(void *UNUSED(arg)) { return G.is_break == true; }
|
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
|
|
|
|
2010-10-16 14:32:17 +00:00
|
|
|
static void stats_background(void *UNUSED(arg), RenderStats *rs)
|
2006-02-15 15:22:49 +00:00
|
|
|
{
|
2010-05-04 12:31:24 +00:00
|
|
|
uintptr_t mem_in_use, mmap_in_use, peak_memory;
|
|
|
|
float megs_used_memory, mmap_used_memory, megs_peak_memory;
|
2015-06-17 16:06:33 +02:00
|
|
|
char info_time_str[32];
|
2010-05-04 12:31:24 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
mem_in_use = MEM_get_memory_in_use();
|
|
|
|
mmap_in_use = MEM_get_mapped_memory_in_use();
|
2010-05-04 12:31:24 +00:00
|
|
|
peak_memory = MEM_get_peak_memory();
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
megs_used_memory = (mem_in_use - mmap_in_use) / (1024.0 * 1024.0);
|
|
|
|
mmap_used_memory = (mmap_in_use) / (1024.0 * 1024.0);
|
|
|
|
megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
|
2010-05-04 12:31:24 +00:00
|
|
|
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout, IFACE_("Fra:%d Mem:%.2fM (%.2fM, Peak %.2fM) "), rs->cfra,
|
2011-11-11 13:09:14 +00:00
|
|
|
megs_used_memory, mmap_used_memory, megs_peak_memory);
|
2011-02-12 01:02:21 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rs->curfield)
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout, IFACE_("Field %d "), rs->curfield);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rs->curblur)
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout, IFACE_("Blur %d "), rs->curblur);
|
2011-02-12 01:02:21 +00:00
|
|
|
|
2015-06-30 14:47:31 +10:00
|
|
|
BLI_timecode_string_from_time_simple(info_time_str, sizeof(info_time_str), PIL_check_seconds_timer() - rs->starttime);
|
2015-06-17 16:06:33 +02:00
|
|
|
fprintf(stdout, IFACE_("| Time:%s | "), info_time_str);
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rs->infostr) {
|
2015-06-17 16:06:33 +02:00
|
|
|
fprintf(stdout, "%s", rs->infostr);
|
2008-01-31 18:03:46 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rs->tothalo)
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout, IFACE_("Sce: %s Ve:%d Fa:%d Ha:%d La:%d"),
|
|
|
|
rs->scene_name, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
|
2011-02-12 01:02:21 +00:00
|
|
|
else
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout, IFACE_("Sce: %s Ve:%d Fa:%d La:%d"), rs->scene_name, rs->totvert, rs->totface, rs->totlamp);
|
2008-01-31 18:03:46 +00:00
|
|
|
}
|
2011-08-31 10:43:22 +00:00
|
|
|
|
2015-06-17 15:49:09 +02:00
|
|
|
/* Flush stdout to be sure python callbacks are printing stuff after blender. */
|
|
|
|
fflush(stdout);
|
|
|
|
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
|
2011-08-31 10:43:22 +00:00
|
|
|
|
2011-02-18 07:28:10 +00:00
|
|
|
fputc('\n', stdout);
|
2011-02-12 01:02:21 +00:00
|
|
|
fflush(stdout);
|
2006-02-15 15:22:49 +00:00
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
static void render_print_save_message(
|
|
|
|
ReportList *reports, const char *name, int ok, int err)
|
2016-01-11 12:32:29 +11:00
|
|
|
{
|
|
|
|
if (ok) {
|
2016-03-10 19:34:53 +11:00
|
|
|
/* no need to report, just some helpful console info */
|
2016-01-11 12:32:29 +11:00
|
|
|
printf("Saved: '%s'\n", name);
|
|
|
|
}
|
|
|
|
else {
|
2016-03-10 19:34:53 +11:00
|
|
|
/* report on error since users will want to know what failed */
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "Render error (%s) cannot save: '%s'", strerror(err), name);
|
2016-01-11 12:32:29 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int render_imbuf_write_stamp_test(
|
2016-03-10 19:34:53 +11:00
|
|
|
ReportList *reports,
|
2016-01-11 12:32:29 +11:00
|
|
|
Scene *scene, struct RenderResult *rr, ImBuf *ibuf, const char *name,
|
|
|
|
const ImageFormatData *imf, bool stamp)
|
|
|
|
{
|
|
|
|
int ok;
|
|
|
|
|
|
|
|
if (stamp) {
|
|
|
|
/* writes the name of the individual cameras */
|
|
|
|
ok = BKE_imbuf_write_stamp(scene, rr, ibuf, name, imf);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ok = BKE_imbuf_write(ibuf, name, imf);
|
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
render_print_save_message(reports, name, ok, errno);
|
2016-01-11 12:32:29 +11:00
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
void RE_FreeRenderResult(RenderResult *res)
|
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
|
|
|
{
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(res);
|
2006-02-02 17:54:22 +00:00
|
|
|
}
|
|
|
|
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
float *RE_RenderLayerGetPass(volatile RenderLayer *rl, const char *name, const char *viewname)
|
2006-02-02 17:54:22 +00:00
|
|
|
{
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
RenderPass *rpass = RE_pass_find_by_name(rl, name, viewname);
|
2015-05-18 10:57:59 -03:00
|
|
|
return rpass ? rpass->rect : NULL;
|
2006-02-02 17:54:22 +00:00
|
|
|
}
|
|
|
|
|
2006-03-07 21:26:37 +00:00
|
|
|
RenderLayer *RE_GetRenderLayer(RenderResult *rr, const char *name)
|
|
|
|
{
|
2012-09-04 18:27:47 +00:00
|
|
|
if (rr == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return BLI_findstring(&rr->layers, name, offsetof(RenderLayer, name));
|
|
|
|
}
|
2006-03-07 21:26:37 +00:00
|
|
|
}
|
Work in progress commit on saving OpenEXR with all render-layers and
passes in single file. Code is currently disabled, commit is mainly to
have a nicer method of excluding OpenEXR dependency from render module.
This should compile with disabled WITH_OPENEXR too.
Reason why EXR is great to include by default in Blender is its feature
to store unlimited layers and channels, and write this tile based. I
need the feature for saving memory; while rendering tiles, all full-size
buffers for all layers and passes are kept in memory now, which can go
into 100s of MB easily.
The code I commit now doesn't allocate these buffers while rendering, but
saves the tiles to disk. In the end is it read back. Overhead for large
renders (like 300 meg buffers) is 10-15 seconds, not bad.
Two more interesting aspects:
- Blender can save such multi-layer files in the temp directory, storing
it with .blend file name and scene name. That way, on each restart of Blender,
or on switching scenes, these buffers can be read. So you always see what was
rendered last. Also great for compositing work.
- This can also become an output image type for rendering. There's plenty of
cases where you want specific layers or passes saved to disk for later use.
Anyhoo, finishing it is another days of work, and I got more urgent stuff
now!
2006-02-23 20:57:31 +00:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
RenderResult *RE_MultilayerConvert(void *exrhandle, const char *colorspace, bool predivide, int rectx, int recty)
|
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
|
|
|
{
|
2012-09-23 18:50:56 +00:00
|
|
|
return render_result_new_from_exr(exrhandle, colorspace, predivide, rectx, recty);
|
2012-01-05 17:50:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RenderLayer *render_get_active_layer(Render *re, RenderResult *rr)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
RenderLayer *rl = BLI_findlink(&rr->layers, re->r.actlay);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rl)
|
2012-01-05 17:50:09 +00:00
|
|
|
return rl;
|
|
|
|
else
|
|
|
|
return rr->layers.first;
|
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
|
|
|
}
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
static int render_scene_needs_vector(Render *re)
|
2006-01-31 21:49:05 +00:00
|
|
|
{
|
2008-02-18 13:38:16 +00:00
|
|
|
SceneRenderLayer *srl;
|
2006-01-31 21:49:05 +00:00
|
|
|
|
2014-02-21 16:35:23 +01:00
|
|
|
for (srl = re->r.layers.first; srl; srl = srl->next)
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!(srl->layflag & SCE_LAY_DISABLE))
|
|
|
|
if (srl->passflag & SCE_PASS_VECTOR)
|
2008-02-18 13:38:16 +00:00
|
|
|
return 1;
|
|
|
|
|
2006-01-31 21:49:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-05-15 18:21:02 +02:00
|
|
|
static bool render_scene_has_layers_to_render(Scene *scene)
|
|
|
|
{
|
|
|
|
SceneRenderLayer *srl;
|
|
|
|
for (srl = scene->r.layers.first; srl; srl = srl->next) {
|
|
|
|
if (!(srl->layflag & SCE_LAY_DISABLE)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* *************************************************** */
|
|
|
|
|
2010-03-27 15:35:34 +00:00
|
|
|
Render *RE_GetRender(const char *name)
|
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
|
|
|
{
|
|
|
|
Render *re;
|
2010-02-09 19:37:37 +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
|
|
|
/* search for existing renders */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (re = RenderGlobal.renderlist.first; re; re = re->next)
|
2015-01-26 16:03:11 +01:00
|
|
|
if (STREQLEN(re->name, name, RE_MAXNAME))
|
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
|
|
|
break;
|
2010-03-27 15:35:34 +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
|
|
|
return re;
|
|
|
|
}
|
|
|
|
|
2006-01-24 21:50:23 +00:00
|
|
|
/* if you want to know exactly what has been done */
|
2009-09-30 18:18:32 +00:00
|
|
|
RenderResult *RE_AcquireResultRead(Render *re)
|
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
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re) {
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_READ);
|
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
|
|
|
return re->result;
|
2009-09-30 18:18:32 +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
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
RenderResult *RE_AcquireResultWrite(Render *re)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re) {
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
return re->result;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-27 15:35:34 +00:00
|
|
|
void RE_SwapResult(Render *re, RenderResult **rr)
|
|
|
|
{
|
|
|
|
/* for keeping render buffers */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re) {
|
2012-06-13 17:23:44 +00:00
|
|
|
SWAP(RenderResult *, re->result, *rr);
|
2010-03-27 15:35:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
void RE_ReleaseResult(Render *re)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re)
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* displist.c util.... */
|
|
|
|
Scene *RE_GetScene(Render *re)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re)
|
2009-09-18 22:25:49 +00:00
|
|
|
return re->scene;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/**
|
|
|
|
* Same as #RE_AcquireResultImage but creating the necessary views to store the result
|
|
|
|
* fill provided result struct with a copy of thew views of what is done so far the
|
|
|
|
* #RenderResult.views #ListBase needs to be freed after with #RE_ReleaseResultImageViews
|
2016-07-15 02:36:21 +10:00
|
|
|
*/
|
2015-04-06 10:40:12 -03:00
|
|
|
void RE_AcquireResultImageViews(Render *re, RenderResult *rr)
|
|
|
|
{
|
|
|
|
memset(rr, 0, sizeof(RenderResult));
|
|
|
|
|
|
|
|
if (re) {
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_READ);
|
|
|
|
|
|
|
|
if (re->result) {
|
|
|
|
RenderLayer *rl;
|
|
|
|
RenderView *rv, *rview;
|
|
|
|
|
|
|
|
rr->rectx = re->result->rectx;
|
|
|
|
rr->recty = re->result->recty;
|
|
|
|
|
|
|
|
/* creates a temporary duplication of views */
|
|
|
|
render_result_views_shallowcopy(rr, re->result);
|
|
|
|
|
|
|
|
rv = rr->views.first;
|
2017-10-26 14:23:18 +02:00
|
|
|
rr->have_combined = (rv->rectf != NULL);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* active layer */
|
|
|
|
rl = render_get_active_layer(re, re->result);
|
|
|
|
|
|
|
|
if (rl) {
|
|
|
|
if (rv->rectf == NULL) {
|
|
|
|
for (rview = (RenderView *)rr->views.first; rview; rview = rview->next) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
rview->rectf = RE_RenderLayerGetPass(rl, RE_PASSNAME_COMBINED, rview->name);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rv->rectz == NULL) {
|
|
|
|
for (rview = (RenderView *)rr->views.first; rview; rview = rview->next) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
rview->rectz = RE_RenderLayerGetPass(rl, RE_PASSNAME_Z, rview->name);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rr->layers = re->result->layers;
|
|
|
|
rr->xof = re->disprect.xmin;
|
|
|
|
rr->yof = re->disprect.ymin;
|
2015-04-21 18:33:33 +02:00
|
|
|
rr->stamp_data = re->result->stamp_data;
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* clear temporary renderresult struct */
|
|
|
|
void RE_ReleaseResultImageViews(Render *re, RenderResult *rr)
|
|
|
|
{
|
|
|
|
if (re) {
|
|
|
|
if (rr) {
|
|
|
|
render_result_views_shallowdelete(rr);
|
|
|
|
}
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-24 21:50:23 +00:00
|
|
|
/* fill provided result struct with what's currently active or done */
|
2015-04-29 11:26:30 -03:00
|
|
|
/* this RenderResult struct is the only exception to the rule of a RenderResult */
|
|
|
|
/* always having at least one RenderView */
|
2015-04-06 10:40:12 -03:00
|
|
|
void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id)
|
2006-01-24 21:50:23 +00:00
|
|
|
{
|
2006-01-31 21:49:05 +00:00
|
|
|
memset(rr, 0, sizeof(RenderResult));
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re) {
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_READ);
|
2006-02-16 12:27:46 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->result) {
|
2009-09-30 18:18:32 +00:00
|
|
|
RenderLayer *rl;
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderView *rv;
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rr->rectx = re->result->rectx;
|
|
|
|
rr->recty = re->result->recty;
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* actview view */
|
2015-04-29 11:18:18 -03:00
|
|
|
rv = RE_RenderViewGetById(re->result, view_id);
|
2017-10-26 14:23:18 +02:00
|
|
|
rr->have_combined = (rv->rectf != NULL);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-04-29 11:26:30 -03:00
|
|
|
rr->rectf = rv->rectf;
|
|
|
|
rr->rectz = rv->rectz;
|
|
|
|
rr->rect32 = rv->rect32;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
rr->have_combined = (rv->rectf != NULL);
|
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
/* active layer */
|
2012-06-13 17:23:44 +00:00
|
|
|
rl = render_get_active_layer(re, re->result);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2015-04-29 11:26:30 -03:00
|
|
|
if (rl) {
|
2015-04-06 10:40:12 -03:00
|
|
|
if (rv->rectf == NULL)
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
rr->rectf = RE_RenderLayerGetPass(rl, RE_PASSNAME_COMBINED, rv->name);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
if (rv->rectz == NULL)
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
rr->rectz = RE_RenderLayerGetPass(rl, RE_PASSNAME_Z, rv->name);
|
2009-09-30 18:18:32 +00:00
|
|
|
}
|
2010-03-16 16:58:45 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rr->layers = re->result->layers;
|
2015-04-06 10:40:12 -03:00
|
|
|
rr->views = re->result->views;
|
|
|
|
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
rr->xof = re->disprect.xmin;
|
|
|
|
rr->yof = re->disprect.ymin;
|
2016-02-01 16:09:21 +01:00
|
|
|
|
|
|
|
rr->stamp_data = re->result->stamp_data;
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
}
|
2006-01-24 21:50:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
void RE_ReleaseResultImage(Render *re)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re)
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
|
2006-01-24 21:50:23 +00:00
|
|
|
/* caller is responsible for allocating rect in correct size! */
|
|
|
|
void RE_ResultGet32(Render *re, unsigned int *rect)
|
|
|
|
{
|
|
|
|
RenderResult rres;
|
2015-10-24 01:01:10 +11:00
|
|
|
const int view_id = BKE_scene_multiview_view_id_get(&re->r, re->viewname);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-04-29 11:26:30 -03:00
|
|
|
RE_AcquireResultImageViews(re, &rres);
|
|
|
|
render_result_rect_get_pixels(&rres, rect, re->rectx, re->recty, &re->scene->view_settings, &re->scene->display_settings, view_id);
|
|
|
|
RE_ReleaseResultImageViews(re, &rres);
|
2006-01-24 21:50:23 +00:00
|
|
|
}
|
|
|
|
|
2013-05-12 13:15:41 +00:00
|
|
|
/* caller is responsible for allocating rect in correct size! */
|
|
|
|
/* Only for acquired results, for lock */
|
2015-04-06 10:40:12 -03:00
|
|
|
void RE_AcquiredResultGet32(Render *re, RenderResult *result, unsigned int *rect, const int view_id)
|
2013-05-12 13:15:41 +00:00
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
render_result_rect_get_pixels(result, rect, re->rectx, re->recty, &re->scene->view_settings, &re->scene->display_settings, view_id);
|
2013-05-12 13:15:41 +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
|
|
|
RenderStats *RE_GetStats(Render *re)
|
|
|
|
{
|
|
|
|
return &re->i;
|
|
|
|
}
|
|
|
|
|
2010-03-27 15:35:34 +00:00
|
|
|
Render *RE_NewRender(const char *name)
|
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
|
|
|
{
|
|
|
|
Render *re;
|
2010-02-09 19:37:37 +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
|
|
|
/* only one render per name exists */
|
2012-06-13 17:23:44 +00:00
|
|
|
re = RE_GetRender(name);
|
|
|
|
if (re == NULL) {
|
2006-05-21 20:59:54 +00:00
|
|
|
|
|
|
|
/* new render data struct */
|
2012-06-13 17:23:44 +00:00
|
|
|
re = MEM_callocN(sizeof(Render), "new render");
|
2010-02-09 19:37:37 +00:00
|
|
|
BLI_addtail(&RenderGlobal.renderlist, re);
|
2011-09-26 18:51:10 +00:00
|
|
|
BLI_strncpy(re->name, name, RE_MAXNAME);
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_init(&re->resultmutex);
|
2015-03-20 17:48:45 +05:00
|
|
|
BLI_rw_mutex_init(&re->partsmutex);
|
Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 15:05:57 +05:00
|
|
|
re->eval_ctx = DEG_evaluation_context_new(DAG_EVAL_RENDER);
|
2006-05-21 20:59:54 +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
|
|
|
|
2010-11-03 11:14:02 +00:00
|
|
|
RE_InitRenderCB(re);
|
|
|
|
|
|
|
|
/* init some variables */
|
2012-06-13 17:23:44 +00:00
|
|
|
re->ycor = 1.0f;
|
2010-11-03 11:14:02 +00:00
|
|
|
|
|
|
|
return re;
|
|
|
|
}
|
|
|
|
|
2017-09-12 11:27:22 +05:00
|
|
|
/* MAX_ID_NAME + sizeof(Library->name) + space + null-terminator. */
|
|
|
|
#define MAX_SCENE_RENDER_NAME (MAX_ID_NAME + 1024 + 2)
|
|
|
|
|
|
|
|
static void scene_render_name_get(const Scene *scene,
|
|
|
|
const size_t max_size,
|
|
|
|
char *render_name)
|
|
|
|
{
|
2017-11-06 17:17:10 +01:00
|
|
|
if (ID_IS_LINKED(scene)) {
|
2017-09-12 11:27:22 +05:00
|
|
|
BLI_snprintf(render_name, max_size, "%s %s",
|
|
|
|
scene->id.lib->id.name, scene->id.name);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BLI_snprintf(render_name, max_size, "%s", scene->id.name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Render *RE_GetSceneRender(const Scene *scene)
|
|
|
|
{
|
|
|
|
char render_name[MAX_SCENE_RENDER_NAME];
|
|
|
|
scene_render_name_get(scene, sizeof(render_name), render_name);
|
|
|
|
return RE_GetRender(render_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
Render *RE_NewSceneRender(const Scene *scene)
|
|
|
|
{
|
|
|
|
char render_name[MAX_SCENE_RENDER_NAME];
|
|
|
|
scene_render_name_get(scene, sizeof(render_name), render_name);
|
|
|
|
return RE_NewRender(render_name);
|
|
|
|
}
|
|
|
|
|
2010-11-03 11:14:02 +00:00
|
|
|
/* called for new renders and when finishing rendering so
|
2012-03-18 07:38:51 +00:00
|
|
|
* we always have valid callbacks on a render */
|
2010-11-03 11:14:02 +00:00
|
|
|
void RE_InitRenderCB(Render *re)
|
|
|
|
{
|
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
|
|
|
/* set default empty callbacks */
|
2012-06-13 17:23:44 +00:00
|
|
|
re->display_init = result_nothing;
|
|
|
|
re->display_clear = result_nothing;
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update = result_rcti_nothing;
|
2014-05-02 14:52:19 +02:00
|
|
|
re->current_scene_update = current_scene_nothing;
|
2012-06-13 17:23:44 +00:00
|
|
|
re->progress = float_nothing;
|
|
|
|
re->test_break = default_break;
|
2012-03-24 06:38:07 +00:00
|
|
|
if (G.background)
|
2012-06-13 17:23:44 +00:00
|
|
|
re->stats_draw = stats_background;
|
2006-02-15 15:22:49 +00:00
|
|
|
else
|
2012-06-13 17:23:44 +00:00
|
|
|
re->stats_draw = stats_nothing;
|
2009-09-18 22:25:49 +00:00
|
|
|
/* clear callback handles */
|
2013-12-17 23:42:38 +06:00
|
|
|
re->dih = re->dch = re->duh = re->sdh = re->prh = re->tbh = NULL;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/* only call this while you know it will remove the link too */
|
|
|
|
void RE_FreeRender(Render *re)
|
|
|
|
{
|
2012-11-09 08:46:53 +00:00
|
|
|
if (re->engine)
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_end(&re->resultmutex);
|
2015-03-20 17:48:45 +05:00
|
|
|
BLI_rw_mutex_end(&re->partsmutex);
|
2014-02-21 16:35:23 +01:00
|
|
|
|
|
|
|
BLI_freelistN(&re->r.layers);
|
2015-05-13 01:00:03 -03:00
|
|
|
BLI_freelistN(&re->r.views);
|
|
|
|
|
2015-10-27 19:00:51 +05:00
|
|
|
curvemapping_free_data(&re->r.mblur_shutter_curve);
|
|
|
|
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
/* main dbase can already be invalid now, some database-free code checks it */
|
|
|
|
re->main = NULL;
|
2013-06-27 06:16:31 +00:00
|
|
|
re->scene = NULL;
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
|
|
|
|
RE_Database_Free(re); /* view render can still have full database */
|
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
|
|
|
free_sample_tables(re);
|
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
|
|
|
render_result_free(re->pushedresult);
|
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
|
|
|
|
2010-02-09 19:37:37 +00:00
|
|
|
BLI_remlink(&RenderGlobal.renderlist, re);
|
2013-12-26 17:24:42 +06:00
|
|
|
MEM_freeN(re->eval_ctx);
|
2006-09-06 19:13:23 +00:00
|
|
|
MEM_freeN(re);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/* exit blender */
|
|
|
|
void RE_FreeAllRender(void)
|
|
|
|
{
|
2012-03-24 07:52:14 +00:00
|
|
|
while (RenderGlobal.renderlist.first) {
|
2010-02-09 19:37:37 +00:00
|
|
|
RE_FreeRender(RenderGlobal.renderlist.first);
|
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
|
|
|
}
|
2013-05-15 17:06:56 +00:00
|
|
|
|
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
/* finalize Freestyle */
|
|
|
|
FRS_exit();
|
|
|
|
#endif
|
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
|
|
|
}
|
|
|
|
|
2015-09-21 18:41:36 +05:00
|
|
|
void RE_FreeAllPersistentData(void)
|
|
|
|
{
|
|
|
|
Render *re;
|
|
|
|
for (re = RenderGlobal.renderlist.first; re != NULL; re = re->next) {
|
|
|
|
if ((re->r.mode & R_PERSISTENT_DATA) != 0 && re->engine != NULL) {
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-26 08:10:12 +00:00
|
|
|
/* on file load, free all re */
|
|
|
|
void RE_FreeAllRenderResults(void)
|
|
|
|
{
|
|
|
|
Render *re;
|
|
|
|
|
|
|
|
for (re = RenderGlobal.renderlist.first; re; re = re->next) {
|
|
|
|
render_result_free(re->result);
|
|
|
|
render_result_free(re->pushedresult);
|
|
|
|
|
|
|
|
re->result = NULL;
|
|
|
|
re->pushedresult = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-10 04:59:52 +00:00
|
|
|
void RE_FreePersistentData(void)
|
2012-11-09 23:54:58 +00:00
|
|
|
{
|
|
|
|
Render *re;
|
|
|
|
|
|
|
|
/* render engines can be kept around for quick re-render, this clears all */
|
|
|
|
for (re = RenderGlobal.renderlist.first; re; re = re->next) {
|
|
|
|
if (re->engine) {
|
2012-11-13 11:00:46 +00:00
|
|
|
/* if engine is currently rendering, just tag it to be freed when render is finished */
|
|
|
|
if (!(re->engine->flag & RE_ENGINE_RENDERING))
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
|
2012-11-09 23:54:58 +00:00
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* ********* initialize state ******** */
|
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
/* clear full sample and tile flags if needed */
|
|
|
|
static int check_mode_full_sample(RenderData *rd)
|
|
|
|
{
|
|
|
|
int scemode = rd->scemode;
|
|
|
|
|
2014-11-04 20:41:12 +05:00
|
|
|
if (!STREQ(rd->engine, RE_engine_id_BLENDER_RENDER) &&
|
|
|
|
!STREQ(rd->engine, RE_engine_id_BLENDER_GAME))
|
|
|
|
{
|
|
|
|
scemode &= ~R_FULL_SAMPLE;
|
|
|
|
}
|
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
if ((rd->mode & R_OSA) == 0)
|
|
|
|
scemode &= ~R_FULL_SAMPLE;
|
|
|
|
|
|
|
|
#ifdef WITH_OPENEXR
|
|
|
|
if (scemode & R_FULL_SAMPLE)
|
|
|
|
scemode |= R_EXR_TILE_FILE; /* enable automatic */
|
|
|
|
#else
|
|
|
|
/* can't do this without openexr support */
|
|
|
|
scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return scemode;
|
|
|
|
}
|
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
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
static void re_init_resolution(Render *re, Render *source,
|
|
|
|
int winx, int winy, rcti *disprect)
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->winx = winx;
|
|
|
|
re->winy = winy;
|
2013-03-14 07:38:37 +00:00
|
|
|
if (source && (source->r.mode & R_BORDER)) {
|
|
|
|
/* eeh, doesn't seem original bordered disprect is storing anywhere
|
|
|
|
* after insertion on black happening in do_render_fields_blur_3d(),
|
|
|
|
* so for now simply re-calculate disprect using border from source
|
|
|
|
* renderer (sergey)
|
|
|
|
*/
|
|
|
|
|
|
|
|
re->disprect.xmin = source->r.border.xmin * winx;
|
|
|
|
re->disprect.xmax = source->r.border.xmax * winx;
|
|
|
|
|
|
|
|
re->disprect.ymin = source->r.border.ymin * winy;
|
|
|
|
re->disprect.ymax = source->r.border.ymax * winy;
|
|
|
|
|
|
|
|
re->rectx = BLI_rcti_size_x(&re->disprect);
|
|
|
|
re->recty = BLI_rcti_size_y(&re->disprect);
|
|
|
|
|
|
|
|
/* copy border itself, since it could be used by external engines */
|
|
|
|
re->r.border = source->r.border;
|
|
|
|
}
|
|
|
|
else if (disprect) {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->disprect = *disprect;
|
2013-03-14 07:38:37 +00:00
|
|
|
re->rectx = BLI_rcti_size_x(&re->disprect);
|
|
|
|
re->recty = BLI_rcti_size_y(&re->disprect);
|
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
|
|
|
}
|
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
re->disprect.xmin = re->disprect.ymin = 0;
|
|
|
|
re->disprect.xmax = winx;
|
|
|
|
re->disprect.ymax = winy;
|
2012-06-13 17:23:44 +00:00
|
|
|
re->rectx = winx;
|
|
|
|
re->recty = winy;
|
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
|
|
|
}
|
2014-06-19 16:21:17 +06:00
|
|
|
|
|
|
|
/* we clip faces with a minimum of 2 pixel boundary outside of image border. see zbuf.c */
|
|
|
|
re->clipcrop = 1.0f + 2.0f / (float)(re->winx > re->winy ? re->winy : re->winx);
|
|
|
|
}
|
|
|
|
|
2016-02-17 22:18:45 +01:00
|
|
|
void render_copy_renderdata(RenderData *to, RenderData *from)
|
|
|
|
{
|
|
|
|
BLI_freelistN(&to->layers);
|
|
|
|
BLI_freelistN(&to->views);
|
|
|
|
curvemapping_free_data(&to->mblur_shutter_curve);
|
|
|
|
|
|
|
|
*to = *from;
|
|
|
|
|
|
|
|
BLI_duplicatelist(&to->layers, &from->layers);
|
|
|
|
BLI_duplicatelist(&to->views, &from->views);
|
|
|
|
curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
|
|
|
|
}
|
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
/* what doesn't change during entire render sequence */
|
|
|
|
/* disprect is optional, if NULL it assumes full window render */
|
|
|
|
void RE_InitState(Render *re, Render *source, RenderData *rd,
|
|
|
|
SceneRenderLayer *srl,
|
|
|
|
int winx, int winy, rcti *disprect)
|
|
|
|
{
|
|
|
|
bool had_freestyle = (re->r.mode & R_EDGE_FRS) != 0;
|
|
|
|
|
|
|
|
re->ok = true; /* maybe flag */
|
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
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
re->i.starttime = PIL_check_seconds_timer();
|
|
|
|
|
|
|
|
/* copy render data and render layers for thread safety */
|
2016-02-17 22:18:45 +01:00
|
|
|
render_copy_renderdata(&re->r, rd);
|
2014-06-19 16:21:17 +06:00
|
|
|
|
|
|
|
if (source) {
|
|
|
|
/* reuse border flags from source renderer */
|
|
|
|
re->r.mode &= ~(R_BORDER | R_CROP);
|
|
|
|
re->r.mode |= source->r.mode & (R_BORDER | R_CROP);
|
|
|
|
|
|
|
|
/* dimensions shall be shared between all renderers */
|
|
|
|
re->r.xsch = source->r.xsch;
|
|
|
|
re->r.ysch = source->r.ysch;
|
|
|
|
re->r.size = source->r.size;
|
|
|
|
}
|
|
|
|
|
2017-07-10 12:17:13 +02:00
|
|
|
re_init_resolution(re, source, winx, winy, disprect);
|
|
|
|
|
2016-07-05 01:39:13 +02:00
|
|
|
/* disable border if it's a full render anyway */
|
|
|
|
if (re->r.border.xmin == 0.0f && re->r.border.xmax == 1.0f &&
|
|
|
|
re->r.border.ymin == 0.0f && re->r.border.ymax == 1.0f)
|
|
|
|
{
|
|
|
|
re->r.mode &= ~R_BORDER;
|
|
|
|
}
|
|
|
|
|
2013-01-15 10:47:13 +00:00
|
|
|
if (re->rectx < 1 || re->recty < 1 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
|
2012-05-20 19:49:27 +00:00
|
|
|
(re->rectx < 16 || re->recty < 16) ))
|
|
|
|
{
|
2011-06-28 16:25:07 +00:00
|
|
|
BKE_report(re->reports, RPT_ERROR, "Image too small");
|
2012-06-13 17:23:44 +00:00
|
|
|
re->ok = 0;
|
2010-01-06 00:09:07 +00:00
|
|
|
return;
|
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
|
|
|
}
|
2010-01-06 00:09:07 +00:00
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
re->r.scemode = check_mode_full_sample(&re->r);
|
2010-01-06 00:09:07 +00:00
|
|
|
|
|
|
|
/* fullsample wants uniform osa levels */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (source && (re->r.scemode & R_FULL_SAMPLE)) {
|
2010-01-06 00:09:07 +00:00
|
|
|
/* but, if source has no full sample we disable it */
|
2012-06-13 17:23:44 +00:00
|
|
|
if ((source->r.scemode & R_FULL_SAMPLE) == 0)
|
2010-01-06 00:09:07 +00:00
|
|
|
re->r.scemode &= ~R_FULL_SAMPLE;
|
|
|
|
else
|
2012-06-13 17:23:44 +00:00
|
|
|
re->r.osa = re->osa = source->osa;
|
2010-01-06 00:09:07 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* check state variables, osa? */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->r.mode & (R_OSA)) {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->osa = re->r.osa;
|
|
|
|
if (re->osa > 16) re->osa = 16;
|
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
|
|
|
}
|
2012-06-13 17:23:44 +00:00
|
|
|
else re->osa = 0;
|
2010-01-06 00:09:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (srl) {
|
2014-02-26 18:44:32 +01:00
|
|
|
int index = BLI_findindex(&rd->layers, srl);
|
2010-01-06 00:09:07 +00:00
|
|
|
if (index != -1) {
|
|
|
|
re->r.actlay = index;
|
2010-03-26 10:41:48 +00:00
|
|
|
re->r.scemode |= R_SINGLE_LAYER;
|
2008-02-11 11:00:09 +00:00
|
|
|
}
|
2010-01-06 00:09:07 +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
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
/* always call, checks for gamma, gamma tables and jitter too */
|
2012-10-21 05:46:41 +00:00
|
|
|
make_sample_tables(re);
|
2010-01-06 00:09:07 +00:00
|
|
|
|
|
|
|
/* if preview render, we try to keep old result */
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2013-05-15 17:09:45 +00:00
|
|
|
if (re->r.scemode & (R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW)) {
|
2013-04-24 19:21:16 +00:00
|
|
|
if (had_freestyle || (re->r.mode & R_EDGE_FRS)) {
|
|
|
|
/* freestyle manipulates render layers so always have to free */
|
|
|
|
render_result_free(re->result);
|
|
|
|
re->result = NULL;
|
|
|
|
}
|
|
|
|
else if (re->result) {
|
2014-02-26 17:29:50 +01:00
|
|
|
SceneRenderLayer *actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
|
|
|
RenderLayer *rl;
|
|
|
|
bool have_layer = false;
|
|
|
|
|
|
|
|
for (rl = re->result->layers.first; rl; rl = rl->next)
|
|
|
|
if (STREQ(rl->name, actsrl->name))
|
|
|
|
have_layer = true;
|
|
|
|
|
2014-02-21 15:10:47 +01:00
|
|
|
if (re->result->rectx == re->rectx && re->result->recty == re->recty &&
|
2014-02-26 17:29:50 +01:00
|
|
|
have_layer)
|
2014-02-22 11:14:15 +11:00
|
|
|
{
|
2013-04-24 19:21:16 +00:00
|
|
|
/* keep render result, this avoids flickering black tiles
|
|
|
|
* when the preview changes */
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* free because resolution changed */
|
|
|
|
render_result_free(re->result);
|
|
|
|
re->result = NULL;
|
|
|
|
}
|
|
|
|
}
|
2010-01-06 00:09:07 +00:00
|
|
|
}
|
|
|
|
else {
|
2006-12-28 11:14:08 +00:00
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
/* make empty render result, so display callbacks can initialize */
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->result = MEM_callocN(sizeof(RenderResult), "new render result");
|
|
|
|
re->result->rectx = re->rectx;
|
|
|
|
re->result->recty = re->recty;
|
2015-04-28 17:36:44 -03:00
|
|
|
render_result_view_new(re->result, "new temporary view");
|
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
|
|
|
}
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
|
2014-07-07 10:50:43 +02:00
|
|
|
if (re->r.scemode & R_VIEWPORT_PREVIEW)
|
|
|
|
re->eval_ctx->mode = DAG_EVAL_PREVIEW;
|
|
|
|
else
|
|
|
|
re->eval_ctx->mode = DAG_EVAL_RENDER;
|
|
|
|
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
/* ensure renderdatabase can use part settings correct */
|
|
|
|
RE_parts_clamp(re);
|
2010-01-06 00:09:07 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
2010-06-27 05:39:55 +00:00
|
|
|
re->mblur_offs = re->field_offs = 0.f;
|
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
RE_init_threadcount(re);
|
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
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* This function is only called by view3d rendering, which doesn't support
|
|
|
|
* multiview at the moment. so handle only one view here */
|
2014-06-19 16:21:17 +06:00
|
|
|
static void render_result_rescale(Render *re)
|
|
|
|
{
|
|
|
|
RenderResult *result = re->result;
|
2015-04-29 11:26:30 -03:00
|
|
|
RenderView *rv;
|
2014-06-19 16:21:17 +06:00
|
|
|
int x, y;
|
|
|
|
float scale_x, scale_y;
|
|
|
|
float *src_rectf;
|
|
|
|
|
2015-04-29 11:26:30 -03:00
|
|
|
rv = RE_RenderViewGetById(result, 0);
|
|
|
|
src_rectf = rv->rectf;
|
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
if (src_rectf == NULL) {
|
|
|
|
RenderLayer *rl = render_get_active_layer(re, re->result);
|
|
|
|
if (rl != NULL) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
src_rectf = RE_RenderLayerGetPass(rl, RE_PASSNAME_COMBINED, NULL);
|
2014-06-19 16:21:17 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_rectf != NULL) {
|
|
|
|
float *dst_rectf = NULL;
|
|
|
|
re->result = render_result_new(re,
|
|
|
|
&re->disprect,
|
|
|
|
0,
|
|
|
|
RR_USE_MEM,
|
2015-04-06 10:40:12 -03:00
|
|
|
RR_ALL_LAYERS,
|
|
|
|
"");
|
2014-06-19 16:21:17 +06:00
|
|
|
|
2014-09-29 20:51:00 +06:00
|
|
|
if (re->result != NULL) {
|
2015-04-29 11:26:30 -03:00
|
|
|
dst_rectf = RE_RenderViewGetById(re->result, 0)->rectf;
|
2014-09-29 20:51:00 +06:00
|
|
|
if (dst_rectf == NULL) {
|
|
|
|
RenderLayer *rl;
|
|
|
|
rl = render_get_active_layer(re, re->result);
|
|
|
|
if (rl != NULL) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
dst_rectf = RE_RenderLayerGetPass(rl, RE_PASSNAME_COMBINED, NULL);
|
2014-09-29 20:51:00 +06:00
|
|
|
}
|
2014-06-19 16:21:17 +06:00
|
|
|
}
|
|
|
|
|
2014-09-29 20:51:00 +06:00
|
|
|
scale_x = (float) result->rectx / re->result->rectx;
|
|
|
|
scale_y = (float) result->recty / re->result->recty;
|
|
|
|
for (x = 0; x < re->result->rectx; ++x) {
|
|
|
|
for (y = 0; y < re->result->recty; ++y) {
|
2015-02-11 18:38:41 +11:00
|
|
|
int src_x = x * scale_x;
|
|
|
|
int src_y = y * scale_y;
|
|
|
|
int dst_index = y * re->result->rectx + x;
|
|
|
|
int src_index = src_y * result->rectx + src_x;
|
2014-09-29 20:51:00 +06:00
|
|
|
copy_v4_v4(dst_rectf + dst_index * 4,
|
|
|
|
src_rectf + src_index * 4);
|
|
|
|
}
|
2014-06-19 16:21:17 +06:00
|
|
|
}
|
|
|
|
}
|
2015-04-10 12:32:19 +02:00
|
|
|
render_result_free(result);
|
2014-06-19 16:21:17 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RE_ChangeResolution(Render *re, int winx, int winy, rcti *disprect)
|
|
|
|
{
|
|
|
|
re_init_resolution(re, NULL, winx, winy, disprect);
|
2014-08-20 15:30:31 +06:00
|
|
|
RE_parts_clamp(re);
|
2014-06-19 16:21:17 +06:00
|
|
|
|
2014-07-09 17:57:32 +06:00
|
|
|
if (re->result) {
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_rescale(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
2014-06-19 16:21:17 +06:00
|
|
|
}
|
|
|
|
|
2014-08-19 19:36:49 +06:00
|
|
|
/* TODO(sergey): This is a bit hackish, used to temporary disable freestyle when
|
|
|
|
* doing viewport render. Needs some better integration of BI viewport rendering
|
|
|
|
* into the pipeline.
|
|
|
|
*/
|
|
|
|
void RE_ChangeModeFlag(Render *re, int flag, bool clear)
|
|
|
|
{
|
|
|
|
if (clear) {
|
|
|
|
re->r.mode &= ~flag;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
re->r.mode |= flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-05 15:47:52 +00:00
|
|
|
/* update some variables that can be animated, and otherwise wouldn't be due to
|
|
|
|
* RenderData getting copied once at the start of animation render */
|
2014-06-23 14:25:52 +06:00
|
|
|
void render_update_anim_renderdata(Render *re, RenderData *rd)
|
2013-09-05 15:47:52 +00:00
|
|
|
{
|
|
|
|
/* filter */
|
|
|
|
re->r.gauss = rd->gauss;
|
|
|
|
|
|
|
|
/* motion blur */
|
|
|
|
re->r.mblur_samples = rd->mblur_samples;
|
|
|
|
re->r.blurfac = rd->blurfac;
|
|
|
|
|
|
|
|
/* freestyle */
|
|
|
|
re->r.line_thickness_mode = rd->line_thickness_mode;
|
|
|
|
re->r.unit_line_thickness = rd->unit_line_thickness;
|
2014-04-29 13:10:40 +02:00
|
|
|
|
|
|
|
/* render layers */
|
|
|
|
BLI_freelistN(&re->r.layers);
|
|
|
|
BLI_duplicatelist(&re->r.layers, &rd->layers);
|
2015-05-13 01:00:03 -03:00
|
|
|
|
|
|
|
/* render views */
|
|
|
|
BLI_freelistN(&re->r.views);
|
|
|
|
BLI_duplicatelist(&re->r.views, &rd->views);
|
2013-09-05 15:47:52 +00:00
|
|
|
}
|
|
|
|
|
2016-07-19 08:39:38 +10:00
|
|
|
void RE_SetWindow(Render *re, const rctf *viewplane, float clipsta, float clipend)
|
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
|
|
|
{
|
|
|
|
/* re->ok flag? */
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->viewplane = *viewplane;
|
|
|
|
re->clipsta = clipsta;
|
|
|
|
re->clipend = clipend;
|
2006-06-20 15:55:49 +00:00
|
|
|
re->r.mode &= ~R_ORTHO;
|
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
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
perspective_m4(re->winmat,
|
|
|
|
re->viewplane.xmin, re->viewplane.xmax,
|
|
|
|
re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
|
2006-12-28 11:14:08 +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
|
|
|
}
|
|
|
|
|
2016-07-19 08:39:38 +10:00
|
|
|
void RE_SetOrtho(Render *re, const rctf *viewplane, float clipsta, float clipend)
|
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
|
|
|
{
|
|
|
|
/* re->ok flag? */
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->viewplane = *viewplane;
|
|
|
|
re->clipsta = clipsta;
|
|
|
|
re->clipend = clipend;
|
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
|
|
|
re->r.mode |= R_ORTHO;
|
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
orthographic_m4(re->winmat,
|
|
|
|
re->viewplane.xmin, re->viewplane.xmax,
|
|
|
|
re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
|
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
|
|
|
}
|
|
|
|
|
2012-12-11 14:29:01 +00:00
|
|
|
void RE_SetView(Render *re, float mat[4][4])
|
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
|
|
|
{
|
|
|
|
/* re->ok flag? */
|
2009-11-10 20:43:45 +00:00
|
|
|
copy_m4_m4(re->viewmat, mat);
|
|
|
|
invert_m4_m4(re->viewinv, re->viewmat);
|
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
|
|
|
}
|
|
|
|
|
2016-07-19 08:39:38 +10:00
|
|
|
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
{
|
2016-07-19 08:39:38 +10:00
|
|
|
*r_viewplane = re->viewplane;
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
|
|
|
|
/* make disprect zero when no border render, is needed to detect changes in 3d view render */
|
2016-07-19 08:39:38 +10:00
|
|
|
if (re->r.mode & R_BORDER) {
|
|
|
|
*r_disprect = re->disprect;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BLI_rcti_init(r_disprect, 0, 0, 0, 0);
|
|
|
|
}
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RE_GetView(Render *re, float mat[4][4])
|
|
|
|
{
|
|
|
|
copy_m4_m4(mat, re->viewmat);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* image and movie output has to move to either imbuf or kernel */
|
2009-09-18 22:25:49 +00:00
|
|
|
void RE_display_init_cb(Render *re, void *handle, void (*f)(void *handle, RenderResult *rr))
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->display_init = f;
|
|
|
|
re->dih = handle;
|
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
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
void RE_display_clear_cb(Render *re, void *handle, void (*f)(void *handle, RenderResult *rr))
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->display_clear = f;
|
|
|
|
re->dch = handle;
|
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
|
|
|
}
|
2013-12-17 23:42:38 +06:00
|
|
|
void RE_display_update_cb(Render *re, void *handle, void (*f)(void *handle, RenderResult *rr, volatile rcti *rect))
|
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
|
|
|
{
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update = f;
|
|
|
|
re->duh = handle;
|
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
|
|
|
}
|
2014-05-02 14:52:19 +02:00
|
|
|
void RE_current_scene_update_cb(Render *re, void *handle, void (*f)(void *handle, Scene *scene))
|
|
|
|
{
|
|
|
|
re->current_scene_update = f;
|
|
|
|
re->suh = handle;
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
void RE_stats_draw_cb(Render *re, void *handle, void (*f)(void *handle, RenderStats *rs))
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->stats_draw = f;
|
|
|
|
re->sdh = handle;
|
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
|
|
|
}
|
2010-05-27 08:22:16 +00:00
|
|
|
void RE_progress_cb(Render *re, void *handle, void (*f)(void *handle, float))
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->progress = f;
|
|
|
|
re->prh = handle;
|
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-03-27 23:11:22 +00:00
|
|
|
void RE_draw_lock_cb(Render *re, void *handle, void (*f)(void *handle, int i))
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->draw_lock = f;
|
2013-06-25 07:22:28 +00:00
|
|
|
re->dlh = handle;
|
2011-03-27 23:11:22 +00:00
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle))
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->test_break = f;
|
|
|
|
re->tbh = handle;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ********* add object data (later) ******** */
|
|
|
|
|
|
|
|
/* object is considered fully prepared on correct time etc */
|
|
|
|
/* includes lights */
|
2011-09-16 08:20:21 +00:00
|
|
|
#if 0
|
2010-10-16 14:32:17 +00:00
|
|
|
void RE_AddObject(Render *UNUSED(re), Object *UNUSED(ob))
|
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-09-16 08:20:21 +00:00
|
|
|
#endif
|
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
|
|
|
|
Three-in-one commit:
- Compositor now is threaded
Enable it with the Scene buttons "Threads". This will handle over nodes to
individual threads to be calculated. However, if nodes depend on others
they have to wait. The current system only threads per entire node, not for
calculating results in parts.
I've reshuffled the node execution code to evaluate 'changed' events, and
prepare the entire tree to become simply parsed for open jobs with a call
to node = getExecutableNode()
By default, even without 'thread' option active, all node execution is
done within a separate thread.
Also fixed issues in yesterdays commit for 'event based' calculations, it
didn't do animated images, or execute (on rendering) the correct nodes
when you don't have Render-Result nodes included.
- Added generic Thread support in blenlib/ module
The renderer and the node system now both use same code for controlling the
threads. This has been moved to a new C file in blenlib/intern/threads.c.
Check this c file for an extensive doc and example how to use it.
The current implementation for Compositing allows unlimited amount of
threads. For rendering it is still tied to two threads, although it is
pretty easy to extend to 4 already. People with giant amounts of cpus can
poke me once for tests. :)
- Bugfix in creating group nodes
Group node definitions demand a clear separation of 'internal sockets' and
'external sockets'. The first are sockets being linked internally, the latter
are sockets exposed as sockets for the group itself.
When sockets were linked both internal and external, Blender crashed. It is
solved now by removing the external link(s).
2006-01-29 11:36:33 +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
|
|
|
|
2013-12-17 23:42:38 +06:00
|
|
|
static int render_display_update_enabled(Render *re)
|
2007-05-09 16:25:58 +00:00
|
|
|
{
|
|
|
|
/* don't show preprocess for previewrender sss */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->sss_points)
|
2013-05-15 17:09:45 +00:00
|
|
|
return !(re->r.scemode & (R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW));
|
2007-05-09 16:25:58 +00:00
|
|
|
else
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-01-28 16:33:59 +00:00
|
|
|
/* the main thread call, renders an entire part */
|
2006-02-25 11:56:08 +00:00
|
|
|
static void *do_part_thread(void *pa_v)
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
RenderPart *pa = pa_v;
|
2013-01-01 16:15:13 +00:00
|
|
|
|
|
|
|
pa->status = PART_STATUS_IN_PROGRESS;
|
|
|
|
|
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
|
|
|
/* need to return nicely all parts on esc */
|
2012-06-13 17:23:44 +00:00
|
|
|
if (R.test_break(R.tbh) == 0) {
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!R.sss_points && (R.r.scemode & R_FULL_SAMPLE))
|
2015-04-06 10:40:12 -03:00
|
|
|
pa->result = render_result_new_full_sample(&R, &pa->fullresult, &pa->disprect, pa->crop, RR_USE_MEM, R.viewname);
|
2008-01-28 16:33:59 +00:00
|
|
|
else
|
2015-04-06 10:40:12 -03:00
|
|
|
pa->result = render_result_new(&R, &pa->disprect, pa->crop, RR_USE_MEM, RR_ALL_LAYERS, R.viewname);
|
2007-05-03 21:37:52 +00:00
|
|
|
|
2014-03-11 19:55:22 +06:00
|
|
|
/* Copy EXR tile settings, so pipeline knows whether this is a result
|
|
|
|
* for Save Buffers enabled rendering.
|
|
|
|
*
|
|
|
|
* TODO(sergey): This actually duplicates logic with external engine, so
|
|
|
|
* worth looking into more generic solution.
|
|
|
|
*/
|
|
|
|
pa->result->do_exr_tile = R.result->do_exr_tile;
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (R.sss_points)
|
2007-05-03 21:37:52 +00:00
|
|
|
zbufshade_sss_tile(pa);
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (R.osa)
|
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
|
|
|
zbufshadeDA_tile(pa);
|
|
|
|
else
|
|
|
|
zbufshade_tile(pa);
|
2006-01-31 21:49:05 +00:00
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
/* we do actually write pixels, but don't allocate/deallocate anything,
|
|
|
|
* so it is safe with other threads reading at the same time */
|
|
|
|
BLI_rw_mutex_lock(&R.resultmutex, THREAD_LOCK_READ);
|
|
|
|
|
Work in progress commit on saving OpenEXR with all render-layers and
passes in single file. Code is currently disabled, commit is mainly to
have a nicer method of excluding OpenEXR dependency from render module.
This should compile with disabled WITH_OPENEXR too.
Reason why EXR is great to include by default in Blender is its feature
to store unlimited layers and channels, and write this tile based. I
need the feature for saving memory; while rendering tiles, all full-size
buffers for all layers and passes are kept in memory now, which can go
into 100s of MB easily.
The code I commit now doesn't allocate these buffers while rendering, but
saves the tiles to disk. In the end is it read back. Overhead for large
renders (like 300 meg buffers) is 10-15 seconds, not bad.
Two more interesting aspects:
- Blender can save such multi-layer files in the temp directory, storing
it with .blend file name and scene name. That way, on each restart of Blender,
or on switching scenes, these buffers can be read. So you always see what was
rendered last. Also great for compositing work.
- This can also become an output image type for rendering. There's plenty of
cases where you want specific layers or passes saved to disk for later use.
Anyhoo, finishing it is another days of work, and I got more urgent stuff
now!
2006-02-23 20:57:31 +00:00
|
|
|
/* merge too on break! */
|
2012-09-04 13:29:07 +00:00
|
|
|
if (R.result->do_exr_tile) {
|
2015-04-06 10:40:12 -03:00
|
|
|
render_result_exr_file_merge(R.result, pa->result, R.viewname);
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
2013-12-17 23:42:38 +06:00
|
|
|
else if (render_display_update_enabled(&R)) {
|
2009-09-18 22:25:49 +00:00
|
|
|
/* on break, don't merge in result for preview renders, looks nicer */
|
2013-05-15 17:09:45 +00:00
|
|
|
if (R.test_break(R.tbh) && (R.r.scemode & (R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))) {
|
2012-10-07 09:48:59 +00:00
|
|
|
/* pass */
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
render_result_merge(R.result, pa->result);
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&R.resultmutex);
|
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
|
|
|
}
|
|
|
|
|
2017-11-02 14:29:42 +01:00
|
|
|
pa->status = PART_STATUS_MERGED;
|
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
|
|
|
|
2006-02-25 11:56:08 +00:00
|
|
|
return NULL;
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
/* calculus for how much 1 pixel rendered should rotate the 3d geometry */
|
|
|
|
/* is not that simple, needs to be corrected for errors of larger viewplane sizes */
|
2012-11-21 10:20:38 +00:00
|
|
|
/* called in initrender.c, RE_parts_init() and convertblender.c, for speedvectors */
|
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
|
|
|
float panorama_pixel_rot(Render *re)
|
|
|
|
{
|
|
|
|
float psize, phi, xfac;
|
2012-09-23 18:50:56 +00:00
|
|
|
float borderfac = (float)BLI_rcti_size_x(&re->disprect) / (float)re->winx;
|
2012-11-05 08:05:14 +00:00
|
|
|
int xparts = (re->rectx + re->partx - 1) / re->partx;
|
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
|
|
|
|
|
|
|
/* size of 1 pixel mapped to viewplane coords */
|
2012-09-23 18:50:56 +00:00
|
|
|
psize = BLI_rctf_size_x(&re->viewplane) / (float)re->winx;
|
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
|
|
|
/* angle of a pixel */
|
2012-06-13 17:23:44 +00:00
|
|
|
phi = atan(psize / re->clipsta);
|
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
|
|
|
|
|
|
|
/* correction factor for viewplane shifting, first calculate how much the viewplane angle is */
|
2012-11-05 08:05:14 +00:00
|
|
|
xfac = borderfac * BLI_rctf_size_x(&re->viewplane) / (float)xparts;
|
2012-06-13 17:23:44 +00:00
|
|
|
xfac = atan(0.5f * xfac / re->clipsta);
|
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
|
|
|
/* and how much the same viewplane angle is wrapped */
|
2012-06-13 17:23:44 +00:00
|
|
|
psize = 0.5f * phi * ((float)re->partx);
|
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
|
|
|
|
|
|
|
/* the ratio applied to final per-pixel angle */
|
2012-06-13 17:23:44 +00:00
|
|
|
phi *= xfac / psize;
|
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
|
|
|
|
|
|
|
return phi;
|
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
/* for panorama, we render per Y slice, and update
|
|
|
|
* camera parameters when we go the next slice */
|
|
|
|
static bool find_next_pano_slice(Render *re, int *slice, int *minx, rctf *viewplane)
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
RenderPart *pa, *best = NULL;
|
2013-02-21 18:08:07 +00:00
|
|
|
bool found = false;
|
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
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
*minx = re->winx;
|
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
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
if (!(re->r.mode & R_PANORAMA)) {
|
|
|
|
/* for regular render, just one 'slice' */
|
|
|
|
found = (*slice == 0);
|
|
|
|
(*slice)++;
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* most left part of the non-rendering parts */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (pa = re->parts.first; pa; pa = pa->next) {
|
2013-01-01 16:15:13 +00:00
|
|
|
if (pa->status == PART_STATUS_NONE && pa->nr == 0) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (pa->disprect.xmin < *minx) {
|
2013-02-21 18:08:07 +00:00
|
|
|
found = true;
|
2012-06-13 17:23:44 +00:00
|
|
|
best = pa;
|
|
|
|
*minx = pa->disprect.xmin;
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-02-21 18:08:07 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (best) {
|
2012-06-13 17:23:44 +00:00
|
|
|
float phi = panorama_pixel_rot(re);
|
2010-12-16 12:49:48 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
R.panodxp = (re->winx - (best->disprect.xmin + best->disprect.xmax) ) / 2;
|
2012-09-23 18:50:56 +00:00
|
|
|
R.panodxv = (BLI_rctf_size_x(viewplane) * R.panodxp) / (float)(re->winx);
|
2012-12-20 07:57:26 +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
|
|
|
/* shift viewplane */
|
|
|
|
R.viewplane.xmin = viewplane->xmin + R.panodxv;
|
|
|
|
R.viewplane.xmax = viewplane->xmax + R.panodxv;
|
|
|
|
RE_SetWindow(re, &R.viewplane, R.clipsta, R.clipend);
|
2009-11-10 20:43:45 +00:00
|
|
|
copy_m4_m4(R.winmat, re->winmat);
|
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
|
|
|
|
|
|
|
/* rotate database according to part coordinates */
|
2012-06-13 17:23:44 +00:00
|
|
|
project_renderdata(re, projectverto, 1, -R.panodxp * phi, 1);
|
2014-09-17 14:11:37 +10:00
|
|
|
R.panosi = sinf(R.panodxp * phi);
|
|
|
|
R.panoco = cosf(R.panodxp * phi);
|
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
|
|
|
}
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
(*slice)++;
|
|
|
|
|
|
|
|
return found;
|
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
|
|
|
}
|
|
|
|
|
2015-05-28 17:01:09 +02:00
|
|
|
typedef struct SortRenderPart {
|
|
|
|
RenderPart *pa;
|
|
|
|
long long int dist;
|
|
|
|
} SortRenderPart;
|
|
|
|
|
|
|
|
static int sort_render_part(const void *pa1, const void *pa2) {
|
|
|
|
const SortRenderPart *rpa1 = pa1;
|
|
|
|
const SortRenderPart *rpa2 = pa2;
|
|
|
|
|
|
|
|
if (rpa1->dist > rpa2->dist) return 1;
|
|
|
|
else if (rpa1->dist < rpa2->dist) return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sort_and_queue_parts(Render *re, int minx, ThreadQueue *workqueue)
|
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
|
|
|
{
|
2015-05-28 17:01:09 +02:00
|
|
|
RenderPart *pa;
|
2010-10-27 10:36:22 +00:00
|
|
|
|
|
|
|
/* long long int's needed because of overflow [#24414] */
|
2012-06-13 17:23:44 +00:00
|
|
|
long long int centx = re->winx / 2, centy = re->winy / 2, tot = 1;
|
2015-05-28 17:01:09 +02:00
|
|
|
int totsort = 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
|
|
|
|
|
|
|
/* find center of rendered parts, image center counts for 1 too */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (pa = re->parts.first; pa; pa = pa->next) {
|
2017-11-02 14:29:42 +01:00
|
|
|
if (pa->status >= PART_STATUS_RENDERED) {
|
2012-09-23 18:50:56 +00:00
|
|
|
centx += BLI_rcti_cent_x(&pa->disprect);
|
|
|
|
centy += BLI_rcti_cent_y(&pa->disprect);
|
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
|
|
|
tot++;
|
|
|
|
}
|
2015-05-28 17:01:09 +02:00
|
|
|
else if (pa->status == PART_STATUS_NONE && pa->nr == 0) {
|
|
|
|
if (!(re->r.mode & R_PANORAMA) || pa->disprect.xmin == minx) {
|
|
|
|
totsort++;
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
}
|
2012-06-13 17:23:44 +00:00
|
|
|
centx /= tot;
|
|
|
|
centy /= tot;
|
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
|
|
|
|
2015-05-28 17:01:09 +02:00
|
|
|
if (totsort > 0) {
|
|
|
|
SortRenderPart *sortlist = MEM_mallocN(sizeof(*sortlist) * totsort, "renderpartsort");
|
|
|
|
long int i = 0;
|
|
|
|
|
|
|
|
/* prepare the list */
|
|
|
|
for (pa = re->parts.first; pa; pa = pa->next) {
|
|
|
|
if (pa->status == PART_STATUS_NONE && pa->nr == 0) {
|
|
|
|
if (!(re->r.mode & R_PANORAMA) || pa->disprect.xmin == minx) {
|
|
|
|
long long int distx = centx - BLI_rcti_cent_x(&pa->disprect);
|
|
|
|
long long int disty = centy - BLI_rcti_cent_y(&pa->disprect);
|
|
|
|
sortlist[i].dist = (long long int)sqrt(distx * distx + disty * disty);
|
|
|
|
sortlist[i].pa = pa;
|
|
|
|
i++;
|
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
|
|
|
}
|
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
|
|
|
}
|
|
|
|
}
|
2015-05-28 17:01:09 +02:00
|
|
|
|
|
|
|
/* Now sort it */
|
|
|
|
qsort(sortlist, totsort, sizeof(*sortlist), sort_render_part);
|
|
|
|
|
|
|
|
/* Finally flush it to the workqueue */
|
|
|
|
for (i = 0; i < totsort; i++) {
|
|
|
|
pa = sortlist[i].pa;
|
|
|
|
pa->nr = i + 1; /* for nicest part, and for stats */
|
|
|
|
BLI_thread_queue_push(workqueue, pa);
|
|
|
|
}
|
|
|
|
|
|
|
|
MEM_freeN(sortlist);
|
|
|
|
|
|
|
|
return totsort;
|
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
|
|
|
}
|
2015-05-28 17:01:09 +02:00
|
|
|
|
|
|
|
return 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
|
|
|
}
|
|
|
|
|
2006-02-12 21:57:56 +00:00
|
|
|
static void print_part_stats(Render *re, RenderPart *pa)
|
|
|
|
{
|
|
|
|
char str[64];
|
|
|
|
|
2013-03-10 16:55:01 +00:00
|
|
|
BLI_snprintf(str, sizeof(str), IFACE_("%s, Part %d-%d"), re->scene->id.name + 2, pa->nr, re->i.totpart);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.infostr = str;
|
2009-09-18 22:25:49 +00:00
|
|
|
re->stats_draw(re->sdh, &re->i);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.infostr = NULL;
|
2006-02-12 21:57:56 +00:00
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
typedef struct RenderThread {
|
|
|
|
ThreadQueue *workqueue;
|
|
|
|
ThreadQueue *donequeue;
|
|
|
|
|
|
|
|
int number;
|
2013-12-17 23:42:38 +06:00
|
|
|
|
|
|
|
void (*display_update)(void *handle, RenderResult *rr, volatile rcti *rect);
|
|
|
|
void *duh;
|
2013-02-21 18:08:07 +00:00
|
|
|
} RenderThread;
|
|
|
|
|
|
|
|
static void *do_render_thread(void *thread_v)
|
|
|
|
{
|
|
|
|
RenderThread *thread = thread_v;
|
|
|
|
RenderPart *pa;
|
|
|
|
|
|
|
|
while ((pa = BLI_thread_queue_pop(thread->workqueue))) {
|
|
|
|
pa->thread = thread->number;
|
|
|
|
do_part_thread(pa);
|
2013-12-17 23:42:38 +06:00
|
|
|
|
|
|
|
if (thread->display_update) {
|
|
|
|
thread->display_update(thread->duh, pa->result, NULL);
|
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
BLI_thread_queue_push(thread->donequeue, pa);
|
|
|
|
|
2013-03-24 12:13:13 +00:00
|
|
|
if (R.test_break(R.tbh))
|
2013-02-21 18:08:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
static void main_render_result_end(Render *re)
|
|
|
|
{
|
|
|
|
if (re->result->do_exr_tile) {
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_exr_file_end(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (re->r.scemode & R_EXR_CACHE_FILE) {
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_exr_file_cache_write(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void main_render_result_new(Render *re)
|
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
|
|
|
{
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
|
2008-01-28 16:33:59 +00:00
|
|
|
/* first step; free the entire render result, make new, and/or prepare exr buffer saving */
|
2013-05-15 17:09:45 +00:00
|
|
|
if (re->result == NULL || !(re->r.scemode & (R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))) {
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
2013-02-21 18:08:07 +00:00
|
|
|
|
2013-12-17 23:42:38 +06:00
|
|
|
if (re->sss_points && render_display_update_enabled(re))
|
2015-04-06 10:40:12 -03:00
|
|
|
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (re->r.scemode & R_FULL_SAMPLE)
|
2015-04-06 10:40:12 -03:00
|
|
|
re->result = render_result_new_full_sample(re, &re->fullresult, &re->disprect, 0, RR_USE_EXR, RR_ALL_VIEWS);
|
2009-09-18 22:25:49 +00:00
|
|
|
else
|
2012-06-13 17:23:44 +00:00
|
|
|
re->result = render_result_new(re, &re->disprect, 0,
|
2015-04-06 10:40:12 -03:00
|
|
|
(re->r.scemode & R_EXR_TILE_FILE) ? RR_USE_EXR : RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2009-09-30 18:18:32 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-09-09 19:42:49 +10:00
|
|
|
if (re->result) {
|
|
|
|
if (re->result->do_exr_tile) {
|
|
|
|
render_result_exr_file_begin(re);
|
|
|
|
}
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void threaded_tile_processor(Render *re)
|
|
|
|
{
|
|
|
|
RenderThread thread[BLENDER_MAX_THREADS];
|
|
|
|
ThreadQueue *workqueue, *donequeue;
|
|
|
|
ListBase threads;
|
|
|
|
RenderPart *pa;
|
|
|
|
rctf viewplane = re->viewplane;
|
|
|
|
double lastdraw, elapsed, redrawtime = 1.0f;
|
|
|
|
int totpart = 0, minx = 0, slice = 0, a, wait;
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->result == NULL)
|
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
|
|
|
return;
|
2012-12-31 13:52:13 +00:00
|
|
|
|
2006-06-26 14:57:56 +00:00
|
|
|
/* warning; no return here without closing exr file */
|
2014-04-01 11:34:00 +11:00
|
|
|
RE_parts_init(re, true);
|
Work in progress commit on saving OpenEXR with all render-layers and
passes in single file. Code is currently disabled, commit is mainly to
have a nicer method of excluding OpenEXR dependency from render module.
This should compile with disabled WITH_OPENEXR too.
Reason why EXR is great to include by default in Blender is its feature
to store unlimited layers and channels, and write this tile based. I
need the feature for saving memory; while rendering tiles, all full-size
buffers for all layers and passes are kept in memory now, which can go
into 100s of MB easily.
The code I commit now doesn't allocate these buffers while rendering, but
saves the tiles to disk. In the end is it read back. Overhead for large
renders (like 300 meg buffers) is 10-15 seconds, not bad.
Two more interesting aspects:
- Blender can save such multi-layer files in the temp directory, storing
it with .blend file name and scene name. That way, on each restart of Blender,
or on switching scenes, these buffers can be read. So you always see what was
rendered last. Also great for compositing work.
- This can also become an output image type for rendering. There's plenty of
cases where you want specific layers or passes saved to disk for later use.
Anyhoo, finishing it is another days of work, and I got more urgent stuff
now!
2006-02-23 20:57:31 +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
|
|
|
/* assuming no new data gets added to dbase... */
|
2012-06-13 17:23:44 +00:00
|
|
|
R = *re;
|
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
|
|
|
|
2006-02-11 15:55:00 +00:00
|
|
|
/* set threadsafe break */
|
2012-06-13 17:23:44 +00:00
|
|
|
R.test_break = thread_break;
|
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
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
/* create and fill work queue */
|
|
|
|
workqueue = BLI_thread_queue_init();
|
|
|
|
donequeue = BLI_thread_queue_init();
|
2006-02-08 10:57:48 +00:00
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
/* for panorama we loop over slices */
|
|
|
|
while (find_next_pano_slice(re, &slice, &minx, &viewplane)) {
|
|
|
|
/* gather parts into queue */
|
2015-05-28 17:01:09 +02:00
|
|
|
totpart = sort_and_queue_parts(re, minx, workqueue);
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
BLI_thread_queue_nowait(workqueue);
|
|
|
|
|
|
|
|
/* start all threads */
|
|
|
|
BLI_init_threads(&threads, do_render_thread, re->r.threads);
|
|
|
|
|
|
|
|
for (a = 0; a < re->r.threads; a++) {
|
|
|
|
thread[a].workqueue = workqueue;
|
|
|
|
thread[a].donequeue = donequeue;
|
|
|
|
thread[a].number = a;
|
2013-12-31 15:00:00 +01:00
|
|
|
|
2013-12-17 23:42:38 +06:00
|
|
|
if (render_display_update_enabled(re)) {
|
|
|
|
thread[a].display_update = re->display_update;
|
|
|
|
thread[a].duh = re->duh;
|
|
|
|
}
|
2013-12-31 15:00:00 +01:00
|
|
|
else {
|
|
|
|
thread[a].display_update = NULL;
|
|
|
|
thread[a].duh = NULL;
|
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
BLI_insert_thread(&threads, &thread[a]);
|
2006-01-31 21:49:05 +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
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
/* wait for results to come back */
|
|
|
|
lastdraw = PIL_check_seconds_timer();
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
elapsed = PIL_check_seconds_timer() - lastdraw;
|
|
|
|
wait = (redrawtime - elapsed)*1000;
|
|
|
|
|
|
|
|
/* handle finished part */
|
|
|
|
if ((pa=BLI_thread_queue_pop_timeout(donequeue, wait))) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (pa->result) {
|
2006-02-12 21:57:56 +00:00
|
|
|
print_part_stats(re, pa);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free_list(&pa->fullresult, pa->result);
|
2012-06-13 17:23:44 +00:00
|
|
|
pa->result = NULL;
|
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
|
|
|
re->i.partsdone++;
|
2010-05-27 08:22:16 +00:00
|
|
|
re->progress(re->prh, re->i.partsdone / (float)re->i.totpart);
|
2006-01-31 21:49:05 +00:00
|
|
|
}
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
totpart--;
|
2006-01-31 21:49:05 +00:00
|
|
|
}
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
/* check for render cancel */
|
|
|
|
if ((g_break=re->test_break(re->tbh)))
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* or done with parts */
|
|
|
|
if (totpart == 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* redraw in progress parts */
|
|
|
|
elapsed = PIL_check_seconds_timer() - lastdraw;
|
|
|
|
if (elapsed > redrawtime) {
|
2013-12-17 23:42:38 +06:00
|
|
|
if (render_display_update_enabled(re))
|
2013-02-21 18:08:07 +00:00
|
|
|
for (pa = re->parts.first; pa; pa = pa->next)
|
|
|
|
if ((pa->status == PART_STATUS_IN_PROGRESS) && pa->nr && pa->result)
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update(re->duh, pa->result, &pa->result->renrect);
|
2013-02-21 18:08:07 +00:00
|
|
|
|
|
|
|
lastdraw = PIL_check_seconds_timer();
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
BLI_end_threads(&threads);
|
|
|
|
|
|
|
|
if ((g_break=re->test_break(re->tbh)))
|
|
|
|
break;
|
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
|
|
|
}
|
2013-03-04 12:40:24 +00:00
|
|
|
|
|
|
|
if (g_break) {
|
|
|
|
/* review the done queue and handle all the render parts,
|
|
|
|
* so no unfreed render result are lurking around
|
|
|
|
*/
|
|
|
|
BLI_thread_queue_nowait(donequeue);
|
|
|
|
while ((pa = BLI_thread_queue_pop(donequeue))) {
|
|
|
|
if (pa->result) {
|
|
|
|
render_result_free_list(&pa->fullresult, pa->result);
|
|
|
|
pa->result = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-21 18:08:07 +00:00
|
|
|
BLI_thread_queue_free(donequeue);
|
|
|
|
BLI_thread_queue_free(workqueue);
|
2015-06-17 17:48:15 +02:00
|
|
|
|
|
|
|
if (re->result->do_exr_tile) {
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_save_empty_result_tiles(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
|
Work in progress commit on saving OpenEXR with all render-layers and
passes in single file. Code is currently disabled, commit is mainly to
have a nicer method of excluding OpenEXR dependency from render module.
This should compile with disabled WITH_OPENEXR too.
Reason why EXR is great to include by default in Blender is its feature
to store unlimited layers and channels, and write this tile based. I
need the feature for saving memory; while rendering tiles, all full-size
buffers for all layers and passes are kept in memory now, which can go
into 100s of MB easily.
The code I commit now doesn't allocate these buffers while rendering, but
saves the tiles to disk. In the end is it read back. Overhead for large
renders (like 300 meg buffers) is 10-15 seconds, not bad.
Two more interesting aspects:
- Blender can save such multi-layer files in the temp directory, storing
it with .blend file name and scene name. That way, on each restart of Blender,
or on switching scenes, these buffers can be read. So you always see what was
rendered last. Also great for compositing work.
- This can also become an output image type for rendering. There's plenty of
cases where you want specific layers or passes saved to disk for later use.
Anyhoo, finishing it is another days of work, and I got more urgent stuff
now!
2006-02-23 20:57:31 +00:00
|
|
|
/* unset threadsafety */
|
2012-06-13 17:23:44 +00:00
|
|
|
g_break = 0;
|
2015-03-20 17:48:45 +05:00
|
|
|
BLI_rw_mutex_lock(&re->partsmutex, THREAD_LOCK_WRITE);
|
2012-11-21 10:20:38 +00:00
|
|
|
RE_parts_free(re);
|
2015-03-20 17:48:45 +05:00
|
|
|
BLI_rw_mutex_unlock(&re->partsmutex);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->viewplane = viewplane; /* restore viewplane, modified by pano render */
|
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
|
|
|
}
|
|
|
|
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2015-05-16 23:55:45 +09:00
|
|
|
static void init_freestyle(Render *re);
|
2013-06-11 02:32:01 +00:00
|
|
|
static void add_freestyle(Render *re, int render);
|
2013-04-18 08:58:21 +00:00
|
|
|
static void free_all_freestyle_renders(void);
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-19 17:50:53 +00:00
|
|
|
/* currently only called by preview renders and envmap */
|
2010-03-28 13:48:11 +00:00
|
|
|
void RE_TileProcessor(Render *re)
|
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
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
main_render_result_new(re);
|
2010-03-28 13:48:11 +00:00
|
|
|
threaded_tile_processor(re);
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
|
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
|
|
|
re->stats_draw(re->sdh, &re->i);
|
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
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2013-04-20 23:00:27 +00:00
|
|
|
/* Freestyle */
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
if (re->r.mode & R_EDGE_FRS) {
|
|
|
|
if (!re->test_break(re->tbh)) {
|
2015-05-16 23:55:45 +09:00
|
|
|
init_freestyle(re);
|
2013-06-11 02:32:01 +00:00
|
|
|
add_freestyle(re, 1);
|
2013-04-18 08:58:21 +00:00
|
|
|
free_all_freestyle_renders();
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
|
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
|
|
|
re->stats_draw(re->sdh, &re->i);
|
|
|
|
}
|
|
|
|
}
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2009-09-18 22:25:49 +00:00
|
|
|
|
Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.
When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)
- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
works for non-raytrace scenes, or zoom in ortho or camera mode, or for
Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
re-render yet.
Tech notes:
- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.
- Fixed some bugs that were noticable with such excessive re-renders, like
for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ************ This part uses API, for rendering Blender scenes ********** */
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
static void do_render_3d(Render *re)
|
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
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderView *rv;
|
2012-12-17 20:37:10 +00:00
|
|
|
|
2014-05-02 14:52:19 +02:00
|
|
|
re->current_scene_update(re->suh, re->scene);
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* try external */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (RE_engine_render(re, 0))
|
2009-09-18 22:25:49 +00:00
|
|
|
return;
|
2008-07-12 04:02:08 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* internal */
|
2012-11-21 10:20:38 +00:00
|
|
|
RE_parts_clamp(re);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-12-17 20:37:10 +00:00
|
|
|
/* add motion blur and fields offset to frames */
|
2016-01-16 13:06:16 +11:00
|
|
|
const int cfra_backup = re->scene->r.cfra;
|
|
|
|
const float subframe_backup = re->scene->r.subframe;
|
2012-12-17 20:37:10 +00:00
|
|
|
|
2016-02-10 13:59:57 +11:00
|
|
|
BKE_scene_frame_set(
|
|
|
|
re->scene, (double)re->scene->r.cfra + (double)re->scene->r.subframe +
|
|
|
|
(double)re->mblur_offs + (double)re->field_offs);
|
2012-12-17 20:37:10 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* init main render result */
|
|
|
|
main_render_result_new(re);
|
2016-03-03 13:21:04 +05:00
|
|
|
if (re->result == NULL) {
|
|
|
|
BKE_report(re->reports, RPT_ERROR, "Failed allocate render result, out of memory");
|
|
|
|
G.is_break = true;
|
|
|
|
return;
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-05-16 23:55:45 +09:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
if (re->r.mode & R_EDGE_FRS) {
|
|
|
|
init_freestyle(re);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* we need a new database for each view */
|
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
|
|
|
|
/* lock drawing in UI during data phase */
|
|
|
|
if (re->draw_lock)
|
|
|
|
re->draw_lock(re->dlh, 1);
|
|
|
|
|
|
|
|
/* make render verts/faces/halos/lamps */
|
|
|
|
if (render_scene_needs_vector(re))
|
|
|
|
RE_Database_FromScene_Vectors(re, re->main, re->scene, re->lay);
|
|
|
|
else {
|
|
|
|
RE_Database_FromScene(re, re->main, re->scene, re->lay, 1);
|
|
|
|
RE_Database_Preprocess(re);
|
|
|
|
}
|
2006-01-31 21:49:05 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* clear UI drawing locks */
|
|
|
|
if (re->draw_lock)
|
|
|
|
re->draw_lock(re->dlh, 0);
|
2011-03-27 23:11:22 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
threaded_tile_processor(re);
|
2015-06-17 18:02:02 +02:00
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2015-04-06 10:40:12 -03:00
|
|
|
/* Freestyle */
|
|
|
|
if (re->r.mode & R_EDGE_FRS)
|
|
|
|
if (!re->test_break(re->tbh))
|
|
|
|
add_freestyle(re, 1);
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2013-04-14 17:24:02 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* do left-over 3d post effects (flares) */
|
|
|
|
if (re->flag & R_HALO)
|
|
|
|
if (!re->test_break(re->tbh))
|
|
|
|
add_halo_flare(re);
|
|
|
|
|
|
|
|
/* free all render verts etc */
|
|
|
|
RE_Database_Free(re);
|
|
|
|
}
|
|
|
|
|
|
|
|
main_render_result_end(re);
|
|
|
|
|
2012-12-17 20:37:10 +00:00
|
|
|
re->scene->r.cfra = cfra_backup;
|
2016-01-16 13:06:16 +11:00
|
|
|
re->scene->r.subframe = subframe_backup;
|
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
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* called by blur loop, accumulate RGBA key alpha */
|
|
|
|
static void addblur_rect_key(RenderResult *rr, float *rectf, float *rectf1, float blurfac)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
float mfac = 1.0f - blurfac;
|
|
|
|
int a, b, stride = 4 * rr->rectx;
|
|
|
|
int len = stride * sizeof(float);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (a = 0; a < rr->recty; a++) {
|
|
|
|
if (blurfac == 1.0f) {
|
2009-09-18 22:25:49 +00:00
|
|
|
memcpy(rectf, rectf1, len);
|
|
|
|
}
|
|
|
|
else {
|
2012-06-13 17:23:44 +00:00
|
|
|
float *rf = rectf, *rf1 = rectf1;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (b = rr->rectx; b > 0; b--, rf += 4, rf1 += 4) {
|
|
|
|
if (rf1[3] < 0.01f)
|
|
|
|
rf[3] = mfac * rf[3];
|
|
|
|
else if (rf[3] < 0.01f) {
|
|
|
|
rf[0] = rf1[0];
|
|
|
|
rf[1] = rf1[1];
|
|
|
|
rf[2] = rf1[2];
|
|
|
|
rf[3] = blurfac * rf1[3];
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-06-13 17:23:44 +00:00
|
|
|
rf[0] = mfac * rf[0] + blurfac * rf1[0];
|
|
|
|
rf[1] = mfac * rf[1] + blurfac * rf1[1];
|
|
|
|
rf[2] = mfac * rf[2] + blurfac * rf1[2];
|
|
|
|
rf[3] = mfac * rf[3] + blurfac * rf1[3];
|
2012-10-21 05:46:41 +00:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
2012-06-13 17:23:44 +00:00
|
|
|
rectf += stride;
|
|
|
|
rectf1 += stride;
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* called by blur loop, accumulate renderlayers */
|
|
|
|
static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float blurfac, int channels)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
float mfac = 1.0f - blurfac;
|
|
|
|
int a, b, stride = channels * rr->rectx;
|
|
|
|
int len = stride * sizeof(float);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (a = 0; a < rr->recty; a++) {
|
|
|
|
if (blurfac == 1.0f) {
|
2006-05-27 13:35:03 +00:00
|
|
|
memcpy(rectf, rectf1, len);
|
|
|
|
}
|
|
|
|
else {
|
2012-06-13 17:23:44 +00:00
|
|
|
float *rf = rectf, *rf1 = rectf1;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (b = rr->rectx * channels; b > 0; b--, rf++, rf1++) {
|
|
|
|
rf[0] = mfac * rf[0] + blurfac * rf1[0];
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
}
|
2012-06-13 17:23:44 +00:00
|
|
|
rectf += stride;
|
|
|
|
rectf1 += stride;
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* called by blur loop, accumulate renderlayers */
|
2014-04-01 11:34:00 +11:00
|
|
|
static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float blurfac, bool key_alpha)
|
2006-05-27 13:35:03 +00:00
|
|
|
{
|
|
|
|
RenderLayer *rl, *rl1;
|
|
|
|
RenderPass *rpass, *rpass1;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rl1 = brr->layers.first;
|
|
|
|
for (rl = rr->layers.first; rl && rl1; rl = rl->next, rl1 = rl1->next) {
|
2006-05-27 13:35:03 +00:00
|
|
|
/* passes are allocated in sync */
|
2012-06-13 17:23:44 +00:00
|
|
|
rpass1 = rl1->passes.first;
|
|
|
|
for (rpass = rl->passes.first; rpass && rpass1; rpass = rpass->next, rpass1 = rpass1->next) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
if (STREQ(rpass->name, RE_PASSNAME_COMBINED) && key_alpha)
|
2015-04-06 10:40:12 -03:00
|
|
|
addblur_rect_key(rr, rpass->rect, rpass1->rect, blurfac);
|
|
|
|
else
|
|
|
|
addblur_rect(rr, rpass->rect, rpass1->rect, blurfac, rpass->channels);
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* main blur loop, can be called by fields too */
|
|
|
|
static void do_render_blur_3d(Render *re)
|
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
|
|
|
{
|
2006-05-27 13:35:03 +00:00
|
|
|
RenderResult *rres;
|
|
|
|
float blurfac;
|
2012-06-13 17:23:44 +00:00
|
|
|
int blur = re->r.mblur_samples;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
|
|
|
/* create accumulation render result */
|
2015-04-06 10:40:12 -03:00
|
|
|
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
|
|
|
/* do the blur steps */
|
2012-03-24 07:52:14 +00:00
|
|
|
while (blur--) {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->mblur_offs = re->r.blurfac * ((float)(re->r.mblur_samples - blur)) / (float)re->r.mblur_samples;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.curblur = re->r.mblur_samples - blur; /* stats */
|
2006-07-02 08:31:54 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_3d(re);
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
blurfac = 1.0f / (float)(re->r.mblur_samples - blur);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
merge_renderresult_blur(rres, re->result, blurfac, false);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->test_break(re->tbh)) break;
|
2006-05-27 13:35:03 +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
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* swap results */
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->result = rres;
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2010-06-27 05:39:55 +00:00
|
|
|
re->mblur_offs = 0.0f;
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.curblur = 0; /* stats */
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2013-10-09 16:49:13 +00:00
|
|
|
/* make sure motion blur changes get reset to current frame */
|
2013-12-26 17:24:42 +06:00
|
|
|
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) {
|
|
|
|
BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene, re->lay);
|
|
|
|
}
|
2013-10-09 16:49:13 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* weak... the display callback wants an active renderlayer pointer... */
|
2012-06-13 17:23:44 +00:00
|
|
|
re->result->renlay = render_get_active_layer(re, re->result);
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update(re->duh, re->result, NULL);
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* function assumes rectf1 and rectf2 to be half size of rectf */
|
|
|
|
static void interleave_rect(RenderResult *rr, float *rectf, float *rectf1, float *rectf2, int channels)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
int a, stride = channels * rr->rectx;
|
|
|
|
int len = stride * sizeof(float);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (a = 0; a < rr->recty; a += 2) {
|
2006-05-27 13:35:03 +00:00
|
|
|
memcpy(rectf, rectf1, len);
|
2012-06-13 17:23:44 +00:00
|
|
|
rectf += stride;
|
|
|
|
rectf1 += stride;
|
2006-05-27 13:35:03 +00:00
|
|
|
memcpy(rectf, rectf2, len);
|
2012-06-13 17:23:44 +00:00
|
|
|
rectf += stride;
|
|
|
|
rectf2 += stride;
|
2006-05-27 13:35:03 +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
|
|
|
}
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* merge render results of 2 fields */
|
|
|
|
static void merge_renderresult_fields(RenderResult *rr, RenderResult *rr1, RenderResult *rr2)
|
|
|
|
{
|
|
|
|
RenderLayer *rl, *rl1, *rl2;
|
|
|
|
RenderPass *rpass, *rpass1, *rpass2;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rl1 = rr1->layers.first;
|
|
|
|
rl2 = rr2->layers.first;
|
|
|
|
for (rl = rr->layers.first; rl && rl1 && rl2; rl = rl->next, rl1 = rl1->next, rl2 = rl2->next) {
|
2006-05-27 13:35:03 +00:00
|
|
|
|
|
|
|
/* passes are allocated in sync */
|
2012-06-13 17:23:44 +00:00
|
|
|
rpass1 = rl1->passes.first;
|
|
|
|
rpass2 = rl2->passes.first;
|
2012-09-04 18:27:47 +00:00
|
|
|
for (rpass = rl->passes.first;
|
|
|
|
rpass && rpass1 && rpass2;
|
|
|
|
rpass = rpass->next, rpass1 = rpass1->next, rpass2 = rpass2->next)
|
|
|
|
{
|
2006-05-27 13:35:03 +00:00
|
|
|
interleave_rect(rr, rpass->rect, rpass1->rect, rpass2->rect, rpass->channels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
/* interleaves 2 frames */
|
2006-05-27 13:35:03 +00:00
|
|
|
static void do_render_fields_3d(Render *re)
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
Object *camera = RE_GetCamera(re);
|
|
|
|
RenderResult *rr1, *rr2 = NULL;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
|
|
|
/* no render result was created, we can safely halve render y */
|
|
|
|
re->winy /= 2;
|
|
|
|
re->recty /= 2;
|
|
|
|
re->disprect.ymin /= 2;
|
|
|
|
re->disprect.ymax /= 2;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.curfield = 1; /* stats */
|
2006-07-02 08:31:54 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* first field, we have to call camera routine for correct aspect and subpixel offset */
|
2011-04-30 04:29:36 +00:00
|
|
|
RE_SetCamera(re, camera);
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE) == 0)
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_blur_3d(re);
|
|
|
|
else
|
|
|
|
do_render_3d(re);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2012-06-13 17:23:44 +00:00
|
|
|
rr1 = re->result;
|
|
|
|
re->result = NULL;
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
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
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* second field */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2006-07-02 08:31:54 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.curfield = 2; /* stats */
|
2006-07-02 08:31:54 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
re->flag |= R_SEC_FIELD;
|
2012-06-13 17:23:44 +00:00
|
|
|
if ((re->r.mode & R_FIELDSTILL) == 0) {
|
2010-06-27 05:39:55 +00:00
|
|
|
re->field_offs = 0.5f;
|
|
|
|
}
|
2011-04-30 04:29:36 +00:00
|
|
|
RE_SetCamera(re, camera);
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE) == 0)
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_blur_3d(re);
|
|
|
|
else
|
|
|
|
do_render_3d(re);
|
|
|
|
re->flag &= ~R_SEC_FIELD;
|
2010-06-27 05:39:55 +00:00
|
|
|
|
|
|
|
re->field_offs = 0.0f;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rr2 = re->result;
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* allocate original height new buffers */
|
|
|
|
re->winy *= 2;
|
|
|
|
re->recty *= 2;
|
|
|
|
re->disprect.ymin *= 2;
|
|
|
|
re->disprect.ymax *= 2;
|
2009-09-30 18:18:32 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2015-04-06 10:40:12 -03:00
|
|
|
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (rr2) {
|
|
|
|
if (re->r.mode & R_ODDFIELD)
|
2006-05-27 13:35:03 +00:00
|
|
|
merge_renderresult_fields(re->result, rr2, rr1);
|
|
|
|
else
|
|
|
|
merge_renderresult_fields(re->result, rr1, rr2);
|
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(rr2);
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
2010-02-07 10:42:45 +00:00
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(rr1);
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.curfield = 0; /* stats */
|
2006-07-02 08:31:54 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* weak... the display callback wants an active renderlayer pointer... */
|
2012-06-13 17:23:44 +00:00
|
|
|
re->result->renlay = render_get_active_layer(re, re->result);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update(re->duh, re->result, NULL);
|
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
|
|
|
}
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2013-06-20 11:32:08 +00:00
|
|
|
/* make sure disprect is not affected by the render border */
|
|
|
|
static void render_result_disprect_to_full_resolution(Render *re)
|
|
|
|
{
|
|
|
|
re->disprect.xmin = re->disprect.ymin = 0;
|
|
|
|
re->disprect.xmax = re->winx;
|
|
|
|
re->disprect.ymax = re->winy;
|
|
|
|
re->rectx = re->winx;
|
|
|
|
re->recty = re->winy;
|
|
|
|
}
|
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
static void render_result_uncrop(Render *re)
|
|
|
|
{
|
|
|
|
/* when using border render with crop disabled, insert render result into
|
|
|
|
* full size with black pixels outside */
|
|
|
|
if (re->result && (re->r.mode & R_BORDER)) {
|
|
|
|
if ((re->r.mode & R_CROP) == 0) {
|
|
|
|
RenderResult *rres;
|
|
|
|
|
|
|
|
/* backup */
|
|
|
|
const rcti orig_disprect = re->disprect;
|
|
|
|
const int orig_rectx = re->rectx, orig_recty = re->recty;
|
|
|
|
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
|
|
|
|
/* sub-rect for merge call later on */
|
|
|
|
re->result->tilerect = re->disprect;
|
|
|
|
|
|
|
|
/* weak is: it chances disprect from border */
|
|
|
|
render_result_disprect_to_full_resolution(re);
|
|
|
|
|
|
|
|
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
|
|
|
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
render_result_clone_passes(re, rres, NULL);
|
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
render_result_merge(rres, re->result);
|
|
|
|
render_result_free(re->result);
|
|
|
|
re->result = rres;
|
|
|
|
|
|
|
|
/* weak... the display callback wants an active renderlayer pointer... */
|
|
|
|
re->result->renlay = render_get_active_layer(re, re->result);
|
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
|
|
|
re->display_init(re->dih, re->result);
|
|
|
|
re->display_update(re->duh, re->result, NULL);
|
|
|
|
|
|
|
|
/* restore the disprect from border */
|
|
|
|
re->disprect = orig_disprect;
|
|
|
|
re->rectx = orig_rectx;
|
|
|
|
re->recty = orig_recty;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* set offset (again) for use in compositor, disprect was manipulated. */
|
|
|
|
re->result->xof = 0;
|
|
|
|
re->result->yof = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* main render routine, no compositing */
|
|
|
|
static void do_render_fields_blur_3d(Render *re)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
Object *camera = RE_GetCamera(re);
|
2006-06-29 10:48:30 +00:00
|
|
|
/* also check for camera here */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (camera == NULL) {
|
2012-12-29 01:54:58 +00:00
|
|
|
BKE_report(re->reports, RPT_ERROR, "Cannot render, no camera");
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = true;
|
2006-05-29 13:40:15 +00:00
|
|
|
return;
|
|
|
|
}
|
2006-06-10 16:30:44 +00:00
|
|
|
|
2006-05-29 13:40:15 +00:00
|
|
|
/* now use renderdata and camera to set viewplane */
|
2011-04-30 04:29:36 +00:00
|
|
|
RE_SetCamera(re, camera);
|
2006-05-29 13:40:15 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->r.mode & R_FIELDS)
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_fields_3d(re);
|
2012-06-13 17:23:44 +00:00
|
|
|
else if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE) == 0)
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_blur_3d(re);
|
|
|
|
else
|
|
|
|
do_render_3d(re);
|
|
|
|
|
|
|
|
/* when border render, check if we have to insert it in black */
|
2016-07-02 14:22:25 +02:00
|
|
|
render_result_uncrop(re);
|
2006-05-27 13:35:03 +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
|
|
|
|
2006-03-07 21:26:37 +00:00
|
|
|
/* within context of current Render *re, render another scene.
|
2012-03-09 18:28:30 +00:00
|
|
|
* it uses current render image size and disprect, but doesn't execute composite
|
|
|
|
*/
|
2006-03-14 17:44:19 +00:00
|
|
|
static void render_scene(Render *re, Scene *sce, int cfra)
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
{
|
2017-09-12 11:27:22 +05:00
|
|
|
Render *resc = RE_NewSceneRender(sce);
|
2012-06-13 17:23:44 +00:00
|
|
|
int winx = re->winx, winy = re->winy;
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
sce->r.cfra = cfra;
|
2011-04-19 06:15:13 +00:00
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_camera_switch_update(sce);
|
2011-04-19 06:15:13 +00:00
|
|
|
|
2008-01-28 16:33:59 +00:00
|
|
|
/* exception: scene uses own size (unfinished code) */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (0) {
|
2012-06-13 17:23:44 +00:00
|
|
|
winx = (sce->r.size * sce->r.xsch) / 100;
|
|
|
|
winy = (sce->r.size * sce->r.ysch) / 100;
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* initial setup */
|
2010-01-06 00:09:07 +00:00
|
|
|
RE_InitState(resc, re, &sce->r, NULL, winx, winy, &re->disprect);
|
2014-06-28 19:13:54 +02:00
|
|
|
|
|
|
|
/* We still want to use 'rendercache' setting from org (main) scene... */
|
|
|
|
resc->r.scemode = (resc->r.scemode & ~R_EXR_CACHE_FILE) | (re->r.scemode & R_EXR_CACHE_FILE);
|
|
|
|
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
/* still unsure entity this... */
|
2012-06-13 17:23:44 +00:00
|
|
|
resc->main = re->main;
|
|
|
|
resc->scene = sce;
|
|
|
|
resc->lay = sce->lay;
|
2013-02-11 12:25:54 +00:00
|
|
|
resc->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* ensure scene has depsgraph, base flags etc OK */
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_set_background(re->main, sce);
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
|
|
|
/* copy callbacks */
|
2013-12-17 23:42:38 +06:00
|
|
|
resc->display_update = re->display_update;
|
|
|
|
resc->duh = re->duh;
|
2012-06-13 17:23:44 +00:00
|
|
|
resc->test_break = re->test_break;
|
|
|
|
resc->tbh = re->tbh;
|
|
|
|
resc->stats_draw = re->stats_draw;
|
|
|
|
resc->sdh = re->sdh;
|
2014-05-02 14:52:19 +02:00
|
|
|
resc->current_scene_update = re->current_scene_update;
|
|
|
|
resc->suh = re->suh;
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_fields_blur_3d(resc);
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
}
|
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
/* helper call to detect if this scene needs a render, or if there's a any render layer to render */
|
|
|
|
static int composite_needs_render(Scene *sce, int this_scene)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
bNodeTree *ntree = sce->nodetree;
|
2011-06-12 13:35:17 +00:00
|
|
|
bNode *node;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (ntree == NULL) return 1;
|
2014-04-01 11:34:00 +11:00
|
|
|
if (sce->use_nodes == false) return 1;
|
2012-06-13 17:23:44 +00:00
|
|
|
if ((sce->r.scemode & R_DOCOMP) == 0) return 1;
|
2011-06-12 13:35:17 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
2014-09-05 16:01:52 +06:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0)
|
2012-06-13 17:23:44 +00:00
|
|
|
if (this_scene == 0 || node->id == NULL || node->id == &sce->id)
|
2011-06-12 13:35:17 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-02-08 16:25:35 +00:00
|
|
|
static bool rlayer_node_uses_alpha(bNodeTree *ntree, bNode *node)
|
|
|
|
{
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
for (sock = node->outputs.first; sock; sock = sock->next) {
|
|
|
|
/* Weak! but how to make it better? */
|
2013-03-18 18:25:05 +00:00
|
|
|
if (STREQ(sock->name, "Alpha") && nodeCountSocketLinks(ntree, sock) > 0)
|
2013-02-08 16:25:35 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Option to lock the interface while rendering
Added function called WM_set_locked_interface which does
two things:
- Prevents event queue from being handled, so no operators
(see below) or values are even possible to run or change.
This prevents any kind of "destructive" action performed
from user while rendering.
- Locks interface refresh for regions which does have lock
set to truth in their template. Currently it's just a 3D
viewport, but in the future more regions could be considered
unsafe, or we could want to lock different parts of
interface when doing different jobs.
This is needed because 3D viewport could be using or changing
the same data as renderer currently uses, leading to threading
conflict.
Notifiers are still allowed to handle, so render progress is
seen on the screen, but would need to doublecheck on this, in
terms some notifiers could be changing the data.
For now interface locking happens for render job only in case
"Lock Interface" checkbox is enabled.
Other tools like backing would also benefit of this option.
It is possible to mark operator as safe to be used in locked
interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
template flags.
This bit is completely handled by wm_evem_system, not
with operator run routines, so it's still possible to
run operators from drivers and handlers.
Currently allowed image editor navigation and zooming.
Reviewers: brecht, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D142
2014-01-29 16:07:14 +06:00
|
|
|
bool RE_allow_render_generic_object(Object *ob)
|
|
|
|
{
|
|
|
|
/* override not showing object when duplis are used with particles */
|
|
|
|
if (ob->transflag & OB_DUPLIPARTS) {
|
|
|
|
/* pass */ /* let particle system(s) handle showing vs. not showing */
|
|
|
|
}
|
|
|
|
else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-12-26 17:24:42 +06:00
|
|
|
/* Issue here is that it's possible that object which is used by boolean,
|
|
|
|
* array or shrinkwrap modifiers weren't displayed in the viewport before
|
|
|
|
* rendering. This leads to situations when apply() of this modifiers
|
|
|
|
* could not get ob->derivedFinal and modifiers are not being applied.
|
|
|
|
*
|
|
|
|
* This was worked around by direct call of get_derived_final() from those
|
|
|
|
* modifiers, but such approach leads to write conflicts with threaded
|
|
|
|
* update.
|
|
|
|
*
|
|
|
|
* Here we make sure derivedFinal will be calculated by update_for_newframe
|
|
|
|
* function later in the pipeline and all the modifiers are applied
|
|
|
|
* properly without hacks from their side.
|
|
|
|
* - sergey -
|
|
|
|
*/
|
|
|
|
#define DEPSGRAPH_WORKAROUND_HACK
|
|
|
|
|
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
|
|
|
static void tag_dependend_objects_for_render(Scene *scene, int renderlay)
|
|
|
|
{
|
|
|
|
Scene *sce_iter;
|
|
|
|
Base *base;
|
|
|
|
for (SETLOOPER(scene, sce_iter, base)) {
|
|
|
|
Object *object = base->object;
|
|
|
|
|
|
|
|
if ((base->lay & renderlay) == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (object->type == OB_MESH) {
|
Option to lock the interface while rendering
Added function called WM_set_locked_interface which does
two things:
- Prevents event queue from being handled, so no operators
(see below) or values are even possible to run or change.
This prevents any kind of "destructive" action performed
from user while rendering.
- Locks interface refresh for regions which does have lock
set to truth in their template. Currently it's just a 3D
viewport, but in the future more regions could be considered
unsafe, or we could want to lock different parts of
interface when doing different jobs.
This is needed because 3D viewport could be using or changing
the same data as renderer currently uses, leading to threading
conflict.
Notifiers are still allowed to handle, so render progress is
seen on the screen, but would need to doublecheck on this, in
terms some notifiers could be changing the data.
For now interface locking happens for render job only in case
"Lock Interface" checkbox is enabled.
Other tools like backing would also benefit of this option.
It is possible to mark operator as safe to be used in locked
interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
template flags.
This bit is completely handled by wm_evem_system, not
with operator run routines, so it's still possible to
run operators from drivers and handlers.
Currently allowed image editor navigation and zooming.
Reviewers: brecht, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D142
2014-01-29 16:07:14 +06:00
|
|
|
if (RE_allow_render_generic_object(object)) {
|
2013-12-26 17:24:42 +06:00
|
|
|
ModifierData *md;
|
|
|
|
VirtualModifierData virtualModifierData;
|
|
|
|
|
|
|
|
for (md = modifiers_getVirtualModifierList(object, &virtualModifierData);
|
|
|
|
md;
|
|
|
|
md = md->next)
|
|
|
|
{
|
|
|
|
if (!modifier_isEnabled(scene, md, eModifierMode_Render)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (md->type == eModifierType_Boolean) {
|
|
|
|
BooleanModifierData *bmd = (BooleanModifierData *)md;
|
|
|
|
if (bmd->object && bmd->object->type == OB_MESH) {
|
|
|
|
DAG_id_tag_update(&bmd->object->id, OB_RECALC_DATA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (md->type == eModifierType_Array) {
|
|
|
|
ArrayModifierData *amd = (ArrayModifierData *)md;
|
|
|
|
if (amd->start_cap && amd->start_cap->type == OB_MESH) {
|
|
|
|
DAG_id_tag_update(&amd->start_cap->id, OB_RECALC_DATA);
|
|
|
|
}
|
|
|
|
if (amd->end_cap && amd->end_cap->type == OB_MESH) {
|
|
|
|
DAG_id_tag_update(&amd->end_cap->id, OB_RECALC_DATA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (md->type == eModifierType_Shrinkwrap) {
|
|
|
|
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
|
|
|
|
if (smd->target && smd->target->type == OB_MESH) {
|
|
|
|
DAG_id_tag_update(&smd->target->id, OB_RECALC_DATA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-01-30 14:10:37 +00:00
|
|
|
static void tag_scenes_for_render(Render *re)
|
2006-02-02 23:55:14 +00:00
|
|
|
{
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
bNode *node;
|
2008-01-30 14:10:37 +00:00
|
|
|
Scene *sce;
|
2013-12-26 17:24:42 +06:00
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
|
|
|
int renderlay = re->lay;
|
|
|
|
#endif
|
2008-01-30 14:10:37 +00:00
|
|
|
|
2013-12-26 17:24:42 +06:00
|
|
|
for (sce = re->main->scene.first; sce; sce = sce->id.next) {
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
sce->id.tag &= ~LIB_TAG_DOIT;
|
2013-12-26 17:24:42 +06:00
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
|
|
|
tag_dependend_objects_for_render(sce, renderlay);
|
|
|
|
#endif
|
|
|
|
}
|
2008-01-30 14:10:37 +00:00
|
|
|
|
2013-04-23 22:40:13 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2014-07-01 23:35:09 +09:00
|
|
|
if (re->freestyle_bmain) {
|
|
|
|
for (sce = re->freestyle_bmain->scene.first; sce; sce = sce->id.next) {
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
sce->id.tag &= ~LIB_TAG_DOIT;
|
2013-12-26 17:24:42 +06:00
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
2014-07-01 23:35:09 +09:00
|
|
|
tag_dependend_objects_for_render(sce, renderlay);
|
2013-12-26 17:24:42 +06:00
|
|
|
#endif
|
2014-07-01 23:35:09 +09:00
|
|
|
}
|
2013-12-26 17:24:42 +06:00
|
|
|
}
|
2013-04-23 22:40:13 +00:00
|
|
|
#endif
|
|
|
|
|
2013-12-26 17:24:42 +06:00
|
|
|
if (RE_GetCamera(re) && composite_needs_render(re->scene, 1)) {
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
re->scene->id.tag |= LIB_TAG_DOIT;
|
2013-12-26 17:24:42 +06:00
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
|
|
|
tag_dependend_objects_for_render(re->scene, renderlay);
|
|
|
|
#endif
|
|
|
|
}
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->scene->nodetree == NULL) return;
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
/* check for render-layers nodes using other scenes, we tag them LIB_TAG_DOIT */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (node = re->scene->nodetree->nodes.first; node; node = node->next) {
|
2013-10-20 01:09:25 +00:00
|
|
|
node->flag &= ~NODE_TEST;
|
2014-09-05 16:01:52 +06:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (node->id) {
|
2013-02-08 16:25:35 +00:00
|
|
|
if (!MAIN_VERSION_ATLEAST(re->main, 265, 5)) {
|
|
|
|
if (rlayer_node_uses_alpha(re->scene->nodetree, node)) {
|
2013-03-18 11:44:56 +00:00
|
|
|
Scene *scene = (Scene *)node->id;
|
2013-02-08 16:25:35 +00:00
|
|
|
|
|
|
|
if (scene->r.alphamode != R_ALPHAPREMUL) {
|
2013-02-28 15:31:20 +00:00
|
|
|
BKE_reportf(re->reports, RPT_WARNING, "Setting scene %s alpha mode to Premul", scene->id.name + 2);
|
2013-02-08 16:25:35 +00:00
|
|
|
|
|
|
|
/* also print, so feedback is immediate */
|
|
|
|
printf("2.66 versioning fix: setting scene %s alpha mode to Premul\n", scene->id.name + 2);
|
|
|
|
|
|
|
|
scene->r.alphamode = R_ALPHAPREMUL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-20 01:09:25 +00:00
|
|
|
if (node->id != (ID *)re->scene) {
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
if ((node->id->tag & LIB_TAG_DOIT) == 0) {
|
2014-05-15 18:21:02 +02:00
|
|
|
Scene *scene = (Scene *) node->id;
|
|
|
|
if (render_scene_has_layers_to_render(scene)) {
|
|
|
|
node->flag |= NODE_TEST;
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
node->id->tag |= LIB_TAG_DOIT;
|
2013-12-26 17:24:42 +06:00
|
|
|
#ifdef DEPSGRAPH_WORKAROUND_HACK
|
2014-05-15 18:21:02 +02:00
|
|
|
tag_dependend_objects_for_render(scene, renderlay);
|
2013-12-26 17:24:42 +06:00
|
|
|
#endif
|
2014-05-15 18:21:02 +02:00
|
|
|
}
|
2013-10-20 01:09:25 +00:00
|
|
|
}
|
|
|
|
}
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-02-02 23:55:14 +00:00
|
|
|
|
2008-01-30 14:10:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ntree_render_scenes(Render *re)
|
|
|
|
{
|
|
|
|
bNode *node;
|
2012-06-13 17:23:44 +00:00
|
|
|
int cfra = re->scene->r.cfra;
|
2014-05-23 17:40:45 +02:00
|
|
|
Scene *restore_scene = re->scene;
|
|
|
|
bool scene_changed = false;
|
2008-01-30 14:10:37 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->scene->nodetree == NULL) return;
|
2008-01-30 14:10:37 +00:00
|
|
|
|
|
|
|
tag_scenes_for_render(re);
|
|
|
|
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
/* now foreach render-result node tagged we do a full render */
|
|
|
|
/* results are stored in a way compisitor will find it */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (node = re->scene->nodetree->nodes.first; node; node = node->next) {
|
2014-09-05 16:01:52 +06:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (node->id && node->id != (ID *)re->scene) {
|
2013-10-20 01:09:25 +00:00
|
|
|
if (node->flag & NODE_TEST) {
|
2012-06-13 17:23:44 +00:00
|
|
|
Scene *scene = (Scene *)node->id;
|
2010-12-05 10:14:34 +00:00
|
|
|
|
2014-05-23 17:40:45 +02:00
|
|
|
scene_changed |= scene != restore_scene;
|
2010-12-05 10:14:34 +00:00
|
|
|
render_scene(re, scene, cfra);
|
2013-10-20 01:09:25 +00:00
|
|
|
node->flag &= ~NODE_TEST;
|
2011-06-20 16:38:21 +00:00
|
|
|
|
2014-05-23 17:40:45 +02:00
|
|
|
nodeUpdate(restore_scene->nodetree, node);
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-02-02 23:55:14 +00:00
|
|
|
}
|
2010-12-05 10:14:34 +00:00
|
|
|
|
|
|
|
/* restore scene if we rendered another last */
|
2014-05-23 17:40:45 +02:00
|
|
|
if (scene_changed)
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_set_background(re->main, re->scene);
|
2006-02-02 23:55:14 +00:00
|
|
|
}
|
|
|
|
|
2006-02-14 18:04:25 +00:00
|
|
|
/* bad call... need to think over proper method still */
|
2015-03-28 02:36:00 +11:00
|
|
|
static void render_composit_stats(void *UNUSED(arg), const char *str)
|
2006-02-14 18:04:25 +00:00
|
|
|
{
|
2015-10-27 21:03:22 +05:00
|
|
|
RenderStats i;
|
|
|
|
memcpy(&i, &R.i, sizeof(i));
|
|
|
|
i.infostr = str;
|
|
|
|
R.stats_draw(R.sdh, &i);
|
2006-02-14 18:04:25 +00:00
|
|
|
}
|
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2015-05-16 23:55:45 +09:00
|
|
|
/* init Freestyle renderer */
|
|
|
|
static void init_freestyle(Render *re)
|
|
|
|
{
|
|
|
|
re->freestyle_bmain = BKE_main_new();
|
|
|
|
|
|
|
|
/* We use the same window manager for freestyle bmain as
|
2016-07-02 10:02:04 +10:00
|
|
|
* real bmain uses. This is needed because freestyle's
|
|
|
|
* bmain could be used to tag scenes for update, which
|
|
|
|
* implies call of ED_render_scene_update in some cases
|
|
|
|
* and that function requires proper window manager
|
|
|
|
* to present (sergey)
|
|
|
|
*/
|
2015-05-16 23:55:45 +09:00
|
|
|
re->freestyle_bmain->wm = re->main->wm;
|
|
|
|
|
|
|
|
FRS_init_stroke_renderer(re);
|
|
|
|
}
|
|
|
|
|
2010-03-28 17:46:10 +00:00
|
|
|
/* invokes Freestyle stroke rendering */
|
2013-06-11 02:32:01 +00:00
|
|
|
static void add_freestyle(Render *re, int render)
|
2010-03-28 17:46:10 +00:00
|
|
|
{
|
2012-04-06 13:49:51 +00:00
|
|
|
SceneRenderLayer *srl, *actsrl;
|
2010-03-28 17:46:10 +00:00
|
|
|
LinkData *link;
|
2014-07-27 03:05:17 +09:00
|
|
|
Render *r;
|
|
|
|
const bool do_link = (re->r.mode & R_MBLUR) == 0 || re->i.curblur == re->r.mblur_samples;
|
2010-03-28 17:46:10 +00:00
|
|
|
|
2012-04-06 13:49:51 +00:00
|
|
|
actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
|
|
|
|
2015-05-16 23:55:45 +09:00
|
|
|
FRS_begin_stroke_rendering(re);
|
2010-03-28 17:46:10 +00:00
|
|
|
|
2014-07-27 03:05:17 +09:00
|
|
|
for (srl = (SceneRenderLayer *)re->r.layers.first; srl; srl = srl->next) {
|
|
|
|
if (do_link) {
|
|
|
|
link = (LinkData *)MEM_callocN(sizeof(LinkData), "LinkData to Freestyle render");
|
|
|
|
BLI_addtail(&re->freestyle_renders, link);
|
|
|
|
}
|
2012-04-06 13:49:51 +00:00
|
|
|
if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
|
|
|
|
continue;
|
|
|
|
if (FRS_is_freestyle_enabled(srl)) {
|
2014-07-27 03:05:17 +09:00
|
|
|
r = FRS_do_stroke_rendering(re, srl, render);
|
|
|
|
if (do_link)
|
|
|
|
link->data = (void *)r;
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
2010-07-26 01:23:27 +00:00
|
|
|
|
2015-05-16 23:55:45 +09:00
|
|
|
FRS_end_stroke_rendering(re);
|
2013-07-07 17:24:30 +00:00
|
|
|
|
|
|
|
/* restore the global R value (invalidated by nested execution of the internal renderer) */
|
|
|
|
R = *re;
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* merges the results of Freestyle stroke rendering into a given render result */
|
|
|
|
static void composite_freestyle_renders(Render *re, int sample)
|
|
|
|
{
|
|
|
|
Render *freestyle_render;
|
2015-05-16 23:55:45 +09:00
|
|
|
RenderView *rv;
|
2012-04-06 13:49:51 +00:00
|
|
|
SceneRenderLayer *srl, *actsrl;
|
2010-03-28 17:46:10 +00:00
|
|
|
LinkData *link;
|
|
|
|
|
2012-04-06 13:49:51 +00:00
|
|
|
actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
|
|
|
|
2010-03-28 17:46:10 +00:00
|
|
|
link = (LinkData *)re->freestyle_renders.first;
|
2013-08-29 20:53:29 +00:00
|
|
|
|
2015-05-16 23:55:45 +09:00
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
|
|
|
for (srl = (SceneRenderLayer *)re->r.layers.first; srl; srl = srl->next) {
|
|
|
|
if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (FRS_is_freestyle_enabled(srl)) {
|
|
|
|
freestyle_render = (Render *)link->data;
|
|
|
|
|
|
|
|
/* may be NULL in case of empty render layer */
|
|
|
|
if (freestyle_render) {
|
|
|
|
render_result_exr_file_read_sample(freestyle_render, sample);
|
|
|
|
FRS_composite_result(re, srl, freestyle_render);
|
|
|
|
RE_FreeRenderResult(freestyle_render->result);
|
|
|
|
freestyle_render->result = NULL;
|
|
|
|
}
|
2013-08-29 20:53:29 +00:00
|
|
|
}
|
2015-05-16 23:55:45 +09:00
|
|
|
link = link->next;
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* releases temporary scenes and renders for Freestyle stroke rendering */
|
2013-04-18 08:58:21 +00:00
|
|
|
static void free_all_freestyle_renders(void)
|
2010-03-28 17:46:10 +00:00
|
|
|
{
|
|
|
|
Render *re1, *freestyle_render;
|
2013-04-25 15:59:15 +00:00
|
|
|
Scene *freestyle_scene;
|
2010-03-28 17:46:10 +00:00
|
|
|
LinkData *link;
|
|
|
|
|
2012-04-06 13:49:51 +00:00
|
|
|
for (re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
|
2010-03-28 17:46:10 +00:00
|
|
|
for (link = (LinkData *)re1->freestyle_renders.first; link; link = link->next) {
|
2013-08-29 20:53:29 +00:00
|
|
|
freestyle_render = (Render *)link->data;
|
|
|
|
|
|
|
|
if (freestyle_render) {
|
2013-04-25 15:59:15 +00:00
|
|
|
freestyle_scene = freestyle_render->scene;
|
2010-03-28 17:46:10 +00:00
|
|
|
RE_FreeRender(freestyle_render);
|
"Fix" crash when deleting linked object which has indirect usages.
This is in fact very hairy situation here... Objects are only refcounted by scenes,
any other usage is 'free', which means once all object instanciations are gone Blender
considers it can delete it.
There is a trap here though: indirect usages. Typically, we should never modify linked data
(because it is essencially useless, changes would be ignored and ost on next reload or
even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking.
For unlinking preceeding deletion however, this is not acceptable - we are likely to end with
a zero-user ID (aka deletable one) which is still actually used by other linked data.
Solution choosen here is double:
I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks
should not be allowed (indirect data or indirectly used data), and abort (with report) if needed.
II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data,
which makes actual deletion possible and safe.
Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data -
but then, once file is saved and reloaded, indirect usage would link back the deleted object,
without any instanciation in scene, which made it somehow virtual and unreachable...
With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles
(two linked objects using each other), linked objects become impossible to delete (from user space).
Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(
2016-07-01 17:51:08 +02:00
|
|
|
BKE_libblock_unlink(re1->freestyle_bmain, freestyle_scene, false, false);
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
BKE_libblock_free(re1->freestyle_bmain, freestyle_scene);
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
2013-04-23 22:40:13 +00:00
|
|
|
BLI_freelistN(&re1->freestyle_renders);
|
2014-07-01 23:35:09 +09:00
|
|
|
|
2014-07-01 19:43:52 +02:00
|
|
|
if (re1->freestyle_bmain) {
|
2014-07-03 11:09:11 +09:00
|
|
|
/* detach the window manager from freestyle bmain (see comments
|
|
|
|
* in add_freestyle() for more detail)
|
|
|
|
*/
|
2015-06-20 17:09:05 +10:00
|
|
|
BLI_listbase_clear(&re1->freestyle_bmain->wm);
|
2014-07-01 23:35:09 +09:00
|
|
|
|
2014-07-01 19:43:52 +02:00
|
|
|
BKE_main_free(re1->freestyle_bmain);
|
2014-07-03 11:09:11 +09:00
|
|
|
re1->freestyle_bmain = NULL;
|
2014-07-01 19:43:52 +02:00
|
|
|
}
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2010-03-28 17:46:10 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* reads all buffers, calls optional composite, merges in first result->views rectf */
|
2008-01-28 16:33:59 +00:00
|
|
|
static void do_merge_fullsample(Render *re, bNodeTree *ntree)
|
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
ListBase *rectfs;
|
|
|
|
RenderView *rv;
|
2016-07-02 14:22:25 +02:00
|
|
|
rcti filter_mask = re->disprect;
|
2008-02-07 12:14:58 +00:00
|
|
|
float *rectf, filt[3][3];
|
2012-09-23 18:50:56 +00:00
|
|
|
int x, y, sample;
|
2015-04-06 10:40:12 -03:00
|
|
|
int nr, numviews;
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
/* interaction callbacks */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree) {
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->stats_draw = render_composit_stats;
|
|
|
|
ntree->test_break = re->test_break;
|
|
|
|
ntree->progress = re->progress;
|
|
|
|
ntree->sdh = re->sdh;
|
|
|
|
ntree->tbh = re->tbh;
|
|
|
|
ntree->prh = re->prh;
|
2011-06-12 13:35:17 +00:00
|
|
|
}
|
|
|
|
|
2008-01-31 15:35:24 +00:00
|
|
|
/* filtmask needs it */
|
2012-06-13 17:23:44 +00:00
|
|
|
R = *re;
|
2008-01-31 15:35:24 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* temporary storage of the acccumulation buffers */
|
|
|
|
rectfs = MEM_callocN(sizeof(ListBase), "fullsample accumulation buffers");
|
|
|
|
|
|
|
|
numviews = BLI_listbase_count(&re->result->views);
|
|
|
|
for (nr = 0; nr < numviews; nr++) {
|
|
|
|
rv = MEM_callocN(sizeof(RenderView), "fullsample renderview");
|
|
|
|
|
|
|
|
/* we accumulate in here */
|
2016-07-02 14:22:25 +02:00
|
|
|
rv->rectf = MEM_mapallocN(re->result->rectx * re->result->recty * sizeof(float) * 4, "fullsample rgba");
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_addtail(rectfs, rv);
|
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (sample = 0; sample < re->r.osa; sample++) {
|
2013-08-29 00:14:57 +00:00
|
|
|
Scene *sce;
|
2011-06-12 13:35:17 +00:00
|
|
|
Render *re1;
|
2008-01-28 16:33:59 +00:00
|
|
|
RenderResult rres;
|
2012-09-23 18:50:56 +00:00
|
|
|
int mask;
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
/* enable full sample print */
|
2012-06-13 17:23:44 +00:00
|
|
|
R.i.curfsa = sample + 1;
|
2011-06-12 13:35:17 +00:00
|
|
|
|
|
|
|
/* set all involved renders on the samplebuffers (first was done by render itself, but needs tagged) */
|
2008-01-31 15:35:24 +00:00
|
|
|
/* also function below assumes this */
|
2008-01-30 14:10:37 +00:00
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
tag_scenes_for_render(re);
|
2013-08-29 00:14:57 +00:00
|
|
|
for (sce = re->main->scene.first; sce; sce = sce->id.next) {
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
if (sce->id.tag & LIB_TAG_DOIT) {
|
2017-09-12 11:27:22 +05:00
|
|
|
re1 = RE_GetSceneRender(sce);
|
2013-08-29 00:14:57 +00:00
|
|
|
|
|
|
|
if (re1 && (re1->r.scemode & R_FULL_SAMPLE)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sample) {
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2014-06-28 19:13:54 +02:00
|
|
|
render_result_exr_file_read_sample(re1, sample);
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2013-04-23 22:40:13 +00:00
|
|
|
if (re1->r.mode & R_EDGE_FRS)
|
2012-01-18 21:38:33 +00:00
|
|
|
composite_freestyle_renders(re1, sample);
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2016-07-02 14:22:25 +02:00
|
|
|
render_result_uncrop(re1);
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
2011-06-12 13:35:17 +00:00
|
|
|
ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */
|
2010-03-28 17:46:10 +00:00
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
|
|
|
}
|
2011-06-12 13:35:17 +00:00
|
|
|
|
2008-01-28 16:33:59 +00:00
|
|
|
/* composite */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree) {
|
2008-01-28 16:33:59 +00:00
|
|
|
ntreeCompositTagRender(re->scene);
|
|
|
|
ntreeCompositTagAnimated(ntree);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
|
|
|
ntreeCompositExecTree(re->scene, ntree, &re->r, true, G.background == 0, &re->scene->view_settings, &re->scene->display_settings, rv->name);
|
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
2008-02-07 12:14:58 +00:00
|
|
|
|
2015-04-22 16:38:30 -03:00
|
|
|
for (nr = 0, rv = rectfs->first; rv; rv = rv->next, nr++) {
|
2015-04-06 10:40:12 -03:00
|
|
|
rectf = rv->rectf;
|
|
|
|
|
|
|
|
/* ensure we get either composited result or the active layer */
|
|
|
|
RE_AcquireResultImage(re, &rres, nr);
|
|
|
|
|
|
|
|
/* accumulate with filter, and clip */
|
|
|
|
mask = (1 << sample);
|
|
|
|
mask_array(mask, filt);
|
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
for (y = 0; y < re->result->recty; y++) {
|
|
|
|
float *rf = rectf + 4 * y * re->result->rectx;
|
|
|
|
float *col = rres.rectf + 4 * y * re->result->rectx;
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
for (x = 0; x < re->result->rectx; x++, rf += 4, col += 4) {
|
2015-04-06 10:40:12 -03:00
|
|
|
/* clamping to 1.0 is needed for correct AA */
|
2015-04-14 10:30:14 +10:00
|
|
|
CLAMP(col[0], 0.0f, 1.0f);
|
|
|
|
CLAMP(col[1], 0.0f, 1.0f);
|
|
|
|
CLAMP(col[2], 0.0f, 1.0f);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
add_filt_fmask_coord(filt, col, rf, re->result->rectx, x, y, &filter_mask);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
RE_ReleaseResultImage(re);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* show stuff */
|
|
|
|
if (sample != re->osa - 1) {
|
|
|
|
/* weak... the display callback wants an active renderlayer pointer... */
|
|
|
|
re->result->renlay = render_get_active_layer(re, re->result);
|
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
re->display_update(re->duh, re->result, NULL);
|
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
|
|
|
}
|
2012-09-23 18:50:56 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (nr = 0; nr < numviews; nr++) {
|
|
|
|
rectf = ((RenderView *)BLI_findlink(rectfs, nr))->rectf;
|
|
|
|
|
|
|
|
/* clamp alpha and RGB to 0..1 and 0..inf, can go outside due to filter */
|
2016-07-02 14:22:25 +02:00
|
|
|
for (y = 0; y < re->result->recty; y++) {
|
|
|
|
float *rf = rectf + 4 * y * re->result->rectx;
|
2012-09-23 18:50:56 +00:00
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
for (x = 0; x < re->result->rectx; x++, rf += 4) {
|
2015-04-06 10:40:12 -03:00
|
|
|
rf[0] = MAX2(rf[0], 0.0f);
|
|
|
|
rf[1] = MAX2(rf[1], 0.0f);
|
|
|
|
rf[2] = MAX2(rf[2], 0.0f);
|
|
|
|
CLAMP(rf[3], 0.0f, 1.0f);
|
|
|
|
}
|
2012-09-23 18:50:56 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* store the final result */
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2015-04-29 11:18:18 -03:00
|
|
|
rv = RE_RenderViewGetById(re->result, nr);
|
2015-04-06 10:40:12 -03:00
|
|
|
if (rv->rectf)
|
|
|
|
MEM_freeN(rv->rectf);
|
|
|
|
rv->rectf = rectf;
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2012-09-23 18:50:56 +00:00
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
/* clear interaction callbacks */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree) {
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->stats_draw = NULL;
|
|
|
|
ntree->test_break = NULL;
|
|
|
|
ntree->progress = NULL;
|
|
|
|
ntree->tbh = ntree->sdh = ntree->prh = NULL;
|
2011-06-12 13:35:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* disable full sample print */
|
2012-06-13 17:23:44 +00:00
|
|
|
R.i.curfsa = 0;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* garbage collection */
|
|
|
|
while (rectfs->first) {
|
2015-11-23 12:28:01 +11:00
|
|
|
rv = rectfs->first;
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_remlink(rectfs, rv);
|
|
|
|
MEM_freeN(rv);
|
|
|
|
}
|
|
|
|
MEM_freeN(rectfs);
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
|
|
|
|
2010-12-28 10:39:27 +00:00
|
|
|
/* called externally, via compositor */
|
2010-10-31 11:51:10 +00:00
|
|
|
void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree)
|
2008-01-31 15:35:24 +00:00
|
|
|
{
|
|
|
|
Scene *scene;
|
|
|
|
bNode *node;
|
2010-10-31 11:51:10 +00:00
|
|
|
|
2010-12-28 10:39:27 +00:00
|
|
|
/* default start situation */
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = false;
|
2010-12-28 10:39:27 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->main = bmain;
|
|
|
|
re->scene = sce;
|
2012-10-10 05:56:49 +00:00
|
|
|
re->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
|
2008-01-31 15:35:24 +00:00
|
|
|
|
|
|
|
/* first call RE_ReadRenderResult on every renderlayer scene. this creates Render structs */
|
|
|
|
|
|
|
|
/* tag scenes unread */
|
2012-06-13 17:23:44 +00:00
|
|
|
for (scene = re->main->scene.first; scene; scene = scene->id.next)
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
scene->id.tag |= LIB_TAG_DOIT;
|
2008-01-31 15:35:24 +00:00
|
|
|
|
2013-06-11 02:32:01 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2014-07-01 23:35:09 +09:00
|
|
|
if (re->freestyle_bmain) {
|
|
|
|
for (scene = re->freestyle_bmain->scene.first; scene; scene = scene->id.next)
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
scene->id.tag &= ~LIB_TAG_DOIT;
|
2014-07-01 23:35:09 +09:00
|
|
|
}
|
2013-06-11 02:32:01 +00:00
|
|
|
#endif
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
2014-09-05 16:01:52 +06:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) {
|
2012-06-13 17:23:44 +00:00
|
|
|
Scene *nodescene = (Scene *)node->id;
|
2008-01-31 15:35:24 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (nodescene == NULL) nodescene = sce;
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
if (nodescene->id.tag & LIB_TAG_DOIT) {
|
2012-06-13 17:23:44 +00:00
|
|
|
nodescene->r.mode |= R_OSA; /* render struct needs tables */
|
2008-01-31 15:35:24 +00:00
|
|
|
RE_ReadRenderResult(sce, nodescene);
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
nodescene->id.tag &= ~LIB_TAG_DOIT;
|
2008-01-31 15:35:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* own render result should be read/allocated */
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
if (re->scene->id.tag & LIB_TAG_DOIT) {
|
2009-09-18 22:25:49 +00:00
|
|
|
RE_ReadRenderResult(re->scene, re->scene);
|
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
2015-12-27 11:53:50 +01:00
|
|
|
re->scene->id.tag &= ~LIB_TAG_DOIT;
|
2011-06-12 13:35:17 +00:00
|
|
|
}
|
2008-01-31 15:35:24 +00:00
|
|
|
|
|
|
|
/* and now we can draw (result is there) */
|
2009-09-18 22:25:49 +00:00
|
|
|
re->display_init(re->dih, re->result);
|
|
|
|
re->display_clear(re->dch, re->result);
|
2008-01-31 15:35:24 +00:00
|
|
|
|
2013-06-11 02:32:01 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2015-05-16 23:55:45 +09:00
|
|
|
if (re->r.mode & R_EDGE_FRS) {
|
|
|
|
init_freestyle(re);
|
2013-06-11 02:32:01 +00:00
|
|
|
add_freestyle(re, 0);
|
2015-05-16 23:55:45 +09:00
|
|
|
}
|
2013-06-11 02:32:01 +00:00
|
|
|
#endif
|
|
|
|
|
2008-01-31 15:35:24 +00:00
|
|
|
do_merge_fullsample(re, ntree);
|
2013-06-11 02:32:01 +00:00
|
|
|
|
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
free_all_freestyle_renders();
|
|
|
|
#endif
|
2008-01-31 15:35:24 +00:00
|
|
|
}
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* returns fully composited render-result on given time step (in RenderData) */
|
|
|
|
static void do_render_composite_fields_blur_3d(Render *re)
|
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
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
bNodeTree *ntree = re->scene->nodetree;
|
|
|
|
int update_newframe = 0;
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2006-07-04 16:14:39 +00:00
|
|
|
/* INIT seeding, compositor can use random texture */
|
2006-11-21 15:52:45 +00:00
|
|
|
BLI_srandom(re->r.cfra);
|
2006-07-04 16:14:39 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (composite_needs_render(re->scene, 1)) {
|
2006-05-27 13:35:03 +00:00
|
|
|
/* save memory... free all cached images */
|
|
|
|
ntreeFreeCache(ntree);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* render the frames
|
|
|
|
* it could be optimized to render only the needed view
|
|
|
|
* but what if a scene has a different number of views
|
|
|
|
* than the main scene? */
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_fields_blur_3d(re);
|
2012-10-21 05:46:41 +00:00
|
|
|
}
|
2011-06-12 13:35:17 +00:00
|
|
|
else {
|
2013-08-06 02:34:50 +00:00
|
|
|
re->i.cfra = re->r.cfra;
|
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
/* ensure new result gets added, like for regular renders */
|
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
2013-06-20 11:32:08 +00:00
|
|
|
if ((re->r.mode & R_CROP) == 0) {
|
|
|
|
render_result_disprect_to_full_resolution(re);
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2011-06-12 13:35:17 +00:00
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
2010-01-13 03:21:55 +00:00
|
|
|
/* scene render process already updates animsys */
|
|
|
|
update_newframe = 1;
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* swap render result */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->r.scemode & R_SINGLE_LAYER) {
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_single_layer_end(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
2006-05-27 13:35:03 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree) {
|
2008-01-28 16:33:59 +00:00
|
|
|
ntreeCompositTagRender(re->scene);
|
|
|
|
ntreeCompositTagAnimated(ntree);
|
|
|
|
}
|
2006-03-06 13:50:07 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree && re->scene->use_nodes && re->r.scemode & R_DOCOMP) {
|
2010-03-26 10:41:48 +00:00
|
|
|
/* checks if there are render-result nodes that need scene */
|
2012-06-13 17:23:44 +00:00
|
|
|
if ((re->r.scemode & R_SINGLE_LAYER) == 0)
|
2010-03-26 10:41:48 +00:00
|
|
|
ntree_render_scenes(re);
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->stats_draw = render_composit_stats;
|
|
|
|
ntree->test_break = re->test_break;
|
|
|
|
ntree->progress = re->progress;
|
|
|
|
ntree->sdh = re->sdh;
|
|
|
|
ntree->tbh = re->tbh;
|
|
|
|
ntree->prh = re->prh;
|
2010-05-27 08:22:16 +00:00
|
|
|
|
2010-03-26 10:41:48 +00:00
|
|
|
/* in case it was never initialized */
|
2012-06-13 17:23:44 +00:00
|
|
|
R.sdh = re->sdh;
|
|
|
|
R.stats_draw = re->stats_draw;
|
2015-06-17 16:29:51 +02:00
|
|
|
R.i.starttime = re->i.starttime;
|
|
|
|
R.i.cfra = re->i.cfra;
|
2008-01-28 16:33:59 +00:00
|
|
|
|
2010-03-26 10:41:48 +00:00
|
|
|
if (update_newframe)
|
2013-12-26 17:24:42 +06:00
|
|
|
BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene, re->lay);
|
2010-03-26 10:41:48 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->r.scemode & R_FULL_SAMPLE)
|
2010-03-26 10:41:48 +00:00
|
|
|
do_merge_fullsample(re, ntree);
|
|
|
|
else {
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderView *rv;
|
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
|
|
|
ntreeCompositExecTree(re->scene, ntree, &re->r, true, G.background == 0, &re->scene->view_settings, &re->scene->display_settings, rv->name);
|
|
|
|
}
|
2008-03-21 17:37:24 +00:00
|
|
|
}
|
2010-03-26 10:41:48 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->stats_draw = NULL;
|
|
|
|
ntree->test_break = NULL;
|
|
|
|
ntree->progress = NULL;
|
|
|
|
ntree->tbh = ntree->sdh = ntree->prh = NULL;
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
}
|
2008-03-21 17:37:24 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (re->r.scemode & R_FULL_SAMPLE)
|
2010-03-26 10:41:48 +00:00
|
|
|
do_merge_fullsample(re, NULL);
|
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
|
|
|
}
|
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2013-04-18 08:58:21 +00:00
|
|
|
free_all_freestyle_renders();
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2010-03-28 17:46:10 +00:00
|
|
|
|
2007-10-29 13:11:42 +00:00
|
|
|
/* weak... the display callback wants an active renderlayer pointer... */
|
2016-03-03 13:21:04 +05:00
|
|
|
if (re->result != NULL) {
|
|
|
|
re->result->renlay = render_get_active_layer(re, re->result);
|
|
|
|
re->display_update(re->duh, re->result, NULL);
|
|
|
|
}
|
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 05:26:09 +00:00
|
|
|
static void renderresult_stampinfo(Render *re)
|
2006-05-28 12:30:09 +00:00
|
|
|
{
|
2009-09-18 22:25:49 +00:00
|
|
|
RenderResult rres;
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderView *rv;
|
|
|
|
int nr;
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* this is the basic trick to get the displayed float or char rect from render result */
|
2015-04-06 10:40:12 -03:00
|
|
|
nr = 0;
|
|
|
|
for (rv = re->result->views.first;rv;rv = rv->next, nr++) {
|
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
RE_AcquireResultImage(re, &rres, nr);
|
2016-02-01 16:09:21 +01:00
|
|
|
BKE_image_stamp_buf(re->scene,
|
|
|
|
RE_GetCamera(re),
|
|
|
|
(re->r.stamp & R_STAMP_STRIPMETA) ? rres.stamp_data : NULL,
|
|
|
|
(unsigned char *)rres.rect32,
|
|
|
|
rres.rectf,
|
|
|
|
rres.rectx, rres.recty,
|
|
|
|
4);
|
2015-04-06 10:40:12 -03:00
|
|
|
RE_ReleaseResultImage(re);
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2006-06-22 03:12:48 +00:00
|
|
|
|
2011-11-03 17:06:12 +00:00
|
|
|
int RE_seq_render_active(Scene *scene, RenderData *rd)
|
2010-04-07 01:21:10 +00:00
|
|
|
{
|
|
|
|
Editing *ed;
|
|
|
|
Sequence *seq;
|
|
|
|
|
2011-11-03 17:06:12 +00:00
|
|
|
ed = scene->ed;
|
2010-04-07 01:21:10 +00:00
|
|
|
|
2011-11-03 17:06:12 +00:00
|
|
|
if (!(rd->scemode & R_DOSEQ) || !ed || !ed->seqbase.first)
|
2010-04-07 01:21:10 +00:00
|
|
|
return 0;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (seq = ed->seqbase.first; seq; seq = seq->next) {
|
2012-06-07 15:49:02 +00:00
|
|
|
if (seq->type != SEQ_TYPE_SOUND_RAM)
|
2010-04-07 01:21:10 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
static void do_render_seq(Render *re)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
|
|
|
static int recurs_depth = 0;
|
2015-04-06 10:40:12 -03:00
|
|
|
struct ImBuf *out;
|
2010-10-21 17:00:38 +00:00
|
|
|
RenderResult *rr; /* don't assign re->result here as it might change during give_ibuf_seq */
|
2009-09-18 22:25:49 +00:00
|
|
|
int cfra = re->r.cfra;
|
2010-11-21 20:00:31 +00:00
|
|
|
SeqRenderData context;
|
2015-10-24 01:01:10 +11:00
|
|
|
int view_id, tot_views;
|
2015-04-06 10:40:12 -03:00
|
|
|
struct ImBuf **ibuf_arr;
|
2015-01-04 22:46:54 +11:00
|
|
|
int re_x, re_y;
|
2006-06-22 03:12:48 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.cfra = cfra;
|
2010-07-20 19:39:07 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (recurs_depth == 0) {
|
2012-03-18 07:38:51 +00:00
|
|
|
/* otherwise sequencer animation isn't updated */
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_animsys_evaluate_all_animation(re->main, re->scene, (float)cfra); // XXX, was BKE_scene_frame_get(re->scene)
|
2009-12-15 10:35:50 +00:00
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
recurs_depth++;
|
2006-05-28 12:30:09 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if ((re->r.mode & R_BORDER) && (re->r.mode & R_CROP) == 0) {
|
2012-01-04 15:28:03 +00:00
|
|
|
/* if border rendering is used and cropping is disabled, final buffer should
|
2012-03-09 18:28:30 +00:00
|
|
|
* be as large as the whole frame */
|
2015-01-04 22:46:54 +11:00
|
|
|
re_x = re->winx;
|
|
|
|
re_y = re->winy;
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
else {
|
2015-01-04 22:46:54 +11:00
|
|
|
re_x = re->result->rectx;
|
|
|
|
re_y = re->result->recty;
|
2012-01-04 15:28:03 +00:00
|
|
|
}
|
2010-11-21 20:00:31 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
tot_views = BKE_scene_multiview_num_views_get(&re->r);
|
|
|
|
ibuf_arr = MEM_mallocN(sizeof(ImBuf *) * tot_views, "Sequencer Views ImBufs");
|
|
|
|
|
2015-01-04 22:46:54 +11:00
|
|
|
BKE_sequencer_new_render_data(
|
|
|
|
re->eval_ctx, re->main, re->scene,
|
|
|
|
re_x, re_y, 100,
|
|
|
|
&context);
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* the renderresult gets destroyed during the rendering, so we first collect all ibufs
|
|
|
|
* and then we populate the final renderesult */
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (view_id = 0; view_id < tot_views; view_id++) {
|
|
|
|
context.view_id = view_id;
|
|
|
|
out = BKE_sequencer_give_ibuf(&context, cfra, 0);
|
2007-10-28 22:27:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (out) {
|
|
|
|
ibuf_arr[view_id] = IMB_dupImBuf(out);
|
2015-07-01 15:23:09 +02:00
|
|
|
IMB_metadata_copy(ibuf_arr[view_id], out);
|
2015-04-06 10:40:12 -03:00
|
|
|
IMB_freeImBuf(out);
|
|
|
|
BKE_sequencer_imbuf_from_sequencer_space(re->scene, ibuf_arr[view_id]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ibuf_arr[view_id] = NULL;
|
|
|
|
}
|
|
|
|
}
|
2010-10-21 17:00:38 +00:00
|
|
|
|
|
|
|
rr = re->result;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2015-04-06 10:40:12 -03:00
|
|
|
render_result_views_new(rr, &re->r);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (view_id = 0; view_id < tot_views; view_id++) {
|
2015-04-29 11:18:18 -03:00
|
|
|
RenderView *rv = RE_RenderViewGetById(rr, view_id);
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
|
|
|
|
if (ibuf_arr[view_id]) {
|
|
|
|
/* copy ibuf into combined pixel rect */
|
2015-11-16 18:20:41 +05:00
|
|
|
RE_render_result_rect_from_ibuf(rr, &re->r, ibuf_arr[view_id], view_id);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-07-01 15:23:09 +02:00
|
|
|
if (ibuf_arr[view_id]->metadata && (re->r.stamp & R_STAMP_STRIPMETA)) {
|
|
|
|
/* ensure render stamp info first */
|
|
|
|
BKE_render_result_stamp_info(NULL, NULL, rr, true);
|
|
|
|
BKE_stamp_info_from_imbuf(rr, ibuf_arr[view_id]);
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */
|
|
|
|
Editing *ed = re->scene->ed;
|
|
|
|
if (ed)
|
|
|
|
BKE_sequencer_free_imbuf(re->scene, &ed->seqbase, true);
|
|
|
|
}
|
|
|
|
IMB_freeImBuf(ibuf_arr[view_id]);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
else {
|
|
|
|
/* render result is delivered empty in most cases, nevertheless we handle all cases */
|
|
|
|
render_result_rect_fill_zero(rr, view_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
|
|
|
/* would mark display buffers as invalid */
|
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
re->display_update(re->duh, re->result, NULL);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
MEM_freeN(ibuf_arr);
|
|
|
|
|
|
|
|
recurs_depth--;
|
2010-10-22 22:31:40 +00:00
|
|
|
|
|
|
|
/* just in case this flag went missing at some point */
|
|
|
|
re->r.scemode |= R_DOSEQ;
|
2011-11-03 17:06:12 +00:00
|
|
|
|
|
|
|
/* set overall progress of sequence rendering */
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->r.efra != re->r.sfra)
|
|
|
|
re->progress(re->prh, (float)(cfra - re->r.sfra) / (re->r.efra - re->r.sfra));
|
2011-11-03 17:06:12 +00:00
|
|
|
else
|
|
|
|
re->progress(re->prh, 1.0f);
|
2007-10-28 22:27:07 +00:00
|
|
|
}
|
2006-05-28 12:30:09 +00:00
|
|
|
|
|
|
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* main loop: doing sequence + fields + blur + 3d render + compositing */
|
|
|
|
static void do_render_all_options(Render *re)
|
|
|
|
{
|
2015-04-22 11:50:57 +02:00
|
|
|
Object *camera;
|
2015-07-01 15:23:09 +02:00
|
|
|
bool render_seq = false;
|
2015-04-22 11:50:57 +02:00
|
|
|
|
2014-05-02 14:52:19 +02:00
|
|
|
re->current_scene_update(re->suh, re->scene);
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_camera_switch_update(re->scene);
|
2009-12-16 19:49:33 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.starttime = PIL_check_seconds_timer();
|
2006-07-02 08:15:16 +00:00
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
/* ensure no images are in memory from previous animated sequences */
|
|
|
|
BKE_image_all_free_anim_ibufs(re->r.cfra);
|
2016-08-09 14:33:00 +02:00
|
|
|
BKE_sequencer_all_free_anim_ibufs(re->r.cfra);
|
2010-03-28 14:45:09 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (RE_engine_render(re, 1)) {
|
2010-03-28 14:45:09 +00:00
|
|
|
/* in this case external render overrides all */
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (RE_seq_render_active(re->scene, &re->r)) {
|
2006-08-10 13:48:04 +00:00
|
|
|
/* note: do_render_seq() frees rect32 when sequencer returns float images */
|
2015-07-01 15:23:09 +02:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2009-09-18 22:25:49 +00:00
|
|
|
do_render_seq(re);
|
2015-07-01 15:23:09 +02:00
|
|
|
render_seq = true;
|
|
|
|
}
|
2006-06-18 12:27:06 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
re->stats_draw(re->sdh, &re->i);
|
2013-12-17 23:42:38 +06:00
|
|
|
re->display_update(re->duh, re->result, NULL);
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-01-28 13:29:10 +00:00
|
|
|
re->pool = BKE_image_pool_new();
|
|
|
|
|
The GL-based renderer was removed. Freestyle now uses Blender's internal renderer to raster strokes.
The render generated from Freestyle's data is currently stored in the original scene's render structure ( as 'freestyle_render'): when the render database is generated, the scene's geometrical data is first imported into Freestyle and strokes are calculated. The generated strokes are used to create a Blender scene, rendered independently. The render result is used in the rendering loop.
The final rendering is performed the same way edge rendering is, in a function ('freestyle_enhance_add') operating on each individual render part. Freestyle strokes are only included if the toggle button "Freestyle" (in the 'Output' panel) is active and if the "Freestyle" render layer is also selected. Freestyle's panel appears when the toggle button 'Freestyle' is active.
IMPORTANT: as of now, rendering ONLY works when OSA is disabled and when Xparts = Yparts = 1. If these settings are not set, a bogus image will be created.
To make the render happen, many modifications had to be made:
- the Canvas::Draw and Operators::create methods no longer render strokes. They only generate shading and locational information.
- a BlenderStrokeRenderer class was added to turn Freestyle's strokes into a Blender scene. Basically, the scene consists of strokes in their projected image 2D coordinates and an orthographic camera centered in the middle of the corresponding canvas. The scene is rendered using vertex colors, in shadeless mode (therefore, no lamp is needed). BlenderStrokeRenderer uses the old GLTextureManager to load textures (as required by the StrokeRenderer class), even though stroke textures are probably not supported (not tested). After the scene is rendered, it is safely and automatically discarded.
- AppCanvas' code was greatly reduced to the bare minimum. The former AppCanvas would use an OpenGL-based back buffer and z buffer to determine the scene's color and depth information. In the future, this data will be determined from the corresponding render passes. Currently, the integration is not achieved so all style modules using depth/color information are sure to fail.
- before, Freestyle needed an OpenGL context to determine the camera's information and to compute the view map. As of now, the modelview and projection matrices are fully determined using data provided by Blender. This means both perspective and orthographic projections are supported. The AppGLWidget will very soon be removed completely.
2008-12-01 21:30:44 +00:00
|
|
|
do_render_composite_fields_blur_3d(re);
|
2013-01-28 13:29:10 +00:00
|
|
|
|
|
|
|
BKE_image_pool_free(re->pool);
|
|
|
|
re->pool = NULL;
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
2006-07-02 08:15:16 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
2007-10-28 22:27:07 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
re->stats_draw(re->sdh, &re->i);
|
2007-10-29 13:11:42 +00:00
|
|
|
|
2015-04-22 11:50:57 +02:00
|
|
|
/* save render result stamp if needed */
|
2016-03-03 13:21:04 +05:00
|
|
|
if (re->result != NULL) {
|
|
|
|
camera = RE_GetCamera(re);
|
|
|
|
/* sequence rendering should have taken care of that already */
|
|
|
|
if (!(render_seq && (re->r.stamp & R_STAMP_STRIPMETA)))
|
|
|
|
BKE_render_result_stamp_info(re->scene, camera, re->result, false);
|
|
|
|
|
|
|
|
/* stamp image info here */
|
|
|
|
if ((re->r.stamp & R_STAMP_ALL) && (re->r.stamp & R_STAMP_DRAW)) {
|
|
|
|
renderresult_stampinfo(re);
|
|
|
|
re->display_update(re->duh, re->result, NULL);
|
|
|
|
}
|
2007-10-29 13:11:42 +00:00
|
|
|
}
|
2006-05-27 13:35:03 +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
|
|
|
|
2014-02-26 14:56:27 +01:00
|
|
|
bool RE_force_single_renderlayer(Scene *scene)
|
|
|
|
{
|
|
|
|
int scemode = check_mode_full_sample(&scene->r);
|
|
|
|
if (scemode & R_SINGLE_LAYER) {
|
|
|
|
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
|
|
|
/* force layer to be enabled */
|
|
|
|
if (srl->layflag & SCE_LAY_DISABLE) {
|
|
|
|
srl->layflag &= ~SCE_LAY_DISABLE;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
static bool check_valid_compositing_camera(Scene *scene, Object *camera_override)
|
2010-11-03 13:10:09 +00:00
|
|
|
{
|
2014-01-08 18:26:42 +01:00
|
|
|
if (scene->r.scemode & R_DOCOMP && scene->use_nodes) {
|
|
|
|
bNode *node = scene->nodetree->nodes.first;
|
2010-11-03 13:10:09 +00:00
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
while (node) {
|
2014-09-05 16:01:52 +06:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) {
|
2014-01-08 18:26:42 +01:00
|
|
|
Scene *sce = node->id ? (Scene *)node->id : scene;
|
2016-02-05 14:57:53 +01:00
|
|
|
if (sce->camera == NULL) {
|
|
|
|
sce->camera = BKE_scene_camera_find(sce);
|
|
|
|
}
|
|
|
|
if (sce->camera == NULL) {
|
2014-01-08 18:26:42 +01:00
|
|
|
/* all render layers nodes need camera */
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
node = node->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return (camera_override != NULL || scene->camera != NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
static bool check_valid_camera_multiview(Scene *scene, Object *camera, ReportList *reports)
|
|
|
|
{
|
|
|
|
SceneRenderView *srv;
|
|
|
|
bool active_view = false;
|
|
|
|
|
2016-05-06 21:41:56 +02:00
|
|
|
if (camera == NULL || (scene->r.scemode & R_MULTIVIEW) == 0)
|
2015-04-06 10:40:12 -03:00
|
|
|
return true;
|
|
|
|
|
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
|
|
|
if (BKE_scene_multiview_is_render_view_active(&scene->r, srv)) {
|
|
|
|
active_view = true;
|
|
|
|
|
|
|
|
if (scene->r.views_format == SCE_VIEWS_FORMAT_MULTIVIEW) {
|
|
|
|
Object *view_camera;
|
|
|
|
view_camera = BKE_camera_multiview_render(scene, camera, srv->name);
|
|
|
|
|
|
|
|
if (view_camera == camera) {
|
|
|
|
/* if the suffix is not in the camera, means we are using the fallback camera */
|
|
|
|
if (!BLI_str_endswith(view_camera->id.name + 2, srv->suffix)) {
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" is not a multi-view camera",
|
|
|
|
camera->id.name + 2);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!active_view) {
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "No active view found in scene \"%s\"", scene->id.name + 2);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
static int check_valid_camera(Scene *scene, Object *camera_override, ReportList *reports)
|
|
|
|
{
|
2014-12-10 15:26:41 +01:00
|
|
|
const char *err_msg = "No camera found in scene \"%s\"";
|
|
|
|
|
2011-04-30 04:29:36 +00:00
|
|
|
if (camera_override == NULL && scene->camera == NULL)
|
2012-06-13 17:23:44 +00:00
|
|
|
scene->camera = BKE_scene_camera_find(scene);
|
2010-11-03 13:10:09 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (!check_valid_camera_multiview(scene, scene->camera, reports))
|
|
|
|
return false;
|
|
|
|
|
2014-01-22 17:40:10 +01:00
|
|
|
if (RE_seq_render_active(scene, &scene->r)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->ed) {
|
2012-06-13 17:23:44 +00:00
|
|
|
Sequence *seq = scene->ed->seqbase.first;
|
2010-11-03 13:10:09 +00:00
|
|
|
|
2012-03-24 07:52:14 +00:00
|
|
|
while (seq) {
|
2014-12-10 15:26:41 +01:00
|
|
|
if ((seq->type == SEQ_TYPE_SCENE) &&
|
|
|
|
((seq->flag & SEQ_SCENE_STRIPS) == 0) &&
|
|
|
|
(seq->scene != NULL))
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!seq->scene_camera) {
|
2012-05-05 14:33:36 +00:00
|
|
|
if (!seq->scene->camera && !BKE_scene_camera_find(seq->scene)) {
|
2014-01-08 18:26:42 +01:00
|
|
|
/* camera could be unneeded due to composite nodes */
|
|
|
|
Object *override = (seq->scene == scene) ? camera_override : NULL;
|
|
|
|
|
|
|
|
if (!check_valid_compositing_camera(seq->scene, override)) {
|
2014-12-10 15:26:41 +01:00
|
|
|
BKE_reportf(reports, RPT_ERROR, err_msg, seq->scene->id.name + 2);
|
2014-01-08 18:26:42 +01:00
|
|
|
return false;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
else if (!check_valid_camera_multiview(seq->scene, seq->scene_camera, reports))
|
|
|
|
return false;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
seq = seq->next;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-01-08 18:26:42 +01:00
|
|
|
else if (!check_valid_compositing_camera(scene, camera_override)) {
|
2014-12-10 15:26:41 +01:00
|
|
|
BKE_reportf(reports, RPT_ERROR, err_msg, scene->id.name + 2);
|
2014-01-08 18:26:42 +01:00
|
|
|
return false;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
return true;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
static bool node_tree_has_composite_output(bNodeTree *ntree)
|
2012-05-09 09:02:06 +00:00
|
|
|
{
|
|
|
|
bNode *node;
|
|
|
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
2013-05-10 12:27:18 +00:00
|
|
|
if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_OUTPUT_FILE)) {
|
2014-04-01 11:34:00 +11:00
|
|
|
return true;
|
2012-05-09 09:02:06 +00:00
|
|
|
}
|
|
|
|
else if (node->type == NODE_GROUP) {
|
2012-08-02 16:33:38 +00:00
|
|
|
if (node->id) {
|
|
|
|
if (node_tree_has_composite_output((bNodeTree *)node->id)) {
|
2014-04-01 11:34:00 +11:00
|
|
|
return true;
|
2012-08-02 16:33:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-09 09:02:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
return false;
|
2012-05-09 09:02:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int check_composite_output(Scene *scene)
|
|
|
|
{
|
|
|
|
return node_tree_has_composite_output(scene->nodetree);
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:56:27 +01:00
|
|
|
bool RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports)
|
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
|
|
|
{
|
2013-07-03 17:02:09 +00:00
|
|
|
int scemode = check_mode_full_sample(&scene->r);
|
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
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->r.mode & R_BORDER) {
|
|
|
|
if (scene->r.border.xmax <= scene->r.border.xmin ||
|
2012-05-20 19:49:27 +00:00
|
|
|
scene->r.border.ymax <= scene->r.border.ymin)
|
|
|
|
{
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "No border area selected");
|
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
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
if (scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
|
2006-12-20 17:57:56 +00:00
|
|
|
char str[FILE_MAX];
|
2006-06-19 13:53:00 +00:00
|
|
|
|
2012-09-04 13:29:07 +00:00
|
|
|
render_result_exr_file_path(scene, "", 0, str);
|
2006-06-19 13:53:00 +00:00
|
|
|
|
2013-03-05 03:53:22 +00:00
|
|
|
if (!BLI_file_is_writable(str)) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "Cannot save render buffers, check the temp default path");
|
2006-06-19 13:53:00 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2014-01-27 19:58:54 +01:00
|
|
|
|
|
|
|
/* no fullsample and edge */
|
|
|
|
if ((scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "Full sample does not support edge enhance");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-06-19 13:53:00 +00:00
|
|
|
}
|
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
if (scemode & R_DOCOMP) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->use_nodes) {
|
2012-05-09 09:02:06 +00:00
|
|
|
if (!scene->nodetree) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "No node tree in scene");
|
2006-03-12 11:51:56 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2006-12-23 09:50:07 +00:00
|
|
|
|
2012-05-09 09:02:06 +00:00
|
|
|
if (!check_composite_output(scene)) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "No render output node in scene");
|
2006-03-12 11:51:56 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-12-17 15:24:03 +00:00
|
|
|
|
2013-07-03 17:02:09 +00:00
|
|
|
if (scemode & R_FULL_SAMPLE) {
|
2012-06-13 17:23:44 +00:00
|
|
|
if (composite_needs_render(scene, 0) == 0) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "Full sample AA not supported without 3D rendering");
|
2010-12-17 15:24:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2006-03-12 11:51:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
/* check valid camera, without camera render is OK (compo, seq) */
|
2014-01-08 18:26:42 +01:00
|
|
|
if (!check_valid_camera(scene, camera_override, reports)) {
|
2010-11-03 13:10:09 +00:00
|
|
|
return 0;
|
2006-06-29 10:48:30 +00:00
|
|
|
}
|
2007-01-24 09:13:40 +00:00
|
|
|
|
2011-04-15 12:08:17 +00:00
|
|
|
/* get panorama & ortho, only after camera is set */
|
2012-05-05 00:58:22 +00:00
|
|
|
BKE_camera_object_mode(&scene->r, camera_override ? camera_override : scene->camera);
|
2011-04-15 12:08:17 +00:00
|
|
|
|
|
|
|
/* forbidden combinations */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->r.mode & R_PANORAMA) {
|
|
|
|
if (scene->r.mode & R_ORTHO) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "No ortho render possible for panorama");
|
2011-04-15 12:08:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2013-05-22 19:21:42 +00:00
|
|
|
|
|
|
|
#ifdef WITH_FREESTYLE
|
2014-09-13 11:39:01 +09:00
|
|
|
if (scene->r.mode & R_EDGE_FRS) {
|
2013-06-01 02:14:07 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "Panoramic camera not supported in Freestyle");
|
|
|
|
return 0;
|
2013-05-22 19:21:42 +00:00
|
|
|
}
|
|
|
|
#endif
|
2011-04-15 12:08:17 +00:00
|
|
|
}
|
2014-09-22 18:04:16 +10:00
|
|
|
|
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
if (scene->r.mode & R_EDGE_FRS) {
|
|
|
|
if (scene->r.mode & R_FIELDS) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "Fields not supported in Freestyle");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-08-24 10:19:44 +02:00
|
|
|
if (RE_seq_render_active(scene, &scene->r)) {
|
|
|
|
if (scene->r.mode & R_BORDER) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "Border rendering is not supported by sequencer");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:56:27 +01:00
|
|
|
/* layer flag tests */
|
2014-05-15 18:21:02 +02:00
|
|
|
if (!render_scene_has_layers_to_render(scene)) {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "All render layers are disabled");
|
2006-12-07 14:17:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-11-03 13:10:09 +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
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-11-03 13:10:09 +00:00
|
|
|
static void validate_render_settings(Render *re)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->r.scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
|
2010-11-03 13:10:09 +00:00
|
|
|
/* no osa + fullsample won't work... */
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re->r.osa == 0)
|
2010-11-03 13:10:09 +00:00
|
|
|
re->r.scemode &= ~R_FULL_SAMPLE;
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
2011-11-26 18:33:31 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (RE_engine_is_external(re)) {
|
2011-11-26 18:33:31 +00:00
|
|
|
/* not supported yet */
|
2012-09-04 13:29:07 +00:00
|
|
|
re->r.scemode &= ~(R_FULL_SAMPLE);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->r.mode &= ~(R_FIELDS | R_MBLUR);
|
2011-11-26 18:33:31 +00:00
|
|
|
}
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
|
2010-10-17 06:38:56 +00:00
|
|
|
static void update_physics_cache(Render *re, Scene *scene, int UNUSED(anim_init))
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
|
|
|
PTCacheBaker baker;
|
|
|
|
|
2016-04-02 04:24:24 +02:00
|
|
|
memset(&baker, 0, sizeof(baker));
|
2010-08-04 08:58:38 +00:00
|
|
|
baker.main = re->main;
|
2009-09-18 22:25:49 +00:00
|
|
|
baker.scene = scene;
|
|
|
|
baker.bake = 0;
|
|
|
|
baker.render = 1;
|
|
|
|
baker.anim_init = 1;
|
|
|
|
baker.quick_step = 1;
|
|
|
|
|
2010-12-18 15:03:31 +00:00
|
|
|
BKE_ptcache_bake(&baker);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
void RE_SetActiveRenderView(Render *re, const char *viewname)
|
|
|
|
{
|
|
|
|
BLI_strncpy(re->viewname, viewname, sizeof(re->viewname));
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *RE_GetActiveRenderView(Render *re)
|
|
|
|
{
|
|
|
|
return re->viewname;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* evaluating scene options for general Blender render */
|
2014-05-22 14:39:31 +02:00
|
|
|
static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, Scene *scene, SceneRenderLayer *srl,
|
|
|
|
Object *camera_override, unsigned int lay_override, int anim, int anim_init)
|
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 winx, winy;
|
|
|
|
rcti disprect;
|
|
|
|
|
|
|
|
/* r.xsch and r.ysch has the actual view window size
|
2012-03-09 18:28:30 +00:00
|
|
|
* r.border is the clipping rect */
|
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
|
|
|
|
|
|
|
/* calculate actual render result and display size */
|
2014-05-22 14:39:31 +02:00
|
|
|
winx = (rd->size * rd->xsch) / 100;
|
|
|
|
winy = (rd->size * rd->ysch) / 100;
|
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
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* we always render smaller part, inserting it in larger image is compositor bizz, it uses disprect for it */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->r.mode & R_BORDER) {
|
2014-05-22 14:39:31 +02:00
|
|
|
disprect.xmin = rd->border.xmin * winx;
|
|
|
|
disprect.xmax = rd->border.xmax * winx;
|
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
|
|
|
|
2014-05-22 14:39:31 +02:00
|
|
|
disprect.ymin = rd->border.ymin * winy;
|
|
|
|
disprect.ymax = rd->border.ymax * winy;
|
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
|
|
|
}
|
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.xmin = disprect.ymin = 0;
|
|
|
|
disprect.xmax = winx;
|
|
|
|
disprect.ymax = winy;
|
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
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->main = bmain;
|
|
|
|
re->scene = scene;
|
2012-10-10 05:56:49 +00:00
|
|
|
re->scene_color_manage = BKE_scene_check_color_management_enabled(scene);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->camera_override = camera_override;
|
2013-09-12 12:09:14 +00:00
|
|
|
re->lay = lay_override ? lay_override : scene->lay;
|
2014-07-04 16:32:17 +06:00
|
|
|
re->layer_override = lay_override;
|
2013-09-12 12:09:14 +00:00
|
|
|
re->i.localview = (re->lay & 0xFF000000) != 0;
|
2015-04-06 10:40:12 -03:00
|
|
|
re->viewname[0] = '\0';
|
|
|
|
|
2008-09-11 16:37:53 +00:00
|
|
|
/* not too nice, but it survives anim-border render */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (anim) {
|
2013-09-05 15:47:52 +00:00
|
|
|
render_update_anim_renderdata(re, &scene->r);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->disprect = disprect;
|
2008-09-11 16:37:53 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-01-30 14:10:37 +00:00
|
|
|
/* check all scenes involved */
|
|
|
|
tag_scenes_for_render(re);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Disabled completely for now,
|
|
|
|
* can be later set as render profile option
|
|
|
|
* and default for background render.
|
2012-03-09 18:28:30 +00:00
|
|
|
*/
|
2012-03-24 06:38:07 +00:00
|
|
|
if (0) {
|
2009-09-18 22:25:49 +00:00
|
|
|
/* make sure dynamics are up to date */
|
|
|
|
update_physics_cache(re, scene, anim_init);
|
|
|
|
}
|
2006-03-06 13:50:07 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (srl || scene->r.scemode & R_SINGLE_LAYER) {
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
|
|
|
render_result_single_layer_begin(re);
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
2006-03-06 13:50:07 +00:00
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
RE_InitState(re, NULL, &scene->r, srl, winx, winy, &disprect);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->ok) /* if an error was printed, abort */
|
2007-12-19 18:17:56 +00:00
|
|
|
return 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
|
|
|
|
2007-01-27 10:08:16 +00:00
|
|
|
/* initstate makes new result, have to send changed tags around */
|
|
|
|
ntreeCompositTagRender(re->scene);
|
2010-11-03 13:10:09 +00:00
|
|
|
|
|
|
|
validate_render_settings(re);
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
re->display_init(re->dih, re->result);
|
|
|
|
re->display_clear(re->dch, re->result);
|
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
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-06-28 16:25:07 +00:00
|
|
|
void RE_SetReports(Render *re, ReportList *reports)
|
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
re->reports = reports;
|
2011-06-28 16:25:07 +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
|
|
|
/* general Blender frame render call */
|
2014-04-01 11:34:00 +11:00
|
|
|
void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override,
|
|
|
|
unsigned int lay_override, int frame, const bool write_still)
|
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
|
|
|
{
|
2014-08-29 16:17:31 +10:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_INIT);
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* ugly global still... is to prevent preview events and signal subsurfs etc to make full resol */
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_rendering = true;
|
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
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
scene->r.cfra = frame;
|
2006-05-21 20:59:54 +00:00
|
|
|
|
2014-05-22 14:39:31 +02:00
|
|
|
if (render_initialize_from_main(re, &scene->r, bmain, scene, srl, camera_override, lay_override, 0, 0)) {
|
2010-05-04 12:31:24 +00:00
|
|
|
MEM_reset_peak_memory();
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE);
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_all_options(re);
|
2012-12-20 07:57:26 +00:00
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
if (write_still && !G.is_break) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
|
2012-03-09 00:41:09 +00:00
|
|
|
/* operator checks this but in case its called from elsewhere */
|
2010-11-17 04:02:19 +00:00
|
|
|
printf("Error: cant write single images with a movie format!\n");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
char name[FILE_MAX];
|
2015-01-24 16:48:23 +11:00
|
|
|
BKE_image_path_from_imformat(
|
|
|
|
name, scene->r.pic, bmain->name, scene->r.cfra,
|
2015-04-06 10:40:12 -03:00
|
|
|
&scene->r.im_format, (scene->r.scemode & R_EXTENSION) != 0, false, NULL);
|
2011-11-20 14:38:11 +00:00
|
|
|
|
2010-11-17 04:02:19 +00:00
|
|
|
/* reports only used for Movie */
|
2015-04-06 10:40:12 -03:00
|
|
|
do_write_image_or_movie(re, bmain, scene, NULL, 0, name);
|
2010-11-17 04:02:19 +00:00
|
|
|
}
|
2010-11-16 14:40:46 +00:00
|
|
|
}
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */
|
2014-12-01 18:27:45 +01:00
|
|
|
if (write_still) {
|
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_WRITE);
|
|
|
|
}
|
2010-11-16 14:40:46 +00:00
|
|
|
}
|
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, G.is_break ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE);
|
2012-03-11 17:24:03 +00:00
|
|
|
|
2006-05-21 20:59:54 +00:00
|
|
|
/* UGLY WARNING */
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_rendering = false;
|
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
|
|
|
}
|
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2013-06-11 02:32:01 +00:00
|
|
|
void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene, int render)
|
2010-03-01 21:51:14 +00:00
|
|
|
{
|
|
|
|
re->result_ok= 0;
|
2014-05-22 14:39:31 +02:00
|
|
|
if (render_initialize_from_main(re, &scene->r, bmain, scene, NULL, NULL, scene->lay, 0, 0)) {
|
2013-06-11 02:32:01 +00:00
|
|
|
if (render)
|
|
|
|
do_render_fields_blur_3d(re);
|
2010-03-01 21:51:14 +00:00
|
|
|
}
|
2013-04-08 04:39:09 +00:00
|
|
|
re->result_ok = 1;
|
2010-03-01 21:51:14 +00:00
|
|
|
}
|
2014-06-25 15:12:24 +09:00
|
|
|
|
|
|
|
void RE_RenderFreestyleExternal(Render *re)
|
|
|
|
{
|
|
|
|
if (!re->test_break(re->tbh)) {
|
2015-10-10 19:18:04 +02:00
|
|
|
RenderView *rv;
|
|
|
|
|
2015-05-16 23:55:45 +09:00
|
|
|
init_freestyle(re);
|
2015-10-10 19:18:04 +02:00
|
|
|
|
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
RE_Database_FromScene(re, re->main, re->scene, re->lay, 1);
|
|
|
|
RE_Database_Preprocess(re);
|
|
|
|
add_freestyle(re, 1);
|
|
|
|
RE_Database_Free(re);
|
|
|
|
}
|
2014-06-25 15:12:24 +09:00
|
|
|
}
|
|
|
|
}
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2010-03-01 21:51:14 +00:00
|
|
|
|
2015-04-21 18:33:33 +02:00
|
|
|
bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scene, const bool stamp, char *name)
|
2006-02-05 19:16:32 +00:00
|
|
|
{
|
2015-04-06 10:40:12 -03:00
|
|
|
bool ok = true;
|
|
|
|
RenderData *rd = &scene->r;
|
2006-02-05 19:16:32 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (!rr)
|
|
|
|
return false;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
bool is_mono = BLI_listbase_count_ex(&rr->views, 2) < 2;
|
2018-01-24 15:55:54 +01:00
|
|
|
bool is_exr_rr = ELEM(rd->im_format.imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) &&
|
|
|
|
RE_HasFloatPixels(rr);
|
2011-12-29 13:12:40 +00:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
if (rd->im_format.views_format == R_IMF_VIEWS_MULTIVIEW && is_exr_rr)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
2017-10-20 15:18:26 +02:00
|
|
|
ok = RE_WriteRenderResult(reports, rr, name, &rd->im_format, NULL, -1);
|
2016-03-10 19:34:53 +11:00
|
|
|
render_print_save_message(reports, name, ok, errno);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2012-09-24 11:56:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* mono, legacy code */
|
|
|
|
else if (is_mono || (rd->im_format.views_format == R_IMF_VIEWS_INDIVIDUAL))
|
|
|
|
{
|
|
|
|
RenderView *rv;
|
2015-10-24 01:01:10 +11:00
|
|
|
int view_id;
|
2015-04-06 10:40:12 -03:00
|
|
|
char filepath[FILE_MAX];
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_strncpy(filepath, name, sizeof(filepath));
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (view_id = 0, rv = rr->views.first; rv; rv = rv->next, view_id++) {
|
2015-05-06 13:58:06 +02:00
|
|
|
if (!is_mono) {
|
|
|
|
BKE_scene_multiview_view_filepath_get(&scene->r, filepath, rv->name, name);
|
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2018-01-24 15:55:54 +01:00
|
|
|
if (is_exr_rr) {
|
2017-10-20 15:18:26 +02:00
|
|
|
ok = RE_WriteRenderResult(reports, rr, name, &rd->im_format, rv->name, -1);
|
2016-03-10 19:34:53 +11:00
|
|
|
render_print_save_message(reports, name, ok, errno);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* optional preview images for exr */
|
2017-10-20 15:18:26 +02:00
|
|
|
if (ok && (rd->im_format.flag & R_IMF_FLAG_PREVIEW_JPG)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
ImageFormatData imf = rd->im_format;
|
|
|
|
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
|
|
|
|
|
|
|
if (BLI_testextensie(name, ".exr"))
|
|
|
|
name[strlen(name) - 4] = 0;
|
|
|
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
2017-10-20 15:18:26 +02:00
|
|
|
|
|
|
|
ImBuf *ibuf = render_result_rect_to_ibuf(rr, rd, view_id);
|
2015-04-06 10:40:12 -03:00
|
|
|
ibuf->planes = 24;
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf, name, &imf, stamp);
|
2017-10-20 15:18:26 +02:00
|
|
|
|
|
|
|
IMB_freeImBuf(ibuf);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2017-10-20 15:18:26 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
ImBuf *ibuf = render_result_rect_to_ibuf(rr, rd, view_id);
|
|
|
|
|
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf, true, false, &scene->view_settings,
|
|
|
|
&scene->display_settings, &rd->im_format);
|
|
|
|
|
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf, name, &rd->im_format, stamp);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
|
|
|
IMB_freeImBuf(ibuf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { /* R_IMF_VIEWS_STEREO_3D */
|
|
|
|
BLI_assert(scene->r.im_format.views_format == R_IMF_VIEWS_STEREO_3D);
|
|
|
|
|
|
|
|
if (rd->im_format.imtype == R_IMF_IMTYPE_MULTILAYER) {
|
2017-10-26 14:14:12 +02:00
|
|
|
printf("Stereo 3D not supported for MultiLayer image: %s\n", name);
|
2006-02-05 19:16:32 +00:00
|
|
|
}
|
2006-12-20 17:57:56 +00:00
|
|
|
else {
|
2015-04-06 10:40:12 -03:00
|
|
|
ImBuf *ibuf_arr[3] = {NULL};
|
|
|
|
const char *names[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
int view_id = BLI_findstringindex(&rr->views, names[i], offsetof(RenderView, name));
|
|
|
|
ibuf_arr[i] = render_result_rect_to_ibuf(rr, rd, view_id);
|
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf_arr[i], true, false, &scene->view_settings,
|
|
|
|
&scene->display_settings, &scene->r.im_format);
|
|
|
|
IMB_prepare_write_ImBuf(IMB_isfloat(ibuf_arr[i]), ibuf_arr[i]);
|
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
ibuf_arr[2] = IMB_stereo3d_ImBuf(&scene->r.im_format, ibuf_arr[0], ibuf_arr[1]);
|
2011-06-24 03:49:56 +00:00
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf_arr[2], name, &rd->im_format, stamp);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
/* optional preview images for exr */
|
2017-10-20 15:18:26 +02:00
|
|
|
if (ok && is_exr_rr &&
|
2015-04-06 10:40:12 -03:00
|
|
|
(rd->im_format.flag & R_IMF_FLAG_PREVIEW_JPG))
|
|
|
|
{
|
|
|
|
ImageFormatData imf = rd->im_format;
|
2012-06-13 17:23:44 +00:00
|
|
|
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
2011-11-21 20:19:58 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (BLI_testextensie(name, ".exr"))
|
2012-06-13 17:23:44 +00:00
|
|
|
name[strlen(name) - 4] = 0;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-01-24 16:48:23 +11:00
|
|
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
2015-04-06 10:40:12 -03:00
|
|
|
ibuf_arr[2]->planes = 24;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf_arr[2], name, &rd->im_format, stamp);
|
2006-12-20 17:57:56 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
IMB_freeImBuf(ibuf_arr[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2015-10-24 01:01:10 +11:00
|
|
|
bool RE_WriteRenderViewsMovie(
|
|
|
|
ReportList *reports, RenderResult *rr, Scene *scene, RenderData *rd, bMovieHandle *mh,
|
2015-11-16 16:53:46 +05:00
|
|
|
void **movie_ctx_arr, const int totvideos, bool preview)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
|
|
|
bool is_mono;
|
|
|
|
bool ok = true;
|
|
|
|
|
|
|
|
if (!rr)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
is_mono = BLI_listbase_count_ex(&rr->views, 2) < 2;
|
|
|
|
|
|
|
|
if (is_mono || (scene->r.im_format.views_format == R_IMF_VIEWS_INDIVIDUAL)) {
|
2015-10-24 01:01:10 +11:00
|
|
|
int view_id;
|
2015-04-06 10:40:12 -03:00
|
|
|
for (view_id = 0; view_id < totvideos; view_id++) {
|
|
|
|
const char *suffix = BKE_scene_multiview_view_id_suffix_get(&scene->r, view_id);
|
|
|
|
ImBuf *ibuf = render_result_rect_to_ibuf(rr, &scene->r, view_id);
|
|
|
|
|
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf, true, false, &scene->view_settings,
|
|
|
|
&scene->display_settings, &scene->r.im_format);
|
|
|
|
|
2015-04-09 18:01:52 +02:00
|
|
|
ok &= mh->append_movie(movie_ctx_arr[view_id], rd, preview ? scene->r.psfra : scene->r.sfra, scene->r.cfra,
|
2015-04-06 10:40:12 -03:00
|
|
|
(int *) ibuf->rect, ibuf->x, ibuf->y, suffix, reports);
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
2006-12-20 17:57:56 +00:00
|
|
|
IMB_freeImBuf(ibuf);
|
2006-02-05 19:16:32 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
printf("Append frame %d\n", scene->r.cfra);
|
|
|
|
}
|
|
|
|
else { /* R_IMF_VIEWS_STEREO_3D */
|
|
|
|
const char *names[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
|
|
|
|
ImBuf *ibuf_arr[3] = {NULL};
|
2015-10-24 01:01:10 +11:00
|
|
|
int i;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
BLI_assert((totvideos == 1) && (scene->r.im_format.views_format == R_IMF_VIEWS_STEREO_3D));
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
int view_id = BLI_findstringindex(&rr->views, names[i], offsetof(RenderView, name));
|
|
|
|
ibuf_arr[i] = render_result_rect_to_ibuf(rr, &scene->r, view_id);
|
|
|
|
|
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf_arr[i], true, false, &scene->view_settings,
|
|
|
|
&scene->display_settings, &scene->r.im_format);
|
|
|
|
}
|
|
|
|
|
|
|
|
ibuf_arr[2] = IMB_stereo3d_ImBuf(&scene->r.im_format, ibuf_arr[0], ibuf_arr[1]);
|
|
|
|
|
2015-04-09 18:01:52 +02:00
|
|
|
ok = mh->append_movie(movie_ctx_arr[0], rd, preview ? scene->r.psfra : scene->r.sfra, scene->r.cfra, (int *) ibuf_arr[2]->rect,
|
2015-04-06 10:40:12 -03:00
|
|
|
ibuf_arr[2]->x, ibuf_arr[2]->y, "", reports);
|
|
|
|
|
2017-01-25 15:15:37 +01:00
|
|
|
for (i = 0; i < 3; i++) {
|
2015-04-06 10:40:12 -03:00
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
|
|
|
IMB_freeImBuf(ibuf_arr[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2015-10-24 01:01:10 +11:00
|
|
|
static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const int totvideos, const char *name_override)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
|
|
|
char name[FILE_MAX];
|
|
|
|
RenderResult rres;
|
|
|
|
double render_time;
|
|
|
|
bool ok = true;
|
|
|
|
|
|
|
|
RE_AcquireResultImageViews(re, &rres);
|
|
|
|
|
|
|
|
/* write movie or image */
|
|
|
|
if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
|
2015-11-16 16:53:46 +05:00
|
|
|
RE_WriteRenderViewsMovie(re->reports, &rres, scene, &re->r, mh, re->movie_ctx_arr, totvideos, false);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (name_override)
|
|
|
|
BLI_strncpy(name, name_override, sizeof(name));
|
|
|
|
else
|
|
|
|
BKE_image_path_from_imformat(
|
|
|
|
name, scene->r.pic, bmain->name, scene->r.cfra,
|
|
|
|
&scene->r.im_format, (scene->r.scemode & R_EXTENSION) != 0, true, NULL);
|
|
|
|
|
|
|
|
/* write images as individual images or stereo */
|
2015-04-21 18:33:33 +02:00
|
|
|
ok = RE_WriteRenderViewsImage(re->reports, &rres, scene, true, name);
|
2006-02-05 19:16:32 +00:00
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
RE_ReleaseResultImageViews(re, &rres);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2013-03-27 10:05:31 +00:00
|
|
|
render_time = re->i.lastframetime;
|
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
|
|
|
|
2015-06-30 14:47:31 +10:00
|
|
|
BLI_timecode_string_from_time_simple(name, sizeof(name), re->i.lastframetime);
|
2012-03-01 19:19:10 +00:00
|
|
|
printf(" Time: %s", name);
|
2015-06-17 15:49:09 +02:00
|
|
|
|
|
|
|
/* Flush stdout to be sure python callbacks are printing stuff after blender. */
|
|
|
|
fflush(stdout);
|
|
|
|
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
|
2012-03-01 19:19:10 +00:00
|
|
|
|
2015-06-30 14:47:31 +10:00
|
|
|
BLI_timecode_string_from_time_simple(name, sizeof(name), re->i.lastframetime - render_time);
|
2013-03-27 10:05:31 +00:00
|
|
|
printf(" (Saving: %s)\n", name);
|
|
|
|
|
2012-03-01 19:19:10 +00:00
|
|
|
fputc('\n', stdout);
|
2006-02-05 19:16:32 +00:00
|
|
|
fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */
|
2009-12-22 12:01:32 +00:00
|
|
|
|
|
|
|
return ok;
|
2006-02-05 19:16:32 +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
|
|
|
|
2015-10-24 01:01:10 +11:00
|
|
|
static void get_videos_dimensions(
|
|
|
|
Render *re, RenderData *rd,
|
|
|
|
size_t *r_width, size_t *r_height)
|
2015-04-06 10:40:12 -03:00
|
|
|
{
|
|
|
|
size_t width, height;
|
|
|
|
if (re->r.mode & R_BORDER) {
|
|
|
|
if ((re->r.mode & R_CROP) == 0) {
|
|
|
|
width = re->winx;
|
|
|
|
height = re->winy;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
width = re->rectx;
|
|
|
|
height = re->recty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
width = re->rectx;
|
|
|
|
height = re->recty;
|
|
|
|
}
|
|
|
|
|
|
|
|
BKE_scene_multiview_videos_dimensions_get(rd, width, height, r_width, r_height);
|
|
|
|
}
|
|
|
|
|
2015-10-24 01:01:10 +11:00
|
|
|
static void re_movie_free_all(Render *re, bMovieHandle *mh, int totvideos)
|
2015-10-22 16:48:38 +11:00
|
|
|
{
|
2015-10-24 01:01:10 +11:00
|
|
|
int i;
|
2015-10-22 16:48:38 +11:00
|
|
|
|
|
|
|
for (i = 0; i < totvideos; i++) {
|
|
|
|
mh->end_movie(re->movie_ctx_arr[i]);
|
|
|
|
mh->context_free(re->movie_ctx_arr[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
MEM_SAFE_FREE(re->movie_ctx_arr);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* saves images to disk */
|
2014-04-01 11:34:00 +11:00
|
|
|
void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_override,
|
|
|
|
unsigned int lay_override, int sfra, int efra, int tfra)
|
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
|
|
|
{
|
2014-05-22 14:39:31 +02:00
|
|
|
RenderData rd = scene->r;
|
2015-04-06 10:40:12 -03:00
|
|
|
bMovieHandle *mh = NULL;
|
2012-06-13 17:23:44 +00:00
|
|
|
int cfrao = scene->r.cfra;
|
|
|
|
int nfra, totrendered = 0, totskipped = 0;
|
2015-10-24 01:01:10 +11:00
|
|
|
const int totvideos = BKE_scene_multiview_num_videos_get(&rd);
|
2015-04-06 10:40:12 -03:00
|
|
|
const bool is_movie = BKE_imtype_is_movie(scene->r.im_format.imtype);
|
|
|
|
const bool is_multiview_name = ((scene->r.scemode & R_MULTIVIEW) != 0 &&
|
|
|
|
(scene->r.im_format.views_format == R_IMF_VIEWS_INDIVIDUAL));
|
|
|
|
|
2014-08-29 16:17:31 +10:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_INIT);
|
|
|
|
|
2008-09-11 16:37:53 +00:00
|
|
|
/* do not fully call for each frame, it initializes & pops output window */
|
2014-05-22 14:39:31 +02:00
|
|
|
if (!render_initialize_from_main(re, &rd, bmain, scene, NULL, camera_override, lay_override, 0, 1))
|
2006-06-09 12:21:15 +00:00
|
|
|
return;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2015-11-13 03:22:22 +11:00
|
|
|
/* MULTIVIEW_TODO:
|
|
|
|
* in case a new video format is added that implements get_next_frame multiview has to be addressed
|
|
|
|
* or the error throwing for R_IMF_IMTYPE_FRAMESERVER has to be extended for those cases as well
|
|
|
|
*/
|
2015-04-06 10:40:12 -03:00
|
|
|
if ((rd.im_format.imtype == R_IMF_IMTYPE_FRAMESERVER) && (totvideos > 1)) {
|
|
|
|
BKE_report(re->reports, RPT_ERROR, "Frame Server only support stereo output for multiview rendering");
|
|
|
|
return;
|
|
|
|
}
|
2011-11-02 13:36:28 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (is_movie) {
|
2015-10-24 01:01:10 +11:00
|
|
|
size_t width, height;
|
|
|
|
int i;
|
2015-10-22 16:48:38 +11:00
|
|
|
bool is_error = false;
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
get_videos_dimensions(re, &rd, &width, &height);
|
|
|
|
|
|
|
|
mh = BKE_movie_handle_get(scene->r.im_format.imtype);
|
2015-09-23 02:40:08 +10:00
|
|
|
if (mh == NULL) {
|
|
|
|
BKE_report(re->reports, RPT_ERROR, "Movie format unsupported");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
re->movie_ctx_arr = MEM_mallocN(sizeof(void *) * totvideos, "Movies' Context");
|
|
|
|
|
|
|
|
for (i = 0; i < totvideos; i++) {
|
|
|
|
const char *suffix = BKE_scene_multiview_view_id_suffix_get(&re->r, i);
|
2013-12-29 17:25:56 +06:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
re->movie_ctx_arr[i] = mh->context_create();
|
|
|
|
|
2015-10-22 16:48:38 +11:00
|
|
|
if (!mh->start_movie(re->movie_ctx_arr[i], scene, &re->r, width, height, re->reports, false, suffix)) {
|
|
|
|
is_error = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_error) {
|
|
|
|
/* report is handled above */
|
|
|
|
re_movie_free_all(re, mh, i + 1);
|
|
|
|
return;
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2013-12-29 17:25:56 +06:00
|
|
|
}
|
2009-12-22 12:01:32 +00:00
|
|
|
|
2015-10-22 16:48:38 +11:00
|
|
|
/* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */
|
|
|
|
/* is also set by caller renderwin.c */
|
|
|
|
G.is_rendering = true;
|
|
|
|
|
|
|
|
re->flag |= R_ANIMATION;
|
|
|
|
|
2015-11-13 03:22:22 +11:00
|
|
|
{
|
|
|
|
for (nfra = sfra, scene->r.cfra = sfra; scene->r.cfra <= efra; scene->r.cfra++) {
|
|
|
|
char name[FILE_MAX];
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2015-11-13 03:22:22 +11:00
|
|
|
/* Special case for 'mh->get_next_frame'
|
|
|
|
* this overrides regular frame stepping logic */
|
2015-11-13 11:05:14 +05:00
|
|
|
if (mh && mh->get_next_frame) {
|
2015-11-13 03:22:22 +11:00
|
|
|
while (G.is_break == false) {
|
|
|
|
int nfra_test = mh->get_next_frame(re->movie_ctx_arr[0], &re->r, re->reports);
|
|
|
|
if (nfra_test >= 0 && nfra_test >= sfra && nfra_test <= efra) {
|
|
|
|
nfra = nfra_test;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (re->test_break(re->tbh)) {
|
|
|
|
G.is_break = true;
|
|
|
|
}
|
|
|
|
}
|
2012-08-08 18:37:06 +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
|
|
|
}
|
2015-11-12 19:31:43 +05:00
|
|
|
|
|
|
|
/* Here is a feedback loop exists -- render initialization requires updated
|
|
|
|
* render layers settings which could be animated, but scene evaluation for
|
|
|
|
* the frame happens later because it depends on what layers are visible to
|
|
|
|
* render engine.
|
|
|
|
*
|
|
|
|
* The idea here is to only evaluate animation data associated with the scene,
|
|
|
|
* which will make sure render layer settings are up-to-date, initialize the
|
|
|
|
* render database itself and then perform full scene update with only needed
|
|
|
|
* layers.
|
|
|
|
* -sergey-
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
float ctime = BKE_scene_frame_get(scene);
|
|
|
|
AnimData *adt = BKE_animdata_from_id(&scene->id);
|
|
|
|
BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, ADT_RECALC_ALL);
|
|
|
|
}
|
|
|
|
|
2008-09-11 16:37:53 +00:00
|
|
|
/* only border now, todo: camera lens. (ton) */
|
2014-05-22 14:39:31 +02:00
|
|
|
render_initialize_from_main(re, &rd, bmain, scene, NULL, camera_override, lay_override, 1, 0);
|
2008-09-19 21:57:15 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (nfra != scene->r.cfra) {
|
2008-09-19 21:57:15 +00:00
|
|
|
/*
|
|
|
|
* Skip this frame, but update for physics and particles system.
|
|
|
|
* From convertblender.c:
|
|
|
|
* in localview, lamps are using normal layers, objects only local bits.
|
|
|
|
*/
|
2010-03-14 20:24:11 +00:00
|
|
|
unsigned int updatelay;
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->lay & 0xFF000000)
|
2012-06-13 17:23:44 +00:00
|
|
|
updatelay = re->lay & 0xFF000000;
|
2008-09-19 21:57:15 +00:00
|
|
|
else
|
2012-06-13 17:23:44 +00:00
|
|
|
updatelay = re->lay;
|
2008-09-19 21:57:15 +00:00
|
|
|
|
2013-12-26 17:24:42 +06:00
|
|
|
BKE_scene_update_for_newframe(re->eval_ctx, bmain, scene, updatelay);
|
2008-09-19 21:57:15 +00:00
|
|
|
continue;
|
|
|
|
}
|
2008-09-29 22:31:47 +00:00
|
|
|
else
|
2012-06-13 17:23:44 +00:00
|
|
|
nfra += tfra;
|
2008-09-19 21:57:15 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* Touch/NoOverwrite options are only valid for image's */
|
2015-04-06 10:40:12 -03:00
|
|
|
if (is_movie == false) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->r.mode & (R_NO_OVERWRITE | R_TOUCH))
|
2015-01-24 16:48:23 +11:00
|
|
|
BKE_image_path_from_imformat(
|
|
|
|
name, scene->r.pic, bmain->name, scene->r.cfra,
|
2015-04-06 10:40:12 -03:00
|
|
|
&scene->r.im_format, (scene->r.scemode & R_EXTENSION) != 0, true, NULL);
|
|
|
|
|
|
|
|
if (scene->r.mode & R_NO_OVERWRITE) {
|
|
|
|
if (!is_multiview_name) {
|
|
|
|
if (BLI_exists(name)) {
|
|
|
|
printf("skipping existing frame \"%s\"\n", name);
|
|
|
|
totskipped++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
SceneRenderView *srv;
|
|
|
|
bool is_skip = false;
|
|
|
|
char filepath[FILE_MAX];
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
|
|
|
|
|
|
|
if (BLI_exists(filepath)) {
|
|
|
|
is_skip = true;
|
|
|
|
printf("skipping existing frame \"%s\" for view \"%s\"\n", filepath, srv->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_skip) {
|
|
|
|
totskipped++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
if (scene->r.mode & R_TOUCH) {
|
|
|
|
if (!is_multiview_name) {
|
|
|
|
if (!BLI_exists(name)) {
|
|
|
|
BLI_make_existing_file(name); /* makes the dir if its not there */
|
|
|
|
BLI_file_touch(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
SceneRenderView *srv;
|
|
|
|
char filepath[FILE_MAX];
|
|
|
|
|
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
|
|
|
|
|
|
|
if (!BLI_exists(filepath)) {
|
|
|
|
BLI_make_existing_file(filepath); /* makes the dir if its not there */
|
|
|
|
BLI_file_touch(filepath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2008-01-20 17:53:58 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->r.cfra = scene->r.cfra; /* weak.... */
|
2011-06-24 16:54:30 +00:00
|
|
|
|
|
|
|
/* run callbacs before rendering, before the scene is updated */
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE);
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2008-01-20 17:53:58 +00:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
do_render_all_options(re);
|
2011-12-08 14:21:55 +00:00
|
|
|
totrendered++;
|
2008-01-20 17:53:58 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->test_break(re->tbh) == 0) {
|
2012-08-08 18:37:06 +00:00
|
|
|
if (!G.is_break)
|
2015-04-06 10:40:12 -03:00
|
|
|
if (!do_write_image_or_movie(re, bmain, scene, mh, totvideos, NULL))
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = true;
|
2009-12-22 12:01:32 +00:00
|
|
|
}
|
2009-09-30 18:18:32 +00:00
|
|
|
else
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = true;
|
2006-02-05 19:16:32 +00:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
if (G.is_break == true) {
|
2008-01-21 22:10:20 +00:00
|
|
|
/* remove touched file */
|
2015-04-06 10:40:12 -03:00
|
|
|
if (is_movie == false) {
|
|
|
|
if ((scene->r.mode & R_TOUCH)) {
|
|
|
|
if (!is_multiview_name) {
|
|
|
|
if ((BLI_file_size(name) == 0)) {
|
|
|
|
/* BLI_exists(name) is implicit */
|
|
|
|
BLI_delete(name, false, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
SceneRenderView *srv;
|
|
|
|
char filepath[FILE_MAX];
|
|
|
|
|
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
|
|
|
|
|
|
|
if ((BLI_file_size(filepath) == 0)) {
|
|
|
|
/* BLI_exists(filepath) is implicit */
|
|
|
|
BLI_delete(filepath, false, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2008-01-21 22:10:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
if (G.is_break == false) {
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */
|
2014-12-01 18:27:45 +01:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_WRITE);
|
2011-06-24 16:54:30 +00:00
|
|
|
}
|
2006-02-05 19:16:32 +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
|
|
|
}
|
|
|
|
|
|
|
|
/* end movie */
|
2015-04-06 10:40:12 -03:00
|
|
|
if (is_movie) {
|
2015-10-22 16:48:38 +11:00
|
|
|
re_movie_free_all(re, mh, totvideos);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2011-12-08 14:21:55 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (totskipped && totrendered == 0)
|
2011-12-08 14:21:55 +00:00
|
|
|
BKE_report(re->reports, RPT_INFO, "No frames rendered, skipped to not overwrite");
|
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
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
scene->r.cfra = cfrao;
|
2010-06-27 05:39:55 +00:00
|
|
|
|
2011-11-02 13:36:28 +00:00
|
|
|
re->flag &= ~R_ANIMATION;
|
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
BLI_callback_exec(re->main, (ID *)scene, G.is_break ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE);
|
2017-01-06 18:18:20 +01:00
|
|
|
BKE_sound_reset_scene_specs(scene);
|
2012-03-11 17:24:03 +00:00
|
|
|
|
2006-05-21 20:59:54 +00:00
|
|
|
/* UGLY WARNING */
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_rendering = false;
|
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
|
|
|
}
|
|
|
|
|
2010-08-01 20:36:24 +00:00
|
|
|
void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
|
2010-03-28 13:48:11 +00:00
|
|
|
{
|
2011-04-30 10:02:23 +00:00
|
|
|
Object *camera;
|
2010-03-28 13:48:11 +00:00
|
|
|
int winx, winy;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
winx = (sce->r.size * sce->r.xsch) / 100;
|
|
|
|
winy = (sce->r.size * sce->r.ysch) / 100;
|
2010-03-28 13:48:11 +00:00
|
|
|
|
|
|
|
RE_InitState(re, NULL, &sce->r, NULL, winx, winy, NULL);
|
|
|
|
|
2013-01-21 08:49:42 +00:00
|
|
|
re->pool = BKE_image_pool_new();
|
|
|
|
|
2010-08-01 20:36:24 +00:00
|
|
|
re->main = bmain;
|
2010-03-28 13:48:11 +00:00
|
|
|
re->scene = sce;
|
2012-10-10 05:56:49 +00:00
|
|
|
re->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
|
2010-03-28 13:48:11 +00:00
|
|
|
re->lay = sce->lay;
|
|
|
|
|
2011-04-30 13:47:25 +00:00
|
|
|
camera = RE_GetCamera(re);
|
2011-04-30 04:29:36 +00:00
|
|
|
RE_SetCamera(re, camera);
|
2010-03-28 13:48:11 +00:00
|
|
|
|
|
|
|
do_render_3d(re);
|
2013-01-21 08:49:42 +00:00
|
|
|
|
|
|
|
BKE_image_pool_free(re->pool);
|
|
|
|
re->pool = NULL;
|
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
|
|
|
}
|
|
|
|
|
2006-03-14 17:44:19 +00:00
|
|
|
/* note; repeated win/disprect calc... solve that nicer, also in compo */
|
|
|
|
|
2008-01-28 16:33:59 +00:00
|
|
|
/* only the temp file! */
|
2014-04-01 11:34:00 +11:00
|
|
|
bool RE_ReadRenderResult(Scene *scene, Scene *scenode)
|
2006-03-14 17:44:19 +00:00
|
|
|
{
|
|
|
|
Render *re;
|
2014-04-01 11:34:00 +11:00
|
|
|
int winx, winy;
|
|
|
|
bool success;
|
2006-03-14 17:44:19 +00:00
|
|
|
rcti disprect;
|
|
|
|
|
|
|
|
/* calculate actual render result and display size */
|
2012-06-13 17:23:44 +00:00
|
|
|
winx = (scene->r.size * scene->r.xsch) / 100;
|
|
|
|
winy = (scene->r.size * scene->r.ysch) / 100;
|
2006-03-14 17:44:19 +00:00
|
|
|
|
|
|
|
/* only in movie case we render smaller part */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scene->r.mode & R_BORDER) {
|
2012-06-13 17:23:44 +00:00
|
|
|
disprect.xmin = scene->r.border.xmin * winx;
|
|
|
|
disprect.xmax = scene->r.border.xmax * winx;
|
2006-03-14 17:44:19 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
disprect.ymin = scene->r.border.ymin * winy;
|
|
|
|
disprect.ymax = scene->r.border.ymax * winy;
|
2006-03-14 17:44:19 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
disprect.xmin = disprect.ymin = 0;
|
|
|
|
disprect.xmax = winx;
|
|
|
|
disprect.ymax = winy;
|
2006-03-14 17:44:19 +00:00
|
|
|
}
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (scenode)
|
2012-06-13 17:23:44 +00:00
|
|
|
scene = scenode;
|
2006-03-14 17:44:19 +00:00
|
|
|
|
2008-01-31 15:35:24 +00:00
|
|
|
/* get render: it can be called from UI with draw callbacks */
|
2017-09-12 11:27:22 +05:00
|
|
|
re = RE_GetSceneRender(scene);
|
2012-06-13 17:23:44 +00:00
|
|
|
if (re == NULL)
|
2017-09-12 11:27:22 +05:00
|
|
|
re = RE_NewSceneRender(scene);
|
2010-01-06 00:09:07 +00:00
|
|
|
RE_InitState(re, NULL, &scene->r, NULL, winx, winy, &disprect);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->scene = scene;
|
2012-10-10 05:56:49 +00:00
|
|
|
re->scene_color_manage = BKE_scene_check_color_management_enabled(scene);
|
2006-03-14 17:44:19 +00:00
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
2014-06-28 19:13:54 +02:00
|
|
|
success = render_result_exr_file_cache_read(re);
|
2012-01-05 17:50:09 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
|
2016-07-02 14:22:25 +02:00
|
|
|
render_result_uncrop(re);
|
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
return success;
|
2006-03-14 17:44:19 +00:00
|
|
|
}
|
2006-11-29 19:31:45 +00:00
|
|
|
|
2008-05-14 16:40:25 +00:00
|
|
|
void RE_init_threadcount(Render *re)
|
|
|
|
{
|
2013-05-08 13:23:17 +00:00
|
|
|
re->r.threads = BKE_render_num_threads(&re->r);
|
2008-05-14 16:40:25 +00:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
/* loads in image into a result, size must match
|
2012-03-18 07:38:51 +00:00
|
|
|
* x/y offsets are only used on a partial copy when dimensions don't match */
|
2011-02-08 10:31:47 +00:00
|
|
|
void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char *filename, int x, int y)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
/* OCIO_TODO: assume layer was saved in defaule color space */
|
|
|
|
ImBuf *ibuf = IMB_loadiffname(filename, IB_rect, NULL);
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderPass *rpass = NULL;
|
|
|
|
|
|
|
|
/* multiview: since the API takes no 'view', we use the first combined pass found */
|
|
|
|
for (rpass = layer->passes.first; rpass; rpass = rpass->next)
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
if (STREQ(rpass->name, RE_PASSNAME_COMBINED))
|
2015-04-06 10:40:12 -03:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (rpass == NULL)
|
2015-04-06 20:43:34 +02:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "%s: no Combined pass found in the render layer '%s'", __func__, filename);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-20 19:49:27 +00:00
|
|
|
if (ibuf && (ibuf->rect || ibuf->rect_float)) {
|
2009-09-18 22:25:49 +00:00
|
|
|
if (ibuf->x == layer->rectx && ibuf->y == layer->recty) {
|
2012-06-13 17:23:44 +00:00
|
|
|
if (ibuf->rect_float == NULL)
|
2009-09-18 22:25:49 +00:00
|
|
|
IMB_float_from_rect(ibuf);
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
memcpy(rpass->rect, ibuf->rect_float, sizeof(float) * 4 * layer->rectx * layer->recty);
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-02-08 10:31:47 +00:00
|
|
|
if ((ibuf->x - x >= layer->rectx) && (ibuf->y - y >= layer->recty)) {
|
2009-09-18 22:25:49 +00:00
|
|
|
ImBuf *ibuf_clip;
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (ibuf->rect_float == NULL)
|
2009-09-18 22:25:49 +00:00
|
|
|
IMB_float_from_rect(ibuf);
|
|
|
|
|
2010-10-16 14:32:17 +00:00
|
|
|
ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ibuf_clip) {
|
2012-04-29 15:47:02 +00:00
|
|
|
IMB_rectcpy(ibuf_clip, ibuf, 0, 0, x, y, layer->rectx, layer->recty);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
memcpy(rpass->rect, ibuf_clip->rect_float, sizeof(float) * 4 * layer->rectx * layer->recty);
|
2009-09-18 22:25:49 +00:00
|
|
|
IMB_freeImBuf(ibuf_clip);
|
|
|
|
}
|
|
|
|
else {
|
2015-04-02 14:51:37 +02:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "%s: failed to allocate clip buffer '%s'", __func__, filename);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2015-04-02 14:51:37 +02:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "%s: incorrect dimensions for partial copy '%s'", __func__, filename);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
IMB_freeImBuf(ibuf);
|
|
|
|
}
|
|
|
|
else {
|
2015-04-02 14:51:37 +02:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "%s: failed to load '%s'", __func__, filename);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
void RE_result_load_from_file(RenderResult *result, ReportList *reports, const char *filename)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
2012-09-04 13:29:07 +00:00
|
|
|
if (!render_result_exr_file_read_path(result, NULL, filename)) {
|
2015-04-02 14:51:37 +02:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "%s: failed to load '%s'", __func__, filename);
|
2009-09-18 22:25:49 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-29 15:47:02 +00:00
|
|
|
const float default_envmap_layout[] = { 0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1 };
|
2011-08-28 23:24:34 +00:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
bool RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env, const char *relpath, const char imtype, float layout[12])
|
2011-08-28 23:24:34 +00:00
|
|
|
{
|
2011-11-21 20:19:58 +00:00
|
|
|
ImageFormatData imf;
|
2012-06-13 17:23:44 +00:00
|
|
|
ImBuf *ibuf = NULL;
|
2011-08-28 23:24:34 +00:00
|
|
|
int ok;
|
|
|
|
int dx;
|
2012-06-13 17:23:44 +00:00
|
|
|
int maxX = 0, maxY = 0, i = 0;
|
2011-08-28 23:24:34 +00:00
|
|
|
char filepath[FILE_MAX];
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (env->cube[1] == NULL) {
|
2011-08-28 23:24:34 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "There is no generated environment map available to save");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
imf = scene->r.im_format;
|
|
|
|
imf.imtype = imtype;
|
2011-11-21 20:19:58 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
dx = env->cube[1]->x;
|
2011-08-28 23:24:34 +00:00
|
|
|
|
|
|
|
if (env->type == ENV_CUBE) {
|
2012-06-13 17:23:44 +00:00
|
|
|
for (i = 0; i < 12; i += 2) {
|
2012-11-07 12:31:05 +00:00
|
|
|
maxX = max_ii(maxX, (int)layout[i] + 1);
|
|
|
|
maxY = max_ii(maxY, (int)layout[i + 1] + 1);
|
2011-08-28 23:24:34 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
ibuf = IMB_allocImBuf(maxX * dx, maxY * dx, 24, IB_rectfloat);
|
2011-08-28 23:24:34 +00:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (i = 0; i < 12; i += 2)
|
|
|
|
if (layout[i] > -1 && layout[i + 1] > -1)
|
|
|
|
IMB_rectcpy(ibuf, env->cube[i / 2], layout[i] * dx, layout[i + 1] * dx, 0, 0, dx, dx);
|
2011-08-28 23:24:34 +00:00
|
|
|
}
|
|
|
|
else if (env->type == ENV_PLANE) {
|
|
|
|
ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat);
|
|
|
|
IMB_rectcpy(ibuf, env->cube[1], 0, 0, 0, 0, dx, dx);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BKE_report(reports, RPT_ERROR, "Invalid environment map type");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-09-05 17:13:43 +00:00
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf, true, false, &scene->view_settings, &scene->display_settings, &imf);
|
2011-08-28 23:24:34 +00:00
|
|
|
|
|
|
|
/* to save, we first get absolute path */
|
|
|
|
BLI_strncpy(filepath, relpath, sizeof(filepath));
|
|
|
|
BLI_path_abs(filepath, G.main->name);
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
ok = BKE_imbuf_write(ibuf, filepath, &imf);
|
2011-08-28 23:24:34 +00:00
|
|
|
|
|
|
|
IMB_freeImBuf(ibuf);
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ok) {
|
2014-04-01 11:34:00 +11:00
|
|
|
return true;
|
2011-08-28 23:24:34 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-10-21 14:02:30 +00:00
|
|
|
BKE_report(reports, RPT_ERROR, "Error writing environment map");
|
2014-04-01 11:34:00 +11:00
|
|
|
return false;
|
2011-08-28 23:24:34 +00:00
|
|
|
}
|
|
|
|
}
|
2011-10-22 16:24:28 +00:00
|
|
|
|
2017-10-26 14:17:58 +02:00
|
|
|
/* Used in the interface to decide whether to show layers or passes. */
|
2015-04-06 10:40:12 -03:00
|
|
|
bool RE_layers_have_name(struct RenderResult *rr)
|
|
|
|
{
|
|
|
|
switch (BLI_listbase_count_ex(&rr->layers, 2)) {
|
|
|
|
case 0:
|
|
|
|
return false;
|
|
|
|
case 1:
|
|
|
|
return (((RenderLayer *)rr->layers.first)->name[0] != '\0');
|
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-10-26 14:17:58 +02:00
|
|
|
bool RE_passes_have_name(struct RenderLayer *rl)
|
|
|
|
{
|
|
|
|
for (RenderPass *rp = rl->passes.first; rp; rp = rp->next) {
|
|
|
|
if (!STREQ(rp->name, "Combined")) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
RenderPass *RE_pass_find_by_name(volatile RenderLayer *rl, const char *name, const char *viewname)
|
2015-04-17 09:48:31 -03:00
|
|
|
{
|
2015-05-18 10:57:59 -03:00
|
|
|
RenderPass *rp = NULL;
|
|
|
|
|
|
|
|
for (rp = rl->passes.last; rp; rp = rp->prev) {
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
if (STREQ(rp->name, name)) {
|
2015-05-25 10:14:19 -03:00
|
|
|
if (viewname == NULL || viewname[0] == '\0')
|
2015-05-18 10:57:59 -03:00
|
|
|
break;
|
|
|
|
else if (STREQ(rp->view, viewname))
|
|
|
|
break;
|
2015-04-17 09:48:31 -03:00
|
|
|
}
|
|
|
|
}
|
2015-05-18 10:57:59 -03:00
|
|
|
return rp;
|
2015-04-17 09:48:31 -03:00
|
|
|
}
|
2016-08-03 23:31:48 +02:00
|
|
|
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
/* Only provided for API compatibility, don't use this in new code! */
|
|
|
|
RenderPass *RE_pass_find_by_type(volatile RenderLayer *rl, int passtype, const char *viewname)
|
|
|
|
{
|
|
|
|
#define CHECK_PASS(NAME) \
|
|
|
|
if (passtype == SCE_PASS_ ## NAME) \
|
|
|
|
return RE_pass_find_by_name(rl, RE_PASSNAME_ ## NAME, viewname);
|
|
|
|
|
|
|
|
CHECK_PASS(COMBINED);
|
|
|
|
CHECK_PASS(Z);
|
|
|
|
CHECK_PASS(VECTOR);
|
|
|
|
CHECK_PASS(NORMAL);
|
|
|
|
CHECK_PASS(UV);
|
|
|
|
CHECK_PASS(RGBA);
|
|
|
|
CHECK_PASS(EMIT);
|
|
|
|
CHECK_PASS(DIFFUSE);
|
|
|
|
CHECK_PASS(SPEC);
|
|
|
|
CHECK_PASS(SHADOW);
|
|
|
|
CHECK_PASS(AO);
|
|
|
|
CHECK_PASS(ENVIRONMENT);
|
|
|
|
CHECK_PASS(INDIRECT);
|
|
|
|
CHECK_PASS(REFLECT);
|
|
|
|
CHECK_PASS(REFRACT);
|
|
|
|
CHECK_PASS(INDEXOB);
|
|
|
|
CHECK_PASS(INDEXMA);
|
|
|
|
CHECK_PASS(MIST);
|
|
|
|
CHECK_PASS(RAYHITS);
|
|
|
|
CHECK_PASS(DIFFUSE_DIRECT);
|
|
|
|
CHECK_PASS(DIFFUSE_INDIRECT);
|
|
|
|
CHECK_PASS(DIFFUSE_COLOR);
|
|
|
|
CHECK_PASS(GLOSSY_DIRECT);
|
|
|
|
CHECK_PASS(GLOSSY_INDIRECT);
|
|
|
|
CHECK_PASS(GLOSSY_COLOR);
|
|
|
|
CHECK_PASS(TRANSM_DIRECT);
|
|
|
|
CHECK_PASS(TRANSM_INDIRECT);
|
|
|
|
CHECK_PASS(TRANSM_COLOR);
|
|
|
|
CHECK_PASS(SUBSURFACE_DIRECT);
|
|
|
|
CHECK_PASS(SUBSURFACE_INDIRECT);
|
|
|
|
CHECK_PASS(SUBSURFACE_COLOR);
|
|
|
|
|
|
|
|
#undef CHECK_PASS
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-08-03 23:31:48 +02:00
|
|
|
/* create a renderlayer and renderpass for grease pencil layer */
|
|
|
|
RenderPass *RE_create_gp_pass(RenderResult *rr, const char *layername, const char *viewname)
|
|
|
|
{
|
|
|
|
RenderLayer *rl = BLI_findstring(&rr->layers, layername, offsetof(RenderLayer, name));
|
|
|
|
/* only create render layer if not exist */
|
|
|
|
if (!rl) {
|
|
|
|
rl = MEM_callocN(sizeof(RenderLayer), layername);
|
|
|
|
BLI_addtail(&rr->layers, rl);
|
|
|
|
BLI_strncpy(rl->name, layername, sizeof(rl->name));
|
|
|
|
rl->lay = 0;
|
|
|
|
rl->layflag = SCE_LAY_SOLID;
|
|
|
|
rl->passflag = SCE_PASS_COMBINED;
|
|
|
|
rl->rectx = rr->rectx;
|
|
|
|
rl->recty = rr->recty;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* clear previous pass if exist or the new image will be over previous one*/
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_COMBINED, viewname);
|
2016-08-03 23:31:48 +02:00
|
|
|
if (rp) {
|
|
|
|
if (rp->rect) {
|
|
|
|
MEM_freeN(rp->rect);
|
|
|
|
}
|
|
|
|
BLI_freelinkN(&rl->passes, rp);
|
|
|
|
}
|
|
|
|
/* create a totally new pass */
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
return gp_add_pass(rr, rl, 4, RE_PASSNAME_COMBINED, viewname);
|
2016-08-03 23:31:48 +02:00
|
|
|
}
|