Commit Graph

41 Commits

Author SHA1 Message Date
e1b92bc166 2.5
Safe method to move render results to the displayed image.

It now allocates a single image for display, and on each
refresh callback from render, it copies the refreshed 
section over to this image, in 32 bits. While rendering
that image then only shows progress updates, as usual.
This also now works for scenes in composte and results
for composite.

This should solve reported crashes for MBlur or SSS.
2009-02-05 19:28:28 +00:00
9cc59fb0c3 2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
  of components to get it work:
  - customdata, free callback for it
  - timer step, notifier code
  - start callback, update callback
- Once started, each job runs an own timer, and will for
  every time step check necessary updates, or close the
  job when ready. 
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
  it will prevent multiple jobs to enter the stack. 
  Instead it will re-use a running job, signal it to stop
  and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
  under construction. 
  Fun: BLI_addtail(&wm->jobs, steve); :)

Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see 
  previews update even while dragging sliders!
- Currently it only starts when you change a node setting.

Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.

Also:
- bug in region initialize (do_versions) showed channel list in
  node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
  way! This is for later to work on anyway. 
- recoded Render API callbacks so it gets handlers passed on, 
  no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
  of stuff from code soon.
2009-01-22 14:59:49 +00:00
f7cb86df3a 2.5
Think global, act local!

The old favorite G.scene gone! Man... that took almost 2 days.
Also removed G.curscreen and G.edbo.

Not everything could get solved; here's some notes.
- modifiers now store current scene in ModifierData. This is not
  meant for permanent, but it can probably stick there until we
  cleaned the anim system and depsgraph to cope better with
  timing issues.
- Game engine G.scene should become an argument for staring it.
  Didn't solve this yet.
- Texture nodes should get scene cfra, but the current implementation
  is too tightly wrapped to do it easily.
2009-01-04 14:14:06 +00:00
4f737bafa7 == Render ==
Commit patch #7788, allow to set the render step, so it's
possible make render every N frames only.

The step is change in Scene buttons (F10), below start and
end frame buttons.

Also add a command line options (-j), so it's possible to
overwrite the file step (useful for renderfarm).

[ Brecht, this work with OpenGL renders and simulated
  the skipped frames, please double check ]
2008-09-19 21:57:15 +00:00
49abcc980c Added shadow baking 2008-06-05 22:07:59 +00:00
540c0e0795 uvcalc_lightmap would raise an error on meshes with no faces.
auto-threads wasnt working for baking.
2008-05-14 16:40:25 +00:00
c5c53b0f2d Bugfix: FSA enabled in compositing scene but disabled in other
scenes could crash, there was code to make sure osa level is
the same in all scenes, but that was set too late, after sample
tables are created.

Fix for some unitinialized vector warnings with FSA, these were
harmless, unfortunately.
2008-02-11 11:00:09 +00:00
90f8fb733b Fix: render could crash when you enable 'do composite' without having
nodes in scene.

Feature: SHIFT+R in compositor reloads all full sample buffers, composites
and merges with filter. (ALso in Node menu).
2008-01-31 15:35:24 +00:00
703f248ab4 New rendering option: FSA!
This completes the pipeline make-over, as started in 2006. With this
option, during rendering, each sample for every layer and pass is being
saved on disk (looks like non-antialiased images). Then the composite 
and color correction happens, then a clip to 0-1 range, and only in end 
all samples get combined - using sampling filters such as gauss/mitch/catmul.

This results in artefact-free antialiased images. Even Z-combine or
ID masks now work perfect for it! 

This is an unfinished commit btw; Brecht will finish this for strands.
Also Halo doesnt work yet.

To activate FSA: press "Save Buffers" and the new button next to it. :)
2008-01-28 16:33:59 +00:00
5219b56e92 Phase one of better masking support while rendering.
Problem: artist wants character to walk in grass, but still have all rendered
in seperate render-layers, for postpro effects and vblur. How to efficiently
create a mask image you can put *over* the character for the grass?

Solution has two parts; this commits allows any layer inside of the renderlayers
to become a Z-mask (Z values for solid gets filled in, but not rendered).

Second part of commit is render option "Only render stuff that's in front of
a zbuffer value that was filled in (saves render time)
2008-01-24 15:03:34 +00:00
3c1ad6a295 * Displacement map baking
This is an extension on the work Brecht already did to implement normal map baking. I've updated the release notes page here with info and pics:

http://www.blender.org/development/current-projects/changes-since-244/render-baking/
2007-12-29 05:17:19 +00:00
32a8b4f8e6 Particles
=========

- Fix crash in particle transform with the particle system not editable.
- Particle child distribution and caching is now multithreaded.
- Child particles now have a separate Render Amount next to the existing
  Amount. The render amount particles are now only distributed and cached
  at render time, which should make editing with child particles faster.

- Two new options for diffuse strand shading:
	- Surface Diffuse: computes the strand normal taking the normal at
	  the surface into account.
	- Blending Distance: the distance in Blender units over which to
	  blend in the normal at the surface.
- Special strand rendering for more memory efficient and faster hair and
  grass. This is a work in progress, and has a number of known issues,
  don't report bugs to me for this feature yet.

More info:
http://www.blender.org/development/current-projects/changes-since-244/particles/
2007-12-04 13:57:28 +00:00
eff09ae396 For the OpenGL render option in the 3d view, if a camera is active,
it now sets the viewport exactly the same as if rendering.
2007-12-01 19:29:50 +00:00
561319989e Render Baking
=============

A new "Selected to Active" option in the Bake panel, to (typically) bake
a high poly object onto a low poly object. Code based on patch #7339 by
Frank Richter (Crystal Space developer), thanks!.

Normal Mapping
==============

Camera, World, Object and Tangent space is now supported for baking, and
for material textures. The "NMap TS" setting is replaced with a dropdown
of the four choices in the image texture buttons.


http://www.blender.org/development/current-projects/changes-since-244/render-baking/
2007-11-28 22:21:12 +00:00
15e79ef4c8 SSS fixes:
- Radius R, G, B sliders had too small number increase on clicking.
- Preview render now renders with higher SSS error setting to speed it up a
  bit.
- bug #6664: 3d preview render had artifacts. re->viewdx/dy wasn't set then,
  which is needed to estimate the area of each point. Have set this now, not
  in the nicest way, there is some bit duplicated code, but I don't want to
  refactor existing code with the chance of breaking it at this point.
- bug #6665: grid like artifacts with parts rendering. The two extra pixels
  around parts used for filtering were used as well, leading to double points.
2007-05-08 10:15:51 +00:00
3a8c6c81d8 Subsurface scattering:
Documentation on the settings, known limitations and implementation
info can be found here:
http://www.blender.org/development/current-projects/changes-since-243/subsurface-scattering/
2007-05-03 21:37:52 +00:00
b12927ecb8 MultiLayer images: added support for choosing compression type.
Without setting anything, it uses ZIP now as default, which gives the best
lossless compression and works nice fast.
2006-12-21 10:41:43 +00:00
253432bfc7 The Big Image refactor!
Please read:
http://www.blender3d.org/cms/Imaging.834.0.html

Or in short:

- adding MultiLayer Image support
- recoded entire Image API
- better integration of movie/sequence Images

Was a whole load of work... went down for a week to do this. So, will need
a lot of testing! Will be in irc all evening.
2006-12-20 17:57:56 +00:00
17231f83f3 Work on RenderLayer and Pass control:
Full log:
http://www.blender3d.org/cms/Render_Passes.829.0.html

In short:
- Passes now have option to be excluded from "Combined".
- RenderLayers allow to override Light (Lamp groups) or Material.
- RenderLayers and Passes are in Outliner now, (ab)using Matt's nice
  'restriction collumns'. :)
2006-12-07 14:17:38 +00:00
5a3959e54b Thread support for commandline:
-t <threads>

It overrides the settings as saved in scenes. Only works for background
rendering, to force thread amounts to match the cpus in system.
For funny jokers: amount is clipped for MAXTHREADS :)
2006-11-29 19:31:45 +00:00
4ebf5223ba Render Baking:
- Bugfix: vertex normals were still flipped around, to match viewpoint
  rendering.
- New: option to bake a texture+material only
2006-11-19 18:44:54 +00:00
c47fa4d0ec Long waited feature: Render Baking
Here's the full release log with example file.
http://www.blender3d.org/cms/Render_Baking.827.0.html

For people who don't read docs; just press ALT+CTRL+B on a Mesh
with texture faces!

Todos:
- maybe some filter options extra?
- Make normal maps in Tangent space
2006-11-19 14:12:56 +00:00
6a5f637338 Hooray! Finally found the dreaded "Opengl crash" the poor orange team
suffered for the entire movie. :)

It only happened when rendering large frames, using a lot of memory and
typically when you also use other software in meantime.

Reason: the main thread does the drawing updating, while rendering is
still continuing. When using Ztransp, there was a free buffer done
when possibly a draw could still be in progress. Only crashed when drawing
is slow... explaining why it only showed up in more complex cases.
2006-06-30 14:21:25 +00:00
bbc6468b34 Restored the pretty lousy but still popular stars render in blender.
Hope our sky guru can come with something cooler for next release!
2006-06-13 20:00:14 +00:00
2e901061d9 More render pipeline finishing up;
- Shaded drawmode is back (shift+z).
  Note it still only uses orco texture; but lighting/shading is using
  the internal render module entirely.

- "Make Sticky" option back.
  (Also fix in sticky texture render, was wrong scaled)
2006-05-28 11:49:22 +00:00
e5b39b69d1 So! Finally time to work on finishing render pipeline project.
This commit brings back:

- Field Render
- MBlur Render (old style)
- Border render with or without cropping

Note: Field Render is not supported in Compositor yet. Blurring or filter
will destroy field information.
Both MotionBlur as Field render are done before Compositing happens.

Fixes:

- The "Save Buffers" option only worked on single frame renders, not for
  Anim render.
- Found an un-initalized variable in Render initialize... this might have
  caused the unknown random crashes with render.

Code restructure:

Cleaned up names and calls throughout the pipeline, more clearly telling
what goes on in functions.
This is visible in the updated first image of the Wiki doc:
http://mediawiki.blender.org/index.php/BlenderDev/RenderPipeline
2006-05-27 13:35:03 +00:00
fe3506f6d4 WIP commit on getting the 'render result layers' saved in a single
file. Previous fix accidentally committed parts of that... :)

Note: it is currently disabled still... will commit the real version
soon.
2006-03-14 17:48:40 +00:00
8a8c70c63a A couple of render improvements;
- Bug fix: the upper tile in a collumn for Panorama render didn't put the
  mainthread to sleep properly. Now panorama renders 25% faster if you had
  set Y-Parts to 4.

- Enabling Compositing in Scene for first time now adds a "Composite" node
  too, so render output gets applied.
- An attempt to render with "Do Composite" without "Composite" node will
  throw an error and stops rendering. In background mode it will just not
  render at all, and print errors.
- Errors that prevent rendering now give a popup menu again.
- Having MBlur or Fields option on will now normally render, but with an
  error print in console (not done yet...)
2006-03-12 11:51:56 +00:00
d0011f3318 Compositing workflow goodie; each 'render result' node now has a button
option to re-render that specific node. Also works for nodes using other
scenes.
2006-03-07 21:26:37 +00:00
7930c40051 Made the most critical variables in render pipeline "volatile", especially
the ones that get changed within threads, to communicate with the main
thread.

(Part of the long quest to get threaded render safe, especially in Linux)
2006-02-24 10:20:31 +00:00
ecdfa5374a 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
a2a2ad98e2 Carefully went over all scanline updating while rendering, to ensure only
updates are allowed to draw when a part is within a scanline rendering
loop. Might solve threads issues with opengl...
2006-02-21 10:47:08 +00:00
ff7f544dec Preview rendering improvement;
Until now, on each mouse/key event preview render restarted with first tile.
It now rememers where it was, and continues rendering.
Also tried to get threaded preview working, but its more work than I can
spend right now. Back to bugs :)
2006-02-13 19:27:16 +00:00
47054d00e6 Added "Blur factor" button in Vector Blur node, which scales the speed
vectors. It's actually shutter speed, but in this case works identical to
the old motionblur 'blur fac' button.

Note; the "Max Speed" button only clips speed, use this to prevent
extreme speed values. Max speed applied before the scaling happens.
2006-02-07 11:39:26 +00:00
1db5c23716 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
6ac2c83016 Redoing the blur filters for composit;
http://www.blender.org/bf/filters/

I found out current blur actually doesn't do gauss, but more did regular
quadratic. Now you can choose common filter types, but more specifically;

- set gamma on, to emphasize bright parts in blur more than darker parts
- use the bokeh option for (current circlular only) blur based on true
  area filters (meaning, for each pixel it samples the entire surrounding).
  This enables more effects, but is also much slower. Have to check on
  optimization for this still... use with care!
2006-02-03 20:39:36 +00:00
f493e8ed2e features & fixes:
- Enabled Groups to execute in Compositor. They were ignored still.
  Note; inside of groups nothing is cached, so a change of a group input
  will recalculate it fully. This is needed because groups are linked
  data (instances use same internal nodes).

- Made Composit node "Viewer" display correctly input for images with
  1/2/3/4 channels.

- Added pass rendering, tested now with only regular Materials. For
  Material nodes this is quite more complex... since they cannot be
  easily separated in passes (each Material does a full shade)
  In this commit all pass render is disabled though, will continue work on
  that later.
  Sneak preview: http://www.blender.org/bf/rt.jpg  (temporal image)

- What did remain is the 'Normal' pass output. Normal works very nice for
  relighting effects. Use the "Normal Node" to define where more or less
  light should be. (Use "Value Map" node to tweak influence of the
  Normal node 'dot' output.)

- EVIL bug fix: I've spend almost a day finding it... when combining AO and
  mirror render, the event queue was totally screwing up... two things not
  related at all!
  Found out error was in ray-mirror code, which was using partially
  uninitialized 'ShadeInput' data to pass on to render code.

- Another fix; made sure that while thread render, the threads don't get
  events, only the main program will do. Might fix issues reported by
  people on linux/windows.
2006-02-02 17:54:22 +00:00
5e3170fafd Three features;
- Live scanline updates while rendering
Using a timer system, each second now the tiles that are being processed
are checked if they could use display.
To make this work pretty, I had to use the threaded 'tile processor' for
a single thread too, but that's now proven to be stable.

Also note that these updates draw per layer, including ztransp progress
separately from solid render.

- Recode of ztransp OSA
Until now (since blender 1.0) the ztransp part was fully rendered and
added on top of the solid part with alpha-over. This adding was done before
the solid part applied sub-pixel sample filtering, causing the ztransp
layer to be always too blurry.

Now the ztransp layer uses same sub=pixel filter, resulting in the same
AA level (and filter results) as the solid part. Quite noticable with hair
renders.

- Vector buffer support & preliminary vector-blur Node
Using the "Render Layer" panel "Vector" pass button, the motion vectors
per pixel are calculated and stored. Accessible via the Compositor.

The vector-blur node is horrible btw! It just uses the length of the
vector to apply a filter like with current (z)blur. I'm committing it anyway,
I'll experiment with it further, and who knows some surprise code shows up!
2006-01-31 21:49:05 +00:00
4a52c6ac6f 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
f0dae325c3 Orange: enabled compositing in render pipeline.
- New Node "Composite" is output node that puts composited result back
  in render pipeline.
- This then also displays in the render window while editing
- But, only with Scene buttons option "Do Compositor" set
- Then, just press F12 or render anims to see the magic!

For clarity, the former 'Output" node is renamed to "Viewer".
2006-01-24 21:50:23 +00:00
042d612df2 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