Commit Graph

187 Commits

Author SHA1 Message Date
54c6a9fd49 Make it possible to use preview/viewport render job kill without context 2014-11-18 15:51:31 +01:00
2184ac8c9d Fix T41457: Viewport resolution divider does freestyle for every resolution
Now freestyle would be rendered for the final resolution only, making it so
viewport navigation is really interactive.
2014-08-19 19:39:13 +06:00
bba80ed7af Cleanup 2014-08-17 12:18:40 +10:00
e9ef7a8358 Fix T41060: Wrong texture 'Object' mapping in 3DView Rendered mode with Blender Internal 2014-08-13 00:32:29 +06:00
f14e740dee Implement Start Resolution for preview render in BI
So now viewport render resolution division works exactly the same as in Cycles.
2014-07-09 19:55:40 +06:00
e34e0c2c26 Fix T40939: Border render and SSS doesn't work correct in rendered viewport
There were some missing updates in the viewport render job which lead to
wrong SSS mapping on the final resolution.

There was also wrong scaling applying when border render is used.

And last but not least(?) strands render was using first level of the
resolution leading to really thick strands in the final viewport.
2014-07-09 18:26:47 +06:00
4f0e42489f Followup for the previous commit
Need to do the same for render exec() because it doesn't
use the job system.
2014-06-24 14:23:33 +06:00
8937feadae GLSL tweaks for viewport render draw
- Was missing pixel scale
- Dither is now supported on GPU
2014-06-20 18:11:10 +06:00
ca0c0e7549 Implement resolution divider in the Blender Internal
Currently resolution divider is not exposed to the
interface yet, and i'm not even sure it needs to be
exposed because it's somewhat weird configuration.
Need to check how often artists are changing start
resolution in Cycles.

Pretty much straightforward implementation with the
only weak part: render result is getting re-allocated
and upscaled when current resolution is finished.
Not sure how to make it faster actually. Maybe it's
just a matter of making upscale fast enough.

Needed to fix some possible memory leak happening
in Freestyle when canceling rendering on a special
stage -- it was missing temp bmain free,

Reviewers: campbellbarton, dingto

CC: sebastian_k, fsiddi, venomgfx

Differential Revision: https://developer.blender.org/D609
2014-06-20 17:32:45 +06:00
b62c2a913b Fix T39985: crash while rendering a scene with compositing nodes using another scene
The issue was caused by the wrong scene used to acquire render result for.

Now made it so render pipeline reports currently rendering scene to the job
via special callback.

This also solves missing tile highlight issue when rendering multiple scenes
in the compositor.
2014-05-02 14:54:13 +02:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
6300d22dab Fix T39640: Crash on maximizing/minimizing UV/Image Editor
Added a NULL-pointer check for now, actual issue might be
burried somewhere else (aka maybe traversal of the WM is
not actually correct here?)
2014-04-11 16:17:59 +06:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
a91247c2b4 Code cleanup: unreachable break/return 2014-03-19 12:47:09 +11:00
e6a359a0a9 Fix T39148: Image does not show while rendering
Own regression since partial buffer update refactor,
display buffer for exr tiles should happen in image
update callback.

This revision is to be merged to the final release.
2014-03-13 13:28:57 +06:00
8e7ec3652e Fix T38969: RenderResult in RenderPart can be NULL if multithreaded
renders are cancelled early.
2014-03-05 17:44:25 +01:00
4cfca0adfe Nicer solution to T38846: Split off the render layer forcing from the
validity check for render operator.

This way scene DNA can stay read-only there, cleaner and we don't have
to pass an awkward bool pointer around.
2014-02-26 14:56:27 +01:00
ecbae4ab46 Fix T38846: Render layer checkbox is not refreshed.
The render operator invoke checks render layers, which can force the
render layer to be activated. This requires a notifier, which has to be
done in the operator itself (can't do this inside pipeline code).
2014-02-26 14:39:14 +01:00
a68ceb0af8 Option to lock the interface while rendering
Added function called WM_set_locked_interface which does
two things:

- Prevents event queue from being handled, so no operators
  (see below) or values are even possible to run or change.
  This prevents any kind of "destructive" action performed
  from user while rendering.

- Locks interface refresh for regions which does have lock
  set to truth in their template. Currently it's just a 3D
  viewport, but in the future more regions could be considered
  unsafe, or we could want to lock different parts of
  interface when doing different jobs.

  This is needed because 3D viewport could be using or changing
  the same data as renderer currently uses, leading to threading
  conflict.

  Notifiers are still allowed to handle, so render progress is
  seen on the screen, but would need to doublecheck on this, in
  terms some notifiers could be changing the data.

  For now interface locking happens for render job only in case
  "Lock Interface" checkbox is enabled.

  Other tools like backing would also benefit of this option.

  It is possible to mark operator as safe to be used in locked
  interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
  template flags.

  This bit is completely handled by wm_evem_system, not
  with operator run routines, so it's still possible to
  run operators from drivers and handlers.

  Currently allowed image editor navigation and zooming.

Reviewers: brecht, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D142
2014-01-29 16:07:14 +06:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
fbf821c50b Fix T37967: autosave does not save dynamic topology edits while in sculpt mode. 2014-01-20 14:26:48 +01:00
018fe81779 Fix T38269: scene full copy in mesh edit or sculpt mode did not copy mesh edits. 2014-01-20 14:16:22 +01:00
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
71f689843d Fix deadlock happening when using Save Buffers for render
Summary:
Issue was caused by the same tile being written twice to
the EXR file. This was happening because of partial update
of work-in-progress tiles was merging result to the final
render result in order to make color management pipeline
happy.

We need to avoid such a merges and keep memory usage as
low as possible when Save Buffers is enabled.

Now render pipeline will allocate special display buffer
in render layer which will contain combined pass in the
display space. This keeps memory usage as low as we can
do at this moment.

There's one weak thing which is changing color management
settings during rendering would lead to lossy conversion.
This is because render result's display buffer uses color
space from the time when rendering was invoked.

This is actually what was happening in previous release
already actually so not a big issue.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D162
2014-01-01 22:32:47 +06:00
0d6ae3fda2 Main API: refactor naming, use BKE_main_ prefix and add main arg. 2013-12-30 13:25:27 +11:00
6e77dfeb1a Color management: get rid of original byte buffer partial update
It was only used by opengl render and in fact it needed just to
set DISPLAY_BUFFER_INVALID flag for the image buffer.

In theory it wouldn't make any change to opengl render speed
(because this change just moved rect_from_float from color
management code to image save code). And could not see any speed
changes on my laptop.
2013-12-18 15:25:46 +06:00
c5d7ea091f Changes to partial update during rendering
Summary:
Mainly addressed to solve old TODO with color managed fallback
to CPU mode when displaying render result during rendering.

That fallback was caused by the fact that partial image update
was always acquiring image buffer for composite output and was
only modifying display buffer directly.

This was a big issue for Cycles rendering which renders layers
one by one and wanted to display progress of each individual
layer. This lead to situations when display buffer was based on
what Cycles passes via RenderResult and didn't take layer/pass
from image editor header into account.

Now made it so image buffer which partial update is operating
with always corresponds to what is set in image editor header.

To make Cycles displaying progress of all the layers one by one
made it so image_rect_update switches image editor user to
newly rendering render layer. It happens only once when render
engine starts rendering next render layer, so should not be
annoying for navigation during rendering.

Additional change to render engines was done to make it so
they're able to merge composite output to final result
without marking tile as done. This is done via do_merge_result
argument to end_result() callback. This argument is optional
so should not break script compatibility.

Additional changes:

- Partial display update for Blender Internal now happens from
  the same thread as tile rendering. This makes it so display
  conversion (which could be pretty heavy actually) is done in
  separate threads. Also gives better UI feedback when rendering
  easy scene with small tiles.

- Avoid freeing/allocating byte buffer for render result
  if it's owned by the image buffer. Only mark it as invalid
  for color management.

  Saves loads of buffer re-allocations in cases when having
  several image editors opened with render result. This change
  in conjunction with the rest of the patch gave around
  50%-100% speedup of render time when displaying non-combined
  pass during rendering on my laptop.

- Partial display buffer update was wrong for buffers with number
  of channels different from 4.

- Remove unused window from RenderJob.

- Made image_buffer_rect_update static since it's only used
  in single file.

Reviewers: brecht

Reviewed By: brecht

CC: dingto

Differential Revision: http://developer.blender.org/D98
2013-12-17 23:42:38 +06:00
5a91df3271 Implement GPU-side dither
Summary:
Uses some magic pseudo-random which is actually a
texture coordinate hashing function.

TODOs:
- Dither noise is the same for all the frames.
- It's different from Floyd's dither we've been
  using before.
- Currently CPU and GPU dithering used different
  implementation. Ideally we need to use the same
  dither in CPU.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D58
2013-12-13 12:36:45 +06:00
29790d4fca Fix T37414: local view not taken into account for blender internal F12 render over 3D view. 2013-11-27 20:22:13 +01:00
Lukas Toenne
c9fdec14f5 Fix #37261 Rendering a Render Layer from another scene doesn't update.
The scene pointer used for looking up the appropriate source of render result images in the image editor was always taken from context. This means that render results for a different scene would never be
displayed in the image editor.

To give feedback on running renders, try to get the running render job's scene pointer in the image editor for render result type images. This only happens during rendering, apart from that the regular
context scene result is displayed.
2013-10-31 17:20:31 +00:00
7267221715 remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_CANCELLED. 2013-10-30 23:08:53 +00:00
6e1fe4ddd9 Implementation of curve mapping in GLSL
The title says it all, now having curve mapping
enabled in color management settings wouldn't
force fallback from GLSL to CPU based color space
conversion.
2013-10-09 15:57:32 +00:00
5806ffdfd9 Fix blender internal viewport render not using color management settings like
view, exposure, looks.
2013-10-01 15:34:43 +00:00
fc2dbc20ff Fix #36800: closing render window during render crashes, the operator would be
cancelled before the job, causing invalid access to op->reports in the job thread.
2013-09-23 19:35:21 +00:00
ed2343270c Related to #36710: add a "use_viewport" option to the render operator, to specify
if the layers and camera of the 3d viewport should be used. Python scripts don't
always want this behavior.
2013-09-13 13:34:12 +00:00
c41bb7961f Different implementation of patch #36430: use layer froms scene directly for
rendering, in case some script wants to set it in the render_pre callback. In
case of decoupled 3d view layers or local view it will still override this
though.
2013-09-12 12:09:14 +00:00
f6b37f34ec code cleanup:
- add missing headers from cmake (own omission)
- quiet rna_test.c unused define warnings.
- minor style edits
- spelling corrections and ignore all uppercase words with spell checking script.
2013-09-05 19:56:49 +00:00
d4b8a6cb85 Code cleanup: use boolean instead of int for colormanagement 2013-09-05 17:13:43 +00:00
60e5abe71f Fix a few issues reported by coverity scan. 2013-09-03 22:39:21 +00:00
a54dd1155f Fix #36449: switching between render slots during render would leave some tiles
black until the end of the render.
2013-09-03 20:59:24 +00:00
60ff60dcdc RenderEngine API: add viewport draw utility functions to bind a GLSL fragment
shader for converting colors from linear to display space, based on the scene
color management settings.

if engine.support_display_space_shader(scene): # test graphics card support
	engine.bind_display_space_shader(scene)
	# draw pixels ..
	engine.unbind_display_space_shader()
2013-08-30 23:49:35 +00:00
e2534eac8e fix [#36347] Blender crashes when clicking on 'render' in 'viewport shading' 2013-08-20 18:55:41 +00:00
e5a885a038 fix for blender-internal viewport render looking fuzzy, don't filter the image 2013-08-05 05:13:09 +00:00
78a3c2ae57 Fix missing render info text in blender internal rendered viewport after
previous fix for checking char arrays against NULL.
2013-07-16 12:22:31 +00:00
925c5010e8 fix for checking char arrays against NULL, instead check their first character. also remove some dead code (return directly after return). 2013-07-16 11:42:07 +00:00
32586e6805 Fix #35470: crash rendering from the terminal in some cases due to render info
text threading issue.
2013-07-12 20:31:30 +00:00
8d9229538c Related to #36115: show in render info text when 3D view layer or camera overrides
scene settings when pressing F12 over a 3D view.
2013-07-12 16:33:30 +00:00
6ebfdd8dc3 remove reference to wrong python version in comments & pedantic style edit. 2013-07-10 09:40:49 +00:00
3f34a88fc8 Fix #36075: editing shading nodes could still crash blender internal rendered
draw mode. This happens because it uses node data structures in threads, now
it does same as preview render, which is to immediately stop the render thread
when e.g. deleting nodes.
2013-07-10 01:05:56 +00:00