2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
* Copyright 2006 Blender Foundation. All rights reserved. */
|
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
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup render
|
2011-02-27 19:31:27 +00:00
|
|
|
*/
|
|
|
|
|
2020-03-19 09:33:03 +01: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
|
|
|
#include <limits.h>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <math.h>
|
2011-04-12 15:55:38 +00:00
|
|
|
#include <stddef.h>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.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"
|
2018-08-29 15:32:50 +02:00
|
|
|
#include "DNA_collection_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"
|
2018-02-06 14:47:02 +01:00
|
|
|
#include "DNA_particle_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_scene_types.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "DNA_sequence_types.h"
|
2020-09-24 16:14:49 +02:00
|
|
|
#include "DNA_space_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"
|
|
|
|
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BLI_fileops.h"
|
|
|
|
#include "BLI_listbase.h"
|
2013-01-10 16:37:48 +00:00
|
|
|
#include "BLI_math.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BLI_path_util.h"
|
2013-01-10 16:37:48 +00:00
|
|
|
#include "BLI_rect.h"
|
|
|
|
#include "BLI_string.h"
|
|
|
|
#include "BLI_threads.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BLI_timecode.h"
|
2013-01-10 16:37:48 +00:00
|
|
|
|
2015-08-16 17:32:01 +10:00
|
|
|
#include "BLT_translation.h"
|
2013-03-10 16:55:01 +00:00
|
|
|
|
2020-04-03 13:07:36 +02:00
|
|
|
#include "BKE_anim_data.h"
|
2012-06-13 17:23:44 +00:00
|
|
|
#include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */
|
2019-09-05 15:52:38 +02:00
|
|
|
#include "BKE_callbacks.h"
|
2011-11-05 13:00:39 +00:00
|
|
|
#include "BKE_camera.h"
|
2015-10-27 19:00:51 +05:00
|
|
|
#include "BKE_colortools.h"
|
2018-07-03 12:32:01 +02:00
|
|
|
#include "BKE_context.h" /* XXX needed by wm_window.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"
|
2017-07-13 15:43:36 +02:00
|
|
|
#include "BKE_layer.h"
|
2020-02-10 12:58:59 +01:00
|
|
|
#include "BKE_lib_id.h"
|
|
|
|
#include "BKE_lib_remap.h"
|
2018-12-29 17:15:28 +01:00
|
|
|
#include "BKE_mask.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"
|
2018-11-07 18:00:24 +01:00
|
|
|
#include "BKE_object.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"
|
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 */
|
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
|
|
|
|
2022-01-24 16:18:30 -06:00
|
|
|
#include "NOD_composite.h"
|
|
|
|
|
2017-04-06 16:38:43 +02:00
|
|
|
#include "DEG_depsgraph.h"
|
2018-02-20 12:55:02 -03:00
|
|
|
#include "DEG_depsgraph_build.h"
|
2019-05-20 15:14:10 +02:00
|
|
|
#include "DEG_depsgraph_debug.h"
|
2018-02-20 12:55:02 -03:00
|
|
|
#include "DEG_depsgraph_query.h"
|
2017-04-06 16:38:43 +02: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
|
|
|
#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"
|
2018-04-05 16:27:15 +02:00
|
|
|
#include "IMB_metadata.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "PIL_time.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"
|
2020-11-09 15:42:38 +01:00
|
|
|
#include "RE_texture.h"
|
2008-05-18 13:01:52 +00:00
|
|
|
|
2020-12-19 06:44:57 +01:00
|
|
|
#include "SEQ_relations.h"
|
|
|
|
#include "SEQ_render.h"
|
2020-11-01 21:03:31 +01:00
|
|
|
|
2020-11-06 10:36:51 -05:00
|
|
|
#include "../../windowmanager/WM_api.h" /* XXX */
|
|
|
|
#include "../../windowmanager/wm_window.h" /* XXX */
|
2018-07-17 21:11:23 +02:00
|
|
|
#include "GPU_context.h"
|
2018-06-11 13:54:31 +02: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 */
|
2020-11-06 10:43:50 -05:00
|
|
|
#include "pipeline.h"
|
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"
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Globals
|
|
|
|
* \{ */
|
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
|
|
|
|
|
|
|
/* here we store all renders */
|
2010-02-09 19:37:37 +00:00
|
|
|
static struct {
|
|
|
|
ListBase renderlist;
|
2018-06-08 08:07:48 +02: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
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Callbacks
|
|
|
|
* \{ */
|
2019-09-09 16:39:07 +02:00
|
|
|
|
|
|
|
static void render_callback_exec_null(Render *re, Main *bmain, eCbEvent evt)
|
|
|
|
{
|
|
|
|
if (re->r.scemode & R_BUTS_PREVIEW) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
BKE_callback_exec_null(bmain, evt);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void render_callback_exec_id(Render *re, Main *bmain, ID *id, eCbEvent evt)
|
|
|
|
{
|
|
|
|
if (re->r.scemode & R_BUTS_PREVIEW) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
BKE_callback_exec_id(bmain, id, evt);
|
|
|
|
}
|
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Allocation & Free
|
|
|
|
* \{ */
|
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 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
|
|
|
|
|
|
|
/* 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))
|
2006-02-15 15:22:49 +00:00
|
|
|
{
|
|
|
|
}
|
2016-03-10 19:34:53 +11:00
|
|
|
static void result_rcti_nothing(void *UNUSED(arg),
|
|
|
|
RenderResult *UNUSED(rr),
|
2022-03-15 20:53:10 -07:00
|
|
|
struct rcti *UNUSED(rect))
|
2016-01-11 12:32:29 +11:00
|
|
|
{
|
|
|
|
}
|
|
|
|
static void current_scene_nothing(void *UNUSED(arg), Scene *UNUSED(scene))
|
|
|
|
{
|
|
|
|
}
|
2016-03-10 19:34:53 +11:00
|
|
|
static void stats_nothing(void *UNUSED(arg), RenderStats *UNUSED(rs))
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
|
|
|
}
|
2016-03-10 19:34:53 +11:00
|
|
|
static void float_nothing(void *UNUSED(arg), float UNUSED(val))
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
|
|
|
}
|
2016-03-10 19:34:53 +11:00
|
|
|
static int default_break(void *UNUSED(arg))
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
2016-03-10 19:34:53 +11:00
|
|
|
return G.is_break == true;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2016-01-11 12:32:29 +11:00
|
|
|
|
2010-10-16 14:32:17 +00:00
|
|
|
static void stats_background(void *UNUSED(arg), RenderStats *rs)
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
2020-10-29 12:22:25 +01:00
|
|
|
if (rs->infostr == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-05-20 00:24:26 +02:00
|
|
|
uintptr_t mem_in_use, peak_memory;
|
|
|
|
float megs_used_memory, megs_peak_memory;
|
2015-06-17 16:06:33 +02:00
|
|
|
char info_time_str[32];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
mem_in_use = MEM_get_memory_in_use();
|
2010-05-04 12:31:24 +00:00
|
|
|
peak_memory = MEM_get_peak_memory();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-05-20 00:24:26 +02:00
|
|
|
megs_used_memory = (mem_in_use) / (1024.0 * 1024.0);
|
2012-06-13 17:23:44 +00:00
|
|
|
megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-03-10 16:55:01 +00:00
|
|
|
fprintf(stdout,
|
2020-05-20 00:24:26 +02:00
|
|
|
TIP_("Fra:%d Mem:%.2fM (Peak %.2fM) "),
|
2013-03-10 16:55:01 +00:00
|
|
|
rs->cfra,
|
2011-11-11 13:09:14 +00:00
|
|
|
megs_used_memory,
|
|
|
|
megs_peak_memory);
|
2019-04-17 06:17:24 +02: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);
|
2019-06-11 22:25:01 +02:00
|
|
|
fprintf(stdout, TIP_("| Time:%s | "), info_time_str);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-10-29 12:22:25 +01:00
|
|
|
fprintf(stdout, "%s", rs->infostr);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-06-17 15:49:09 +02:00
|
|
|
/* Flush stdout to be sure python callbacks are printing stuff after blender. */
|
2011-02-12 01:02:21 +00:00
|
|
|
fflush(stdout);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 03:05:53 +10:00
|
|
|
/* NOTE: using G_MAIN seems valid here???
|
|
|
|
* Not sure it's actually even used anyway, we could as well pass NULL? */
|
2019-09-09 10:25:04 +02:00
|
|
|
BKE_callback_exec_null(G_MAIN, BKE_CB_EVT_RENDER_STATS);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-18 07:28:10 +00:00
|
|
|
fputc('\n', stdout);
|
2011-02-12 01:02:21 +00:00
|
|
|
fflush(stdout);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2011-02-08 10:31:47 +00:00
|
|
|
static void render_print_save_message(ReportList *reports, const char *name, int ok, int err)
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
static int render_imbuf_write_stamp_test(ReportList *reports,
|
2018-04-24 15:20:17 +02:00
|
|
|
Scene *scene,
|
2015-04-29 11:26:30 -03:00
|
|
|
struct RenderResult *rr,
|
2016-01-11 12:32:29 +11:00
|
|
|
ImBuf *ibuf,
|
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
|
|
|
const char *name,
|
2016-01-11 12:32:29 +11:00
|
|
|
const ImageFormatData *imf,
|
|
|
|
bool stamp)
|
2019-04-17 06:17:24 +02:00
|
|
|
{
|
|
|
|
int ok;
|
|
|
|
|
2016-01-11 12:32:29 +11:00
|
|
|
if (stamp) {
|
|
|
|
/* writes the name of the individual cameras */
|
|
|
|
ok = BKE_imbuf_write_stamp(scene, rr, ibuf, name, imf);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-01-11 12:32:29 +11:00
|
|
|
ok = BKE_imbuf_write(ibuf, name, imf);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
render_print_save_message(reports, name, ok, errno);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-01-11 12:32:29 +11:00
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2020-09-04 20:59:13 +02:00
|
|
|
void RE_FreeRenderResult(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
|
|
|
{
|
2020-09-04 20:59:13 +02:00
|
|
|
render_result_free(rr);
|
2006-02-02 17:54:22 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 20:53:10 -07:00
|
|
|
float *RE_RenderLayerGetPass(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;
|
|
|
|
}
|
2020-08-07 13:37:22 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2018-03-15 23:36:15 +01:00
|
|
|
bool RE_HasSingleLayer(Render *re)
|
|
|
|
{
|
|
|
|
return (re->r.scemode & R_SINGLE_LAYER);
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2018-03-16 04:16:21 +01:00
|
|
|
ViewLayer *view_layer = BLI_findlink(&re->view_layers, re->active_view_layer);
|
2018-03-15 23:36:15 +01:00
|
|
|
|
2018-03-16 04:16:21 +01:00
|
|
|
if (view_layer) {
|
2018-03-15 23:36:15 +01:00
|
|
|
RenderLayer *rl = BLI_findstring(&rr->layers, view_layer->name, offsetof(RenderLayer, name));
|
|
|
|
|
|
|
|
if (rl) {
|
|
|
|
return rl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
static bool render_scene_has_layers_to_render(Scene *scene, ViewLayer *single_layer)
|
2014-05-15 18:21:02 +02:00
|
|
|
{
|
2018-04-24 15:20:17 +02:00
|
|
|
if (single_layer) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
ViewLayer *view_layer;
|
|
|
|
for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) {
|
|
|
|
if (view_layer->flag & VIEW_LAYER_RENDER) {
|
2014-05-15 18:21:02 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Public Render API
|
|
|
|
* \{ */
|
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 */
|
2019-04-22 09:08:06 +10:00
|
|
|
for (re = RenderGlobal.renderlist.first; re; re = re->next) {
|
|
|
|
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;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
|
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);
|
2021-08-04 15:37:18 +02:00
|
|
|
render_result_passes_allocated_ensure(re->result);
|
2009-09-30 18:18:32 +00:00
|
|
|
return re->result;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-06-14 22:46:30 +02:00
|
|
|
void RE_ClearResult(Render *re)
|
|
|
|
{
|
|
|
|
if (re) {
|
|
|
|
render_result_free(re->result);
|
|
|
|
re->result = 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)
|
|
|
|
{
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re) {
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2009-09-30 18:18:32 +00:00
|
|
|
}
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
Scene *RE_GetScene(Render *re)
|
|
|
|
{
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re) {
|
2009-09-18 22:25:49 +00:00
|
|
|
return re->scene;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-03-25 11:42:28 +11:00
|
|
|
void RE_SetScene(Render *re, Scene *sce)
|
2018-09-06 16:33:41 +02:00
|
|
|
{
|
|
|
|
if (re) {
|
|
|
|
re->scene = sce;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RE_ReleaseResultImageViews(Render *re, RenderResult *rr)
|
|
|
|
{
|
|
|
|
if (re) {
|
|
|
|
if (rr) {
|
|
|
|
render_result_views_shallowdelete(rr);
|
|
|
|
}
|
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
rr->rectx = re->result->rectx;
|
|
|
|
rr->recty = re->result->recty;
|
2018-06-08 08:07:48 +02: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
|
|
|
|
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) {
|
2019-04-22 09:08:06 +10: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);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2019-04-22 09:08:06 +10: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);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
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)
|
|
|
|
{
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re) {
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2009-09-30 18:18:32 +00:00
|
|
|
}
|
|
|
|
|
2006-01-24 21:50:23 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
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) {
|
2018-06-08 08:07:48 +02:00
|
|
|
|
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);
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
BLI_mutex_init(&re->engine_draw_mutex);
|
2021-08-25 17:59:41 +02:00
|
|
|
BLI_mutex_init(&re->highlighted_tiles_mutex);
|
2006-05-21 20:59:54 +00:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2010-11-03 11:14:02 +00:00
|
|
|
RE_InitRenderCB(re);
|
|
|
|
|
|
|
|
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
|
|
|
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;
|
2019-04-22 09:08:06 +10:00
|
|
|
if (G.background) {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->stats_draw = stats_background;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
else {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->stats_draw = stats_nothing;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void RE_FreeRender(Render *re)
|
|
|
|
{
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re->engine) {
|
2012-11-09 08:46:53 +00:00
|
|
|
RE_engine_free(re->engine);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2012-11-09 08:46:53 +00:00
|
|
|
|
2009-09-30 18:18:32 +00:00
|
|
|
BLI_rw_mutex_end(&re->resultmutex);
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
BLI_mutex_end(&re->engine_draw_mutex);
|
2021-08-25 17:59:41 +02:00
|
|
|
BLI_mutex_end(&re->highlighted_tiles_mutex);
|
2014-02-21 16:35:23 +01:00
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
BLI_freelistN(&re->view_layers);
|
2015-05-13 01:00:03 -03:00
|
|
|
BLI_freelistN(&re->r.views);
|
|
|
|
|
2019-08-07 03:21:55 +10:00
|
|
|
BKE_curvemapping_free_data(&re->r.mblur_shutter_curve);
|
2015-10-27 19:00:51 +05:00
|
|
|
|
2021-08-25 17:59:41 +02:00
|
|
|
if (re->highlighted_tiles != NULL) {
|
|
|
|
BLI_gset_free(re->highlighted_tiles, MEM_freeN);
|
|
|
|
}
|
|
|
|
|
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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-01-05 17:50:09 +00:00
|
|
|
render_result_free(re->result);
|
|
|
|
render_result_free(re->pushedresult);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2010-02-09 19:37:37 +00:00
|
|
|
BLI_remlink(&RenderGlobal.renderlist, re);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2012-03-26 08:10:12 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.
Previously there option was named Persistent Images and had a more limited
impact on render time and memory.
When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.
For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.
These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-04 23:51:24 +02:00
|
|
|
void RE_FreeAllPersistentData(void)
|
2012-11-09 23:54:58 +00:00
|
|
|
{
|
|
|
|
Render *re;
|
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.
Previously there option was named Persistent Images and had a more limited
impact on render time and memory.
When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.
For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.
These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-04 23:51:24 +02:00
|
|
|
for (re = RenderGlobal.renderlist.first; re != NULL; re = re->next) {
|
|
|
|
if (re->engine != NULL) {
|
|
|
|
BLI_assert(!(re->engine->flag & RE_ENGINE_RENDERING));
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-11-09 23:54:58 +00:00
|
|
|
|
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.
Previously there option was named Persistent Images and had a more limited
impact on render time and memory.
When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.
For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.
These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-04 23:51:24 +02:00
|
|
|
static void re_free_persistent_data(Render *re)
|
|
|
|
{
|
|
|
|
/* If engine is currently rendering, just wait for it to be freed when it finishes rendering. */
|
|
|
|
if (re->engine && !(re->engine->flag & RE_ENGINE_RENDERING)) {
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
}
|
2012-11-13 11:00:46 +00:00
|
|
|
|
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.
Previously there option was named Persistent Images and had a more limited
impact on render time and memory.
When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.
For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.
These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-04 23:51:24 +02:00
|
|
|
void RE_FreePersistentData(const Scene *scene)
|
|
|
|
{
|
|
|
|
/* Render engines can be kept around for quick re-render, this clears all or one scene. */
|
|
|
|
if (scene) {
|
|
|
|
Render *re = RE_GetSceneRender(scene);
|
|
|
|
if (re) {
|
|
|
|
re_free_persistent_data(re);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (Render *re = RenderGlobal.renderlist.first; re; re = re->next) {
|
|
|
|
re_free_persistent_data(re);
|
2012-11-09 23:54:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Initialize State
|
|
|
|
* \{ */
|
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)) {
|
2022-03-17 10:04:45 +11:00
|
|
|
/* NOTE(@sergey): doesn't seem original bordered `disprect` is storing anywhere
|
|
|
|
* after insertion on black happening in #do_render_engine(),
|
|
|
|
* so for now simply re-calculate `disprect` using border from source renderer. */
|
2013-03-14 07:38:37 +00:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2016-02-17 22:18:45 +01:00
|
|
|
void render_copy_renderdata(RenderData *to, RenderData *from)
|
|
|
|
{
|
|
|
|
BLI_freelistN(&to->views);
|
2019-08-07 03:21:55 +10:00
|
|
|
BKE_curvemapping_free_data(&to->mblur_shutter_curve);
|
2016-02-17 22:18:45 +01:00
|
|
|
|
|
|
|
*to = *from;
|
|
|
|
|
|
|
|
BLI_duplicatelist(&to->views, &from->views);
|
2019-08-07 03:21:55 +10:00
|
|
|
BKE_curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
|
2016-02-17 22:18:45 +01:00
|
|
|
}
|
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
void RE_InitState(Render *re,
|
|
|
|
Render *source,
|
|
|
|
RenderData *rd,
|
2018-04-24 15:20:17 +02:00
|
|
|
ListBase *render_layers,
|
|
|
|
ViewLayer *single_layer,
|
2014-06-19 16:21:17 +06:00
|
|
|
int winx,
|
|
|
|
int winy,
|
|
|
|
rcti *disprect)
|
|
|
|
{
|
|
|
|
bool had_freestyle = (re->r.mode & R_EDGE_FRS) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
re->ok = true; /* maybe flag */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
re->i.starttime = PIL_check_seconds_timer();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
/* copy render data and render layers for thread safety */
|
2016-02-17 22:18:45 +01:00
|
|
|
render_copy_renderdata(&re->r, rd);
|
2017-11-22 10:52:39 -02:00
|
|
|
BLI_freelistN(&re->view_layers);
|
|
|
|
BLI_duplicatelist(&re->view_layers, render_layers);
|
2018-04-24 15:20:17 +02:00
|
|
|
re->active_view_layer = 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-06-19 16:21:17 +06:00
|
|
|
/* 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;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-07-10 12:17:13 +02:00
|
|
|
re_init_resolution(re, source, winx, winy, disprect);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-01-15 10:47:13 +00:00
|
|
|
if (re->rectx < 1 || re->recty < 1 ||
|
|
|
|
(BKE_imtype_is_movie(rd->im_format.imtype) && (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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
if (single_layer) {
|
|
|
|
int index = BLI_findindex(render_layers, single_layer);
|
2010-01-06 00:09:07 +00:00
|
|
|
if (index != -1) {
|
2017-11-22 10:52:39 -02:00
|
|
|
re->active_view_layer = index;
|
2010-03-26 10:41:48 +00:00
|
|
|
re->r.scemode |= R_SINGLE_LAYER;
|
2010-01-06 00:09:07 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-11 11:48:16 +02:00
|
|
|
if (re->r.scemode & R_BUTS_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) {
|
2017-11-22 10:52:39 -02:00
|
|
|
ViewLayer *active_render_layer = BLI_findlink(&re->view_layers, re->active_view_layer);
|
2014-02-26 17:29:50 +01:00
|
|
|
RenderLayer *rl;
|
|
|
|
bool have_layer = false;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
for (rl = re->result->layers.first; rl; rl = rl->next) {
|
|
|
|
if (STREQ(rl->name, active_render_layer->name)) {
|
2014-02-26 17:29:50 +01:00
|
|
|
have_layer = true;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-02-21 15:10:47 +01:00
|
|
|
if (re->result->rectx == re->rectx && re->result->recty == re->recty && have_layer) {
|
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 {
|
2019-04-17 06:17:24 +02: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;
|
2018-01-25 14:07:51 +01:00
|
|
|
render_result_view_new(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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-01-06 00:09:07 +00:00
|
|
|
RE_init_threadcount(re);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
RE_point_density_fix_linking();
|
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-16 13:39:25 -02:00
|
|
|
void render_update_anim_renderdata(Render *re, RenderData *rd, ListBase *render_layers)
|
2013-09-05 15:47:52 +00:00
|
|
|
{
|
|
|
|
/* filter */
|
|
|
|
re->r.gauss = rd->gauss;
|
|
|
|
|
|
|
|
/* motion blur */
|
|
|
|
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 */
|
2017-11-22 10:52:39 -02:00
|
|
|
BLI_freelistN(&re->view_layers);
|
|
|
|
BLI_duplicatelist(&re->view_layers, render_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
|
|
|
}
|
|
|
|
|
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,
|
2022-03-15 20:53:10 -07:00
|
|
|
void (*f)(void *handle, RenderResult *rr, 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
|
|
|
}
|
|
|
|
|
2021-02-26 16:50:36 +11:00
|
|
|
void RE_draw_lock_cb(Render *re, void *handle, void (*f)(void *handle, bool lock))
|
2011-03-27 23:11:22 +00:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name OpenGL Context
|
|
|
|
* \{ */
|
2018-06-11 13:54:31 +02:00
|
|
|
|
|
|
|
void RE_gl_context_create(Render *re)
|
|
|
|
{
|
|
|
|
/* Needs to be created in the main ogl thread. */
|
|
|
|
re->gl_context = WM_opengl_context_create();
|
2018-07-03 12:32:01 +02:00
|
|
|
/* So we activate the window's one afterwards. */
|
|
|
|
wm_window_reset_drawable();
|
2018-06-11 13:54:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void RE_gl_context_destroy(Render *re)
|
|
|
|
{
|
|
|
|
/* Needs to be called from the thread which used the ogl context for rendering. */
|
|
|
|
if (re->gl_context) {
|
2018-08-14 16:10:35 -03:00
|
|
|
if (re->gpu_context) {
|
|
|
|
WM_opengl_context_activate(re->gl_context);
|
|
|
|
GPU_context_active_set(re->gpu_context);
|
|
|
|
GPU_context_discard(re->gpu_context);
|
|
|
|
re->gpu_context = NULL;
|
|
|
|
}
|
|
|
|
|
2018-06-21 16:10:52 +02:00
|
|
|
WM_opengl_context_dispose(re->gl_context);
|
2018-06-11 13:54:31 +02:00
|
|
|
re->gl_context = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void *RE_gl_context_get(Render *re)
|
|
|
|
{
|
|
|
|
return re->gl_context;
|
|
|
|
}
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
void *RE_gpu_context_get(Render *re)
|
2018-06-11 13:54:31 +02:00
|
|
|
{
|
2018-07-18 00:12:21 +02:00
|
|
|
if (re->gpu_context == NULL) {
|
2020-09-08 03:19:15 +02:00
|
|
|
re->gpu_context = GPU_context_create(NULL);
|
2018-06-11 13:54:31 +02:00
|
|
|
}
|
2018-07-18 00:12:21 +02:00
|
|
|
return re->gpu_context;
|
2018-06-11 13:54:31 +02:00
|
|
|
}
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render & Composite Scenes (Implementation & Public API)
|
|
|
|
*
|
|
|
|
* Main high-level functions defined here are:
|
|
|
|
* - #RE_RenderFrame
|
|
|
|
* - #RE_RenderAnim
|
|
|
|
* \{ */
|
|
|
|
|
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 ********** */
|
|
|
|
|
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);
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
rres = render_result_new(re, &re->disprect, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2019-02-25 19:51:36 +01:00
|
|
|
rres->stamp_data = BKE_stamp_data_copy(re->result->stamp_data);
|
2016-07-02 14:22:25 +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
|
|
|
render_result_clone_passes(re, rres, NULL);
|
2021-09-28 10:47:39 +02:00
|
|
|
render_result_passes_allocated_ensure(rres);
|
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
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render scene into render result, with a render engine. */
|
|
|
|
static void do_render_engine(Render *re)
|
2006-05-27 13:35:03 +00:00
|
|
|
{
|
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);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
re->current_scene_update(re->suh, re->scene);
|
|
|
|
RE_engine_render(re, false);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* 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
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render scene into render result, within a compositor node tree.
|
|
|
|
* Uses the same image dimensions, does not recursively perform compositing. */
|
|
|
|
static void do_render_compositor_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;
|
2018-06-08 08:07:48 +02: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
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-05-27 13:35:03 +00:00
|
|
|
/* initial setup */
|
2018-04-24 15:20:17 +02:00
|
|
|
RE_InitState(resc, re, &sce->r, &sce->view_layers, 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;
|
2018-06-08 08:07:48 +02: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
|
|
|
/* 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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_engine(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
|
|
|
}
|
|
|
|
|
2019-04-22 03:05:53 +10:00
|
|
|
/* helper call to detect if this scene needs a render,
|
|
|
|
* or if there's a any render layer to render. */
|
2021-04-08 13:08:59 +02:00
|
|
|
static int compositor_needs_render(Scene *sce, int this_scene)
|
2011-06-12 13:35:17 +00:00
|
|
|
{
|
2012-06-13 17:23:44 +00:00
|
|
|
bNodeTree *ntree = sce->nodetree;
|
2011-06-12 13:35:17 +00:00
|
|
|
bNode *node;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (ntree == NULL) {
|
2012-06-13 17:23:44 +00:00
|
|
|
return 1;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
if (sce->use_nodes == false) {
|
2014-04-01 11:34:00 +11:00
|
|
|
return 1;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
if ((sce->r.scemode & R_DOCOMP) == 0) {
|
2012-06-13 17:23:44 +00:00
|
|
|
return 1;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) {
|
|
|
|
if (this_scene == 0 || node->id == NULL || node->id == &sce->id) {
|
2011-06-12 13:35:17 +00:00
|
|
|
return 1;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
}
|
2011-06-12 13:35:17 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render all scenes within a compositor node tree. */
|
|
|
|
static void do_render_compositor_scenes(Render *re)
|
2008-01-30 14:10:37 +00:00
|
|
|
{
|
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re->scene->nodetree == NULL) {
|
2012-06-13 17:23:44 +00:00
|
|
|
return;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-02-18 18:43:46 +01:00
|
|
|
bool changed_scene = false;
|
|
|
|
|
2019-03-01 16:06:14 +01:00
|
|
|
/* now foreach render-result node we do a full render */
|
|
|
|
/* results are stored in a way compositor will find it */
|
2019-03-01 10:59:37 +01:00
|
|
|
GSet *scenes_rendered = BLI_gset_ptr_new(__func__);
|
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) {
|
2019-01-02 20:22:16 +01:00
|
|
|
Scene *scene = (Scene *)node->id;
|
2019-03-01 10:59:37 +01:00
|
|
|
if (!BLI_gset_haskey(scenes_rendered, scene) &&
|
|
|
|
render_scene_has_layers_to_render(scene, false)) {
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_compositor_scene(re, scene, cfra);
|
2019-03-01 10:59:37 +01:00
|
|
|
BLI_gset_add(scenes_rendered, scene);
|
2021-12-21 15:18:56 +01:00
|
|
|
node->typeinfo->updatefunc(restore_scene->nodetree, node);
|
2022-02-18 18:43:46 +01:00
|
|
|
|
|
|
|
if (scene != re->scene) {
|
|
|
|
changed_scene = true;
|
|
|
|
}
|
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
|
|
|
}
|
2019-03-01 10:59:37 +01:00
|
|
|
BLI_gset_free(scenes_rendered, NULL);
|
2022-02-18 18:43:46 +01:00
|
|
|
|
|
|
|
if (changed_scene) {
|
|
|
|
/* If rendered another scene, switch back to the current scene with compositing nodes. */
|
|
|
|
re->current_scene_update(re->suh, 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 */
|
2021-04-08 13:08:59 +02:00
|
|
|
static void render_compositor_stats(void *arg, const char *str)
|
2006-02-14 18:04:25 +00:00
|
|
|
{
|
2019-03-25 11:55:36 +11:00
|
|
|
Render *re = (Render *)arg;
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
|
2015-10-27 21:03:22 +05:00
|
|
|
RenderStats i;
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
memcpy(&i, &re->i, sizeof(i));
|
2015-10-27 21:03:22 +05:00
|
|
|
i.infostr = str;
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
re->stats_draw(re->sdh, &i);
|
2006-02-14 18:04:25 +00:00
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render compositor nodes, along with any scenes required for them.
|
|
|
|
* The result will be output into a compositing render layer in the render result. */
|
|
|
|
static void do_render_compositor(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
|
|
|
{
|
2019-05-20 15:14:10 +02:00
|
|
|
bNodeTree *ntree = re->pipeline_scene_eval->nodetree;
|
2012-06-13 17:23:44 +00:00
|
|
|
int update_newframe = 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
if (compositor_needs_render(re->pipeline_scene_eval, 1)) {
|
2006-05-27 13:35:03 +00:00
|
|
|
/* save memory... free all cached images */
|
|
|
|
ntreeFreeCache(ntree);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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? */
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_engine(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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
re->result = render_result_new(re, &re->disprect, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-06-12 13:35:17 +00:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ntree) {
|
2019-05-20 15:14:10 +02:00
|
|
|
ntreeCompositTagRender(re->pipeline_scene_eval);
|
2008-01-28 16:33:59 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02: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 */
|
2019-04-22 09:08:06 +10:00
|
|
|
if ((re->r.scemode & R_SINGLE_LAYER) == 0) {
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_compositor_scenes(re);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2021-04-08 13:08:59 +02:00
|
|
|
ntree->stats_draw = render_compositor_stats;
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->test_break = re->test_break;
|
|
|
|
ntree->progress = re->progress;
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
ntree->sdh = re;
|
2012-06-13 17:23:44 +00:00
|
|
|
ntree->tbh = re->tbh;
|
|
|
|
ntree->prh = re->prh;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-02-20 12:55:02 -03:00
|
|
|
if (update_newframe) {
|
|
|
|
/* If we have consistent depsgraph now would be a time to update them. */
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
RenderView *rv;
|
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
2019-05-20 15:14:10 +02:00
|
|
|
ntreeCompositExecTree(re->pipeline_scene_eval,
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|
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-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;
|
2019-04-17 06:17:24 +02: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;
|
2019-03-25 11:55:36 +11:00
|
|
|
for (rv = re->result->views.first; rv; rv = rv->next, nr++) {
|
2015-04-06 10:40:12 -03:00
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
RE_AcquireResultImage(re, &rres, nr);
|
2020-03-20 10:15:34 +01:00
|
|
|
|
|
|
|
Object *ob_camera_eval = DEG_get_evaluated_object(re->pipeline_depsgraph, RE_GetCamera(re));
|
2016-02-01 16:09:21 +01:00
|
|
|
BKE_image_stamp_buf(re->scene,
|
2020-03-20 10:15:34 +01:00
|
|
|
ob_camera_eval,
|
2016-02-01 16:09:21 +01:00
|
|
|
(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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!(rd->scemode & R_DOSEQ) || !ed || !ed->seqbase.first) {
|
2010-04-07 01:21:10 +00:00
|
|
|
return 0;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
for (seq = ed->seqbase.first; seq; seq = seq->next) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (seq->type != SEQ_TYPE_SOUND_RAM) {
|
2010-04-07 01:21:10 +00:00
|
|
|
return 1;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2010-04-07 01:21:10 +00:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2010-04-07 01:21:10 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render sequencer strips into render result. */
|
|
|
|
static void do_render_sequencer(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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.cfra = cfra;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
recurs_depth++;
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|
2019-04-17 06:17:24 +02: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");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-11-05 14:05:25 +01:00
|
|
|
SEQ_render_new_render_data(re->main,
|
|
|
|
re->pipeline_depsgraph,
|
|
|
|
re->scene,
|
|
|
|
re_x,
|
|
|
|
re_y,
|
|
|
|
SEQ_RENDER_SIZE_SCENE,
|
|
|
|
true,
|
|
|
|
&context);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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 */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (view_id = 0; view_id < tot_views; view_id++) {
|
|
|
|
context.view_id = view_id;
|
2020-11-05 14:05:25 +01:00
|
|
|
out = SEQ_render_give_ibuf(&context, cfra, 0);
|
2019-04-17 06:17:24 +02: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);
|
2020-11-05 14:05:25 +01:00
|
|
|
SEQ_render_imbuf_from_sequencer_space(re->pipeline_scene_eval, ibuf_arr[view_id]);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
ibuf_arr[view_id] = NULL;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-10-21 17:00:38 +00:00
|
|
|
rr = re->result;
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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);
|
2019-04-17 06:17:24 +02: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]);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-07 21:08:20 +10:00
|
|
|
if (recurs_depth == 0) { /* With nested scenes, only free on top-level. */
|
2019-05-20 15:14:10 +02:00
|
|
|
Editing *ed = re->pipeline_scene_eval->ed;
|
2019-04-22 09:08:06 +10:00
|
|
|
if (ed) {
|
2020-12-19 05:57:27 +01:00
|
|
|
SEQ_relations_free_imbuf(re->pipeline_scene_eval, &ed->seqbase, true);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* 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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
MEM_freeN(ibuf_arr);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
recurs_depth--;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-10-22 22:31:40 +00:00
|
|
|
/* just in case this flag went missing at some point */
|
|
|
|
re->r.scemode |= R_DOSEQ;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-11-03 17:06:12 +00:00
|
|
|
/* set overall progress of sequence rendering */
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re->r.efra != re->r.sfra) {
|
2012-06-13 17:23:44 +00:00
|
|
|
re->progress(re->prh, (float)(cfra - re->r.sfra) / (re->r.efra - re->r.sfra));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
else {
|
2011-11-03 17:06:12 +00:00
|
|
|
re->progress(re->prh, 1.0f);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2007-10-28 22:27:07 +00:00
|
|
|
}
|
2006-05-28 12:30:09 +00:00
|
|
|
|
|
|
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Render full pipeline, using render engine, sequencer and compositing nodes. */
|
|
|
|
static void do_render_full_pipeline(Render *re)
|
2006-05-27 13:35:03 +00:00
|
|
|
{
|
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 */
|
2018-06-11 15:40:37 +02:00
|
|
|
BKE_image_all_free_anim_ibufs(re->main, re->r.cfra);
|
2021-10-05 18:49:45 +02:00
|
|
|
SEQ_cache_cleanup(re->scene);
|
2010-03-28 14:45:09 +00:00
|
|
|
|
2021-01-09 19:00:05 +11:00
|
|
|
if (RE_engine_render(re, true)) {
|
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)) {
|
2021-07-03 23:08:40 +10:00
|
|
|
/* NOTE: do_render_sequencer() frees rect32 when sequencer returns float images. */
|
2015-07-01 15:23:09 +02:00
|
|
|
if (!re->test_break(re->tbh)) {
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_sequencer(re);
|
2015-07-01 15:23:09 +02:00
|
|
|
render_seq = true;
|
|
|
|
}
|
2018-06-08 08:07:48 +02: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 {
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_compositor(re);
|
2006-05-27 13:35:03 +00:00
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
re->stats_draw(re->sdh, &re->i);
|
2018-06-08 08:07:48 +02: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) {
|
|
|
|
/* sequence rendering should have taken care of that already */
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!(render_seq && (re->r.stamp & R_STAMP_STRIPMETA))) {
|
2020-03-20 10:15:34 +01:00
|
|
|
Object *ob_camera_eval = DEG_get_evaluated_object(re->pipeline_depsgraph, RE_GetCamera(re));
|
|
|
|
BKE_render_result_stamp_info(re->scene, ob_camera_eval, re->result, false);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2016-03-03 13:21:04 +05:00
|
|
|
|
|
|
|
/* 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-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;
|
2019-04-17 06:17:24 +02: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) {
|
2018-04-24 15:20:17 +02:00
|
|
|
sce->camera = BKE_view_layer_camera_find(BKE_view_layer_default_render(sce));
|
2016-02-05 14:57:53 +01:00
|
|
|
}
|
|
|
|
if (sce->camera == NULL) {
|
2014-01-08 18:26:42 +01:00
|
|
|
/* all render layers nodes need camera */
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
node = node->next;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
return true;
|
|
|
|
}
|
2020-08-07 13:37:22 +02:00
|
|
|
|
|
|
|
return (camera_override != NULL || scene->camera != NULL);
|
2014-01-08 18:26:42 +01:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (camera == NULL || (scene->r.scemode & R_MULTIVIEW) == 0) {
|
2015-04-06 10:40:12 -03:00
|
|
|
return true;
|
2019-04-22 09:08:06 +10: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)) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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\"";
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (camera_override == NULL && scene->camera == NULL) {
|
2018-04-24 15:20:17 +02:00
|
|
|
scene->camera = BKE_view_layer_camera_find(BKE_view_layer_default_render(scene));
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!check_valid_camera_multiview(scene, scene->camera, reports)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
return false;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
2019-04-17 06:17:24 +02: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) {
|
2017-11-08 12:16:49 -02:00
|
|
|
if (!seq->scene->camera &&
|
2018-04-24 15:20:17 +02:00
|
|
|
!BKE_view_layer_camera_find(BKE_view_layer_default_render(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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
}
|
2019-04-22 09:08:06 +10:00
|
|
|
else if (!check_valid_camera_multiview(seq->scene, seq->scene_camera, reports)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
return false;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
seq = seq->next;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-01-08 18:26:42 +01:00
|
|
|
return true;
|
2010-11-03 13:10:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
static bool node_tree_has_compositor_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
|
|
|
}
|
2020-08-07 13:37:22 +02:00
|
|
|
if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
|
2012-08-02 16:33:38 +00:00
|
|
|
if (node->id) {
|
2021-04-08 13:08:59 +02:00
|
|
|
if (node_tree_has_compositor_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
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
static int check_compositor_output(Scene *scene)
|
2012-05-09 09:02:06 +00:00
|
|
|
{
|
2021-04-08 13:08:59 +02:00
|
|
|
return node_tree_has_compositor_output(scene->nodetree);
|
2012-05-09 09:02:06 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
bool RE_is_rendering_allowed(Scene *scene,
|
|
|
|
ViewLayer *single_layer,
|
|
|
|
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
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
const int scemode = scene->r.scemode;
|
2019-04-17 06:17:24 +02: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;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2020-05-14 02:43:17 +02:00
|
|
|
if (RE_seq_render_active(scene, &scene->r)) {
|
|
|
|
/* Sequencer */
|
|
|
|
if (scene->r.mode & R_BORDER) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "Border rendering is not supported by sequencer");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((scemode & R_DOCOMP) && scene->use_nodes) {
|
|
|
|
/* Compositor */
|
|
|
|
if (!scene->nodetree) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "No node tree in scene");
|
|
|
|
return 0;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
if (!check_compositor_output(scene)) {
|
2020-05-14 02:43:17 +02:00
|
|
|
BKE_report(reports, RPT_ERROR, "No render output node in scene");
|
|
|
|
return 0;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2020-05-14 02:43:17 +02:00
|
|
|
else {
|
|
|
|
/* Regular Render */
|
|
|
|
if (!render_scene_has_layers_to_render(scene, single_layer)) {
|
|
|
|
BKE_report(reports, RPT_ERROR, "All render layers are disabled");
|
|
|
|
return 0;
|
2016-08-24 10:19:44 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-05-14 02:43:17 +02:00
|
|
|
/* check valid camera, without camera render is OK (compo, seq) */
|
|
|
|
if (!check_valid_camera(scene, camera_override, reports)) {
|
2006-12-07 14:17:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
static void update_physics_cache(Render *re,
|
|
|
|
Scene *scene,
|
|
|
|
ViewLayer *view_layer,
|
|
|
|
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));
|
2018-06-13 10:57:10 +02:00
|
|
|
baker.bmain = re->main;
|
2009-09-18 22:25:49 +00:00
|
|
|
baker.scene = scene;
|
2017-11-22 10:52:39 -02:00
|
|
|
baker.view_layer = view_layer;
|
2020-08-21 11:56:03 +02:00
|
|
|
baker.depsgraph = BKE_scene_ensure_depsgraph(re->main, scene, view_layer);
|
2009-09-18 22:25:49 +00:00
|
|
|
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 */
|
2020-08-01 13:02:21 +10:00
|
|
|
static int render_init_from_main(Render *re,
|
|
|
|
const RenderData *rd,
|
|
|
|
Main *bmain,
|
|
|
|
Scene *scene,
|
|
|
|
ViewLayer *single_layer,
|
|
|
|
Object *camera_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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* 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 */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* 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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-17 00:54:22 +10:00
|
|
|
/* We always render smaller part, inserting it in larger image is compositor business,
|
|
|
|
* 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;
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->main = bmain;
|
|
|
|
re->scene = scene;
|
|
|
|
re->camera_override = camera_override;
|
2015-04-06 10:40:12 -03:00
|
|
|
re->viewname[0] = '\0';
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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) {
|
2017-11-22 10:52:39 -02:00
|
|
|
render_update_anim_renderdata(re, &scene->r, &scene->view_layers);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->disprect = disprect;
|
2008-09-11 16:37:53 +00:00
|
|
|
return 1;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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 */
|
2018-04-24 15:20:17 +02:00
|
|
|
ViewLayer *view_layer = BKE_view_layer_context_active_PLACEHOLDER(scene);
|
2017-11-22 10:52:39 -02:00
|
|
|
update_physics_cache(re, scene, view_layer, anim_init);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
if (single_layer || 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);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
RE_InitState(re, NULL, &scene->r, &scene->view_layers, single_layer, winx, winy, &disprect);
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!re->ok) { /* if an error was printed, abort */
|
2007-12-19 18:17:56 +00:00
|
|
|
return 0;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2007-01-27 10:08:16 +00:00
|
|
|
/* initstate makes new result, have to send changed tags around */
|
|
|
|
ntreeCompositTagRender(re->scene);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
re->display_init(re->dih, re->result);
|
|
|
|
re->display_clear(re->dch, re->result);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-05-20 15:14:10 +02:00
|
|
|
static void render_update_depsgraph(Render *re)
|
|
|
|
{
|
|
|
|
Scene *scene = re->scene;
|
2021-07-12 17:07:35 +02:00
|
|
|
DEG_evaluate_on_framechange(re->pipeline_depsgraph, BKE_scene_frame_get(scene));
|
2019-06-17 11:04:17 +02:00
|
|
|
BKE_scene_update_sound(re->pipeline_depsgraph, re->main);
|
2019-05-20 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void render_init_depsgraph(Render *re)
|
|
|
|
{
|
|
|
|
Scene *scene = re->scene;
|
|
|
|
ViewLayer *view_layer = BKE_view_layer_default_render(re->scene);
|
|
|
|
|
2019-09-09 14:49:05 +02:00
|
|
|
re->pipeline_depsgraph = DEG_graph_new(re->main, scene, view_layer, DAG_EVAL_RENDER);
|
2019-05-20 15:14:10 +02:00
|
|
|
DEG_debug_name_set(re->pipeline_depsgraph, "RENDER PIPELINE");
|
|
|
|
|
|
|
|
/* Make sure there is a correct evaluated scene pointer. */
|
2020-08-18 15:51:32 +02:00
|
|
|
DEG_graph_build_for_render_pipeline(re->pipeline_depsgraph);
|
2019-05-20 15:14:10 +02:00
|
|
|
|
|
|
|
/* Update immediately so we have proper evaluated scene. */
|
|
|
|
render_update_depsgraph(re);
|
|
|
|
|
|
|
|
re->pipeline_scene_eval = DEG_get_evaluated_scene(re->pipeline_depsgraph);
|
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
/* Free data only needed during rendering operation. */
|
|
|
|
static void render_pipeline_free(Render *re)
|
|
|
|
{
|
|
|
|
if (re->engine && !RE_engine_use_persistent_data(re->engine)) {
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
if (re->pipeline_depsgraph != NULL) {
|
|
|
|
DEG_graph_free(re->pipeline_depsgraph);
|
|
|
|
re->pipeline_depsgraph = NULL;
|
|
|
|
re->pipeline_scene_eval = NULL;
|
|
|
|
}
|
|
|
|
/* Destroy the opengl context in the correct thread. */
|
|
|
|
RE_gl_context_destroy(re);
|
2021-08-31 11:03:33 +02:00
|
|
|
|
|
|
|
/* In the case the engine did not mark tiles as finished (un-highlight, which could happen in the
|
|
|
|
* case of cancelled render) ensure the storage is empty. */
|
|
|
|
if (re->highlighted_tiles != NULL) {
|
|
|
|
BLI_mutex_lock(&re->highlighted_tiles_mutex);
|
|
|
|
|
|
|
|
/* Rendering is supposed to be finished here, so no new tiles are expected to be written.
|
|
|
|
* Only make it so possible read-only access to the highlighted tiles is thread-safe. */
|
|
|
|
BLI_assert(re->highlighted_tiles);
|
|
|
|
|
|
|
|
BLI_gset_free(re->highlighted_tiles, MEM_freeN);
|
|
|
|
re->highlighted_tiles = NULL;
|
|
|
|
|
|
|
|
BLI_mutex_unlock(&re->highlighted_tiles_mutex);
|
|
|
|
}
|
2021-04-08 13:08:59 +02:00
|
|
|
}
|
|
|
|
|
2019-05-06 17:36:34 +02:00
|
|
|
void RE_RenderFrame(Render *re,
|
|
|
|
Main *bmain,
|
|
|
|
Scene *scene,
|
|
|
|
ViewLayer *single_layer,
|
|
|
|
Object *camera_override,
|
2022-03-14 17:10:29 +01:00
|
|
|
const int frame,
|
|
|
|
const float subframe,
|
2019-05-06 17:36:34 +02:00
|
|
|
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
|
|
|
{
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_INIT);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 03:05:53 +10:00
|
|
|
/* Ugly global still...
|
2021-12-17 15:26:28 +11:00
|
|
|
* is to prevent preview events and signal subdivision-surface etc to make full resolution. */
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_rendering = true;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
scene->r.cfra = frame;
|
2022-03-14 17:10:29 +01:00
|
|
|
scene->r.subframe = subframe;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-08-01 13:02:21 +10:00
|
|
|
if (render_init_from_main(re, &scene->r, bmain, scene, single_layer, camera_override, 0, 0)) {
|
2019-05-06 17:59:31 +02:00
|
|
|
const RenderData rd = scene->r;
|
2010-05-04 12:31:24 +00:00
|
|
|
MEM_reset_peak_memory();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_PRE);
|
2019-05-20 15:14:10 +02:00
|
|
|
|
2019-09-09 10:25:04 +02:00
|
|
|
render_init_depsgraph(re);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_full_pipeline(re);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
if (write_still && !G.is_break) {
|
2019-05-06 17:59:31 +02:00
|
|
|
if (BKE_imtype_is_movie(rd.im_format.imtype)) {
|
2012-03-09 00:41:09 +00:00
|
|
|
/* operator checks this but in case its called from elsewhere */
|
2021-02-05 19:07:03 -08:00
|
|
|
printf("Error: can't write single images with a movie format!\n");
|
2010-11-17 04:02:19 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
char name[FILE_MAX];
|
2015-01-24 16:48:23 +11:00
|
|
|
BKE_image_path_from_imformat(name,
|
2019-05-06 17:59:31 +02:00
|
|
|
rd.pic,
|
2018-06-05 15:10:33 +02:00
|
|
|
BKE_main_blendfile_path(bmain),
|
|
|
|
scene->r.cfra,
|
2019-05-06 17:59:31 +02:00
|
|
|
&rd.im_format,
|
|
|
|
(rd.scemode & R_EXTENSION) != 0,
|
2015-04-06 10:40:12 -03:00
|
|
|
false,
|
|
|
|
NULL);
|
2019-04-17 06:17:24 +02: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-16 14:40:46 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2019-05-06 18:02:57 +02:00
|
|
|
/* keep after file save */
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_POST);
|
2014-12-01 18:27:45 +01:00
|
|
|
if (write_still) {
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_WRITE);
|
2010-11-16 14:40:46 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re,
|
|
|
|
re->main,
|
|
|
|
&scene->id,
|
|
|
|
G.is_break ? BKE_CB_EVT_RENDER_CANCEL : BKE_CB_EVT_RENDER_COMPLETE);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
render_pipeline_free(re);
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|
|
|
|
|
2021-02-04 09:56:33 +11:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
|
|
|
|
/* Not freestyle specific, currently only used by free-style. */
|
2021-02-01 18:24:15 +01:00
|
|
|
static void change_renderdata_engine(Render *re, const char *new_engine)
|
|
|
|
{
|
|
|
|
if (!STREQ(re->r.engine, new_engine)) {
|
|
|
|
if (re->engine) {
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
re->engine = NULL;
|
|
|
|
}
|
|
|
|
BLI_strncpy(re->r.engine, new_engine, sizeof(re->r.engine));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool use_eevee_for_freestyle_render(Render *re)
|
|
|
|
{
|
|
|
|
RenderEngineType *type = RE_engines_find(re->r.engine);
|
|
|
|
return !(type->flag & RE_USE_CUSTOM_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
|
|
|
{
|
2019-03-25 11:55:36 +11:00
|
|
|
re->result_ok = 0;
|
2020-08-01 13:02:21 +10:00
|
|
|
if (render_init_from_main(re, &scene->r, bmain, scene, NULL, NULL, 0, 0)) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (render) {
|
2021-02-01 18:24:15 +01:00
|
|
|
char scene_engine[32];
|
|
|
|
BLI_strncpy(scene_engine, re->r.engine, sizeof(scene_engine));
|
|
|
|
if (use_eevee_for_freestyle_render(re)) {
|
|
|
|
change_renderdata_engine(re, RE_engine_id_BLENDER_EEVEE);
|
|
|
|
}
|
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
RE_engine_render(re, false);
|
2021-02-01 18:24:15 +01:00
|
|
|
|
|
|
|
change_renderdata_engine(re, scene_engine);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
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)
|
|
|
|
{
|
2020-03-26 01:14:08 +01:00
|
|
|
if (re->test_break(re->tbh)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
FRS_init_stroke_renderer(re);
|
2015-10-10 19:18:04 +02:00
|
|
|
|
2020-04-03 19:15:01 +02:00
|
|
|
LISTBASE_FOREACH (RenderView *, rv, &re->result->views) {
|
2020-03-26 01:14:08 +01:00
|
|
|
RE_SetActiveRenderView(re, rv->name);
|
|
|
|
|
|
|
|
ViewLayer *active_view_layer = BLI_findlink(&re->view_layers, re->active_view_layer);
|
|
|
|
FRS_begin_stroke_rendering(re);
|
|
|
|
|
2020-04-03 19:15:01 +02:00
|
|
|
LISTBASE_FOREACH (ViewLayer *, view_layer, &re->view_layers) {
|
2020-03-26 01:14:08 +01:00
|
|
|
if ((re->r.scemode & R_SINGLE_LAYER) && view_layer != active_view_layer) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-10-10 19:18:04 +02:00
|
|
|
|
2020-03-26 01:14:08 +01:00
|
|
|
if (FRS_is_freestyle_enabled(view_layer)) {
|
|
|
|
FRS_do_stroke_rendering(re, view_layer);
|
|
|
|
}
|
2015-10-10 19:18:04 +02:00
|
|
|
}
|
2020-03-26 01:14:08 +01:00
|
|
|
|
|
|
|
FRS_end_stroke_rendering(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
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Read/Write Render Result (Images & Movies)
|
|
|
|
* \{ */
|
|
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!rr) {
|
2015-04-06 10:40:12 -03:00
|
|
|
return false;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-03 17:05:21 +02:00
|
|
|
bool is_mono = BLI_listbase_count_at_most(&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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
if (rd->im_format.views_format == R_IMF_VIEWS_MULTIVIEW && is_exr_rr) {
|
|
|
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02: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];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_strncpy(filepath, name, sizeof(filepath));
|
2019-04-17 06:17:24 +02: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);
|
|
|
|
}
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (BLI_path_extension_check(name, ".exr")) {
|
2015-04-06 10:40:12 -03:00
|
|
|
name[strlen(name) - 4] = 0;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
2019-02-21 15:29:02 +01:00
|
|
|
IMB_colormanagement_imbuf_for_write(
|
|
|
|
ibuf, true, false, &scene->view_settings, &scene->display_settings, &imf);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf, name, &imf, stamp);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
IMB_freeImBuf(ibuf);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
IMB_colormanagement_imbuf_for_write(
|
|
|
|
ibuf, true, false, &scene->view_settings, &scene->display_settings, &rd->im_format);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-20 15:18:26 +02:00
|
|
|
ok = render_imbuf_write_stamp_test(reports, scene, rr, ibuf, name, &rd->im_format, stamp);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
|
|
|
IMB_freeImBuf(ibuf);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
|
|
|
else { /* R_IMF_VIEWS_STEREO_3D */
|
|
|
|
BLI_assert(scene->r.im_format.views_format == R_IMF_VIEWS_STEREO_3D);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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};
|
2019-04-17 06:17:24 +02:00
|
|
|
int i;
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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]);
|
|
|
|
}
|
2019-04-17 06:17:24 +02: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]);
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
/* optional preview images for exr */
|
2015-04-06 10:40:12 -03:00
|
|
|
if (ok && is_exr_rr && (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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (BLI_path_extension_check(name, ".exr")) {
|
2018-06-17 16:13:24 +02:00
|
|
|
name[strlen(name) - 4] = 0;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-17 16:13:24 +02:00
|
|
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
2012-06-13 17:23:44 +00:00
|
|
|
ibuf_arr[2]->planes = 24;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-24 16:48:23 +11:00
|
|
|
ok = render_imbuf_write_stamp_test(
|
2016-03-10 19:34:53 +11:00
|
|
|
reports, scene, rr, ibuf_arr[2], name, &rd->im_format, stamp);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
/* imbuf knows which rects are not part of ibuf */
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
IMB_freeImBuf(ibuf_arr[i]);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
return ok;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 19:34:53 +11:00
|
|
|
bool RE_WriteRenderViewsMovie(ReportList *reports,
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderResult *rr,
|
|
|
|
Scene *scene,
|
2015-10-24 01:01:10 +11:00
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!rr) {
|
2015-04-06 10:40:12 -03:00
|
|
|
return false;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-03 17:05:21 +02:00
|
|
|
is_mono = BLI_listbase_count_at_most(&rr->views, 2) < 2;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
IMB_colormanagement_imbuf_for_write(
|
|
|
|
ibuf, true, false, &scene->view_settings, &scene->display_settings, &scene->r.im_format);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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,
|
2019-03-25 11:55:36 +11:00
|
|
|
(int *)ibuf->rect,
|
|
|
|
ibuf->x,
|
|
|
|
ibuf->y,
|
|
|
|
suffix,
|
|
|
|
reports);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BLI_assert((totvideos == 1) && (scene->r.im_format.views_format == R_IMF_VIEWS_STEREO_3D));
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
IMB_colormanagement_imbuf_for_write(ibuf_arr[i],
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
&scene->view_settings,
|
|
|
|
&scene->display_settings,
|
|
|
|
&scene->r.im_format);
|
|
|
|
}
|
2019-04-17 06:17:24 +02: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]);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-25 11:55:36 +11: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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]);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
return ok;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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;
|
2021-06-14 13:44:18 +02:00
|
|
|
RenderEngineType *re_type = RE_engines_find(re->r.engine);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
/* Only disable file writing if postprocessing is also disabled. */
|
|
|
|
const bool do_write_file = !(re_type->flag & RE_USE_NO_IMAGE_SAVE) ||
|
|
|
|
(re_type->flag & RE_USE_POSTPROCESS);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
if (do_write_file) {
|
|
|
|
RE_AcquireResultImageViews(re, &rres);
|
|
|
|
|
|
|
|
/* write movie or image */
|
|
|
|
if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
|
|
|
|
RE_WriteRenderViewsMovie(
|
|
|
|
re->reports, &rres, scene, &re->r, mh, re->movie_ctx_arr, totvideos, false);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
else {
|
2021-06-14 13:44:18 +02:00
|
|
|
if (name_override) {
|
|
|
|
BLI_strncpy(name, name_override, sizeof(name));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BKE_image_path_from_imformat(name,
|
|
|
|
scene->r.pic,
|
|
|
|
BKE_main_blendfile_path(bmain),
|
|
|
|
scene->r.cfra,
|
|
|
|
&scene->r.im_format,
|
|
|
|
(scene->r.scemode & R_EXTENSION) != 0,
|
|
|
|
true,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write images as individual images or stereo */
|
|
|
|
ok = RE_WriteRenderViewsImage(re->reports, &rres, scene, true, name);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
RE_ReleaseResultImageViews(re, &rres);
|
2006-02-05 19:16:32 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-03-27 10:05:31 +00:00
|
|
|
render_time = re->i.lastframetime;
|
|
|
|
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-06-17 15:49:09 +02:00
|
|
|
/* Flush stdout to be sure python callbacks are printing stuff after blender. */
|
|
|
|
fflush(stdout);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 03:05:53 +10:00
|
|
|
/* NOTE: using G_MAIN seems valid here???
|
|
|
|
* Not sure it's actually even used anyway, we could as well pass NULL? */
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_null(re, G_MAIN, BKE_CB_EVT_RENDER_STATS);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
if (do_write_file) {
|
|
|
|
BLI_timecode_string_from_time_simple(name, sizeof(name), re->i.lastframetime - render_time);
|
|
|
|
printf(" (Saving: %s)\n", name);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-01 19:19:10 +00:00
|
|
|
fputc('\n', stdout);
|
2021-02-05 21:32:31 +11:00
|
|
|
fflush(stdout);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-12-22 12:01:32 +00:00
|
|
|
return ok;
|
2006-02-05 19:16:32 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-06 17:57:23 +02:00
|
|
|
static void get_videos_dimensions(const Render *re,
|
|
|
|
const 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;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
else {
|
|
|
|
width = re->rectx;
|
|
|
|
height = re->recty;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2019-05-06 17:36:34 +02:00
|
|
|
void RE_RenderAnim(Render *re,
|
|
|
|
Main *bmain,
|
|
|
|
Scene *scene,
|
|
|
|
ViewLayer *single_layer,
|
|
|
|
Object *camera_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
|
|
|
{
|
2019-09-24 15:58:58 +02:00
|
|
|
/* Call hooks before taking a copy of scene->r, so user can alter the render settings prior to
|
|
|
|
* copying (e.g. alter the output path). */
|
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_INIT);
|
|
|
|
|
2019-05-06 17:57:23 +02:00
|
|
|
const RenderData rd = scene->r;
|
2015-04-06 10:40:12 -03:00
|
|
|
bMovieHandle *mh = NULL;
|
2022-03-14 17:10:29 +01:00
|
|
|
const int cfra_old = rd.cfra;
|
|
|
|
const float subframe_old = rd.subframe;
|
2012-06-13 17:23:44 +00:00
|
|
|
int nfra, totrendered = 0, totskipped = 0;
|
2015-10-24 01:01:10 +11:00
|
|
|
const int totvideos = BKE_scene_multiview_num_videos_get(&rd);
|
2019-05-06 17:59:31 +02:00
|
|
|
const bool is_movie = BKE_imtype_is_movie(rd.im_format.imtype);
|
|
|
|
const bool is_multiview_name = ((rd.scemode & R_MULTIVIEW) != 0 &&
|
|
|
|
(rd.im_format.views_format == R_IMF_VIEWS_INDIVIDUAL));
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2008-09-11 16:37:53 +00:00
|
|
|
/* do not fully call for each frame, it initializes & pops output window */
|
2020-08-01 13:02:21 +10:00
|
|
|
if (!render_init_from_main(re, &rd, bmain, scene, single_layer, camera_override, 0, 1)) {
|
2006-06-09 12:21:15 +00:00
|
|
|
return;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
RenderEngineType *re_type = RE_engines_find(re->r.engine);
|
|
|
|
|
|
|
|
/* Only disable file writing if postprocessing is also disabled. */
|
|
|
|
const bool do_write_file = !(re_type->flag & RE_USE_NO_IMAGE_SAVE) ||
|
|
|
|
(re_type->flag & RE_USE_POSTPROCESS);
|
|
|
|
|
2019-05-20 15:14:10 +02:00
|
|
|
render_init_depsgraph(re);
|
|
|
|
|
2021-06-14 13:44:18 +02:00
|
|
|
if (is_movie && do_write_file) {
|
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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
get_videos_dimensions(re, &rd, &width, &height);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-06 17:59:31 +02:00
|
|
|
mh = BKE_movie_handle_get(rd.im_format.imtype);
|
2015-09-23 02:40:08 +10:00
|
|
|
if (mh == NULL) {
|
|
|
|
BKE_report(re->reports, RPT_ERROR, "Movie format unsupported");
|
|
|
|
return;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
re->movie_ctx_arr = MEM_mallocN(sizeof(void *) * totvideos, "Movies' Context");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (i = 0; i < totvideos; i++) {
|
|
|
|
const char *suffix = BKE_scene_multiview_view_id_suffix_get(&re->r, i);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
re->movie_ctx_arr[i] = mh->context_create();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-06-04 16:52:48 +02:00
|
|
|
if (!mh->start_movie(re->movie_ctx_arr[i],
|
|
|
|
re->pipeline_scene_eval,
|
|
|
|
&re->r,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
re->reports,
|
|
|
|
false,
|
|
|
|
suffix)) {
|
2015-10-22 16:48:38 +11:00
|
|
|
is_error = true;
|
|
|
|
break;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2015-10-22 16:48:38 +11:00
|
|
|
if (is_error) {
|
|
|
|
/* report is handled above */
|
|
|
|
re_movie_free_all(re, mh, i + 1);
|
2021-04-08 13:08:59 +02:00
|
|
|
render_pipeline_free(re);
|
2015-10-22 16:48:38 +11:00
|
|
|
return;
|
2013-12-29 17:25:56 +06:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2021-12-17 15:26:28 +11:00
|
|
|
/* Ugly global still... is to prevent renderwin events and signal subdivision-surface etc
|
|
|
|
* to make full resolution is also set by caller renderwin.c */
|
2015-10-22 16:48:38 +11:00
|
|
|
G.is_rendering = true;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-22 16:48:38 +11:00
|
|
|
re->flag |= R_ANIMATION;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-11-13 03:22:22 +11:00
|
|
|
{
|
2022-03-14 17:10:29 +01:00
|
|
|
scene->r.subframe = 0.0f;
|
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];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-07-31 14:25:09 +02:00
|
|
|
/* A feedback loop exists here -- render initialization requires updated
|
2015-11-12 19:31:43 +05:00
|
|
|
* 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-
|
|
|
|
*/
|
|
|
|
{
|
2021-07-12 16:15:03 +02:00
|
|
|
float ctime = BKE_scene_ctime_get(scene);
|
2015-11-12 19:31:43 +05:00
|
|
|
AnimData *adt = BKE_animdata_from_id(&scene->id);
|
T77086 Animation: Passing Dependency Graph to Drivers
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.
Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:
```
typedef struct AnimationEvalContext {
struct Depsgraph *const depsgraph;
const float eval_time;
} AnimationEvalContext;
```
These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.
FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.
There are two functions that allow creation of `AnimationEvalContext`
objects:
- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
*anim_eval_context, float eval_time)`, which can be used to create a
`AnimationEvalContext` with the same depsgraph, but at a different
time. This makes it possible to later add fields without changing any
of the code that just want to change the eval time.
This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D8047
2020-07-17 17:38:09 +02:00
|
|
|
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
|
|
|
re->pipeline_depsgraph, ctime);
|
|
|
|
BKE_animsys_evaluate_animdata(&scene->id, adt, &anim_eval_context, ADT_RECALC_ALL, false);
|
2015-11-12 19:31:43 +05:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-20 15:14:10 +02:00
|
|
|
render_update_depsgraph(re);
|
|
|
|
|
2021-07-03 23:08:40 +10:00
|
|
|
/* Only border now, TODO(ton): camera lens. */
|
2020-08-01 13:02:21 +10:00
|
|
|
render_init_from_main(re, &rd, bmain, scene, single_layer, camera_override, 1, 0);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
if (nfra != scene->r.cfra) {
|
2018-02-20 12:55:02 -03:00
|
|
|
/* Skip this frame, but could update for physics and particles system. */
|
2008-09-19 21:57:15 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-07 13:37:22 +02:00
|
|
|
|
|
|
|
nfra += tfra;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* Touch/NoOverwrite options are only valid for image's */
|
2021-06-14 13:44:18 +02:00
|
|
|
if (is_movie == false && do_write_file) {
|
2019-05-06 17:59:31 +02:00
|
|
|
if (rd.mode & (R_NO_OVERWRITE | R_TOUCH)) {
|
2015-01-24 16:48:23 +11:00
|
|
|
BKE_image_path_from_imformat(name,
|
2019-05-06 17:59:31 +02:00
|
|
|
rd.pic,
|
2018-06-05 15:10:33 +02:00
|
|
|
BKE_main_blendfile_path(bmain),
|
|
|
|
scene->r.cfra,
|
2019-05-06 17:59:31 +02:00
|
|
|
&rd.im_format,
|
|
|
|
(rd.scemode & R_EXTENSION) != 0,
|
2015-04-06 10:40:12 -03:00
|
|
|
true,
|
|
|
|
NULL);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-06 17:59:31 +02:00
|
|
|
if (rd.mode & R_NO_OVERWRITE) {
|
2015-04-06 10:40:12 -03:00
|
|
|
if (!is_multiview_name) {
|
|
|
|
if (BLI_exists(name)) {
|
|
|
|
printf("skipping existing frame \"%s\"\n", name);
|
|
|
|
totskipped++;
|
|
|
|
continue;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
else {
|
|
|
|
SceneRenderView *srv;
|
|
|
|
bool is_skip = false;
|
|
|
|
char filepath[FILE_MAX];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
continue;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (BLI_exists(filepath)) {
|
|
|
|
is_skip = true;
|
|
|
|
printf("skipping existing frame \"%s\" for view \"%s\"\n", filepath, srv->name);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
if (is_skip) {
|
|
|
|
totskipped++;
|
|
|
|
continue;
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-06 17:59:31 +02:00
|
|
|
if (rd.mode & R_TOUCH) {
|
2015-04-06 10:40:12 -03:00
|
|
|
if (!is_multiview_name) {
|
|
|
|
if (!BLI_exists(name)) {
|
|
|
|
BLI_make_existing_file(name); /* makes the dir if its not there */
|
|
|
|
BLI_file_touch(name);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
else {
|
|
|
|
SceneRenderView *srv;
|
|
|
|
char filepath[FILE_MAX];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
continue;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-13 17:23:44 +00:00
|
|
|
re->r.cfra = scene->r.cfra; /* weak.... */
|
2022-03-14 17:10:29 +01:00
|
|
|
re->r.subframe = scene->r.subframe;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-09 10:25:04 +02:00
|
|
|
/* run callbacks before rendering, before the scene is updated */
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_PRE);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
do_render_full_pipeline(re);
|
2011-12-08 14:21:55 +00:00
|
|
|
totrendered++;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (re->test_break(re->tbh) == 0) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!G.is_break) {
|
|
|
|
if (!do_write_image_or_movie(re, bmain, scene, mh, totvideos, NULL)) {
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = true;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
}
|
2009-12-22 12:01:32 +00:00
|
|
|
}
|
2019-04-22 09:08:06 +10:00
|
|
|
else {
|
2014-04-01 11:34:00 +11:00
|
|
|
G.is_break = true;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02: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 */
|
2021-06-14 13:44:18 +02:00
|
|
|
if (is_movie == false && do_write_file) {
|
2021-08-05 16:48:29 +10:00
|
|
|
if (rd.mode & R_TOUCH) {
|
2015-04-06 10:40:12 -03:00
|
|
|
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];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
for (srv = scene->r.views.first; srv; srv = srv->next) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (!BKE_scene_multiview_is_render_view_active(&scene->r, srv)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
continue;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
BKE_scene_multiview_filepath_get(srv, name, filepath);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2008-01-21 22:10:20 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
if (G.is_break == false) {
|
2019-05-06 18:02:57 +02:00
|
|
|
/* keep after file save */
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_POST);
|
|
|
|
render_callback_exec_id(re, re->main, &scene->id, BKE_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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* end movie */
|
2021-06-14 13:44:18 +02:00
|
|
|
if (is_movie && do_write_file) {
|
2015-10-22 16:48:38 +11:00
|
|
|
re_movie_free_all(re, mh, totvideos);
|
2015-04-06 10:40:12 -03:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10: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");
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-03-14 17:10:29 +01:00
|
|
|
scene->r.cfra = cfra_old;
|
|
|
|
scene->r.subframe = subframe_old;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-11-02 13:36:28 +00:00
|
|
|
re->flag &= ~R_ANIMATION;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-09 16:39:07 +02:00
|
|
|
render_callback_exec_id(re,
|
|
|
|
re->main,
|
|
|
|
&scene->id,
|
|
|
|
G.is_break ? BKE_CB_EVT_RENDER_CANCEL : BKE_CB_EVT_RENDER_COMPLETE);
|
2019-06-04 16:52:48 +02:00
|
|
|
BKE_sound_reset_scene_specs(re->pipeline_scene_eval);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
render_pipeline_free(re);
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|
|
|
|
|
2018-04-17 13:35:05 +02: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
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
RE_InitState(re, NULL, &sce->r, &sce->view_layers, NULL, winx, winy, NULL);
|
2010-03-28 13:48:11 +00:00
|
|
|
|
2010-08-01 20:36:24 +00:00
|
|
|
re->main = bmain;
|
2010-03-28 13:48:11 +00:00
|
|
|
re->scene = sce;
|
|
|
|
|
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
|
|
|
|
2021-04-08 13:08:59 +02:00
|
|
|
RE_engine_render(re, false);
|
2021-04-08 12:28:41 +02:00
|
|
|
|
|
|
|
/* No persistent data for preview render. */
|
|
|
|
if (re->engine) {
|
|
|
|
RE_engine_free(re->engine);
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2021-07-03 23:08:40 +10:00
|
|
|
/* NOTE: repeated win/disprect calc... solve that nicer, also in compo. */
|
2006-03-14 17:44:19 +00:00
|
|
|
|
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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2006-03-14 17:44:19 +00:00
|
|
|
/* 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;
|
2018-06-08 08:07:48 +02:00
|
|
|
|
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;
|
2018-06-08 08:07:48 +02: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
|
|
|
}
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (scenode) {
|
2012-06-13 17:23:44 +00:00
|
|
|
scene = scenode;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2018-06-08 08:07:48 +02: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);
|
2019-04-22 09:08:06 +10:00
|
|
|
if (re == NULL) {
|
2017-09-12 11:27:22 +05:00
|
|
|
re = RE_NewSceneRender(scene);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2018-04-24 15:20:17 +02:00
|
|
|
RE_InitState(re, NULL, &scene->r, &scene->view_layers, NULL, winx, winy, &disprect);
|
2012-06-13 17:23:44 +00:00
|
|
|
re->scene = scene;
|
2018-06-08 08:07:48 +02: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
|
|
|
|
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
|
|
|
{
|
2021-02-05 16:23:34 +11:00
|
|
|
/* OCIO_TODO: assume layer was saved in default color space */
|
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
|
|
|
ImBuf *ibuf = IMB_loadiffname(filename, IB_rect, NULL);
|
2015-04-06 10:40:12 -03:00
|
|
|
RenderPass *rpass = NULL;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* multiview: since the API takes no 'view', we use the first combined pass found */
|
2019-04-22 09:08:06 +10:00
|
|
|
for (rpass = layer->passes.first; rpass; rpass = rpass->next) {
|
|
|
|
if (STREQ(rpass->name, RE_PASSNAME_COMBINED)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
break;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
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);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02: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) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (ibuf->rect_float == NULL) {
|
2009-09-18 22:25:49 +00:00
|
|
|
IMB_float_from_rect(ibuf);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-08-08 13:29:21 +10: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;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:08:06 +10:00
|
|
|
if (ibuf->rect_float == NULL) {
|
2009-09-18 22:25:49 +00:00
|
|
|
IMB_float_from_rect(ibuf);
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
memcpy(
|
2020-08-08 13:29:21 +10:00
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
bool RE_layers_have_name(struct RenderResult *rr)
|
|
|
|
{
|
2018-04-03 17:05:21 +02:00
|
|
|
switch (BLI_listbase_count_at_most(&rr->layers, 2)) {
|
2015-04-06 10:40:12 -03:00
|
|
|
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)
|
|
|
|
{
|
2020-04-03 19:15:01 +02:00
|
|
|
LISTBASE_FOREACH (RenderPass *, rp, &rl->passes) {
|
2017-10-26 14:17:58 +02:00
|
|
|
if (!STREQ(rp->name, "Combined")) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-03-15 20:53:10 -07:00
|
|
|
RenderPass *RE_pass_find_by_name(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)) {
|
2019-04-22 09:08:06 +10:00
|
|
|
if (viewname == NULL || viewname[0] == '\0') {
|
2015-05-18 10:57:59 -03:00
|
|
|
break;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
2020-08-07 13:37:22 +02:00
|
|
|
if (STREQ(rp->view, viewname)) {
|
2015-05-18 10:57:59 -03:00
|
|
|
break;
|
2019-04-22 09:08:06 +10:00
|
|
|
}
|
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
|
|
|
|
2022-03-15 20:53:10 -07:00
|
|
|
RenderPass *RE_pass_find_by_type(RenderLayer *rl, int passtype, const char *viewname)
|
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
|
|
|
{
|
|
|
|
#define CHECK_PASS(NAME) \
|
2019-04-20 11:28:21 +02:00
|
|
|
if (passtype == SCE_PASS_##NAME) { \
|
|
|
|
return RE_pass_find_by_name(rl, RE_PASSNAME_##NAME, viewname); \
|
|
|
|
} \
|
|
|
|
((void)0)
|
2019-04-17 06:17:24 +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
|
|
|
CHECK_PASS(COMBINED);
|
|
|
|
CHECK_PASS(Z);
|
|
|
|
CHECK_PASS(VECTOR);
|
|
|
|
CHECK_PASS(NORMAL);
|
|
|
|
CHECK_PASS(UV);
|
|
|
|
CHECK_PASS(EMIT);
|
|
|
|
CHECK_PASS(SHADOW);
|
|
|
|
CHECK_PASS(AO);
|
|
|
|
CHECK_PASS(ENVIRONMENT);
|
|
|
|
CHECK_PASS(INDEXOB);
|
|
|
|
CHECK_PASS(INDEXMA);
|
|
|
|
CHECK_PASS(MIST);
|
|
|
|
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
|
|
|
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->layflag = SCE_LAY_SOLID;
|
|
|
|
rl->passflag = SCE_PASS_COMBINED;
|
|
|
|
rl->rectx = rr->rectx;
|
|
|
|
rl->recty = rr->recty;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-26 21:35:18 +10:00
|
|
|
/* 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 */
|
2021-09-29 21:13:03 +02:00
|
|
|
return render_layer_add_pass(rr, rl, 4, RE_PASSNAME_COMBINED, viewname, "RGBA", true);
|
2016-08-03 23:31:48 +02:00
|
|
|
}
|
2021-04-08 13:08:59 +02:00
|
|
|
|
2022-03-07 10:51:22 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Miscellaneous Public Render API
|
|
|
|
* \{ */
|
|
|
|
|
2021-04-08 13:08:59 +02: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) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2022-03-07 10:51:22 +11:00
|
|
|
|
|
|
|
void RE_init_threadcount(Render *re)
|
|
|
|
{
|
|
|
|
re->r.threads = BKE_render_num_threads(&re->r);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** \} */
|