Commit Graph

2501 Commits

Author SHA1 Message Date
9a86abd440 code cleanup: remove unused runtime var - World.fastcol 2013-02-21 17:10:27 +00:00
b9333b304c Fix visible seams on normal map bake due to clear colour being black:
This is a special case, tangent space normal maps should be cleared to
0.5, 0.5, 1.0. This is good practice but there's no reason why not to
automate this (for artists whose bump map fu may be a bit shallow).

Thanks to Morten Mikkelsen for reporting.
2013-02-20 15:06:13 +00:00
e3944f5bfa Divide by 3 instead of multiplying by variations of 0.333
Fixes small precision problems.
2013-02-14 17:35:43 +00:00
5d6f83b179 remove redundant if statement. 2013-02-13 05:07:46 +00:00
58a6f07649 Bug fix #34213 (2)
Adding non-RGBA float buffers as texture crashes MipMap code.
Images with less than 4 channels not supported (yet). Not sure
if we ever should even... normals, Z, vectors, UV, Index, all
don't like downsampling.
2013-02-12 15:51:05 +00:00
c4d248cc76 Fix #34194: Render Layer node didn't initialize color management flag properly
Bang! How we didn't notice this for so long -- seems scenes came from render
layer node were rendering as if color management disabled (byte image wouldn't
be linearized).
2013-02-11 12:25:54 +00:00
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00
b5962b7ccd Fix #34186: VSE: Incorrect movie output when scene strip is muted by keyframe 2013-02-10 09:27:25 +00:00
ebf18c6df9 Corrections to alpha pipeline do_versions
Basically they're aimed to solve issues when scene with sky
was used for compositing. If compo used alpha output result
of current trunk would be completely different form hwo it
was before.

Two heuristics here:
- If there's no world or world color is black, it completely
  equals to straight alpha mode, no further magic is needed
  to preserve compatibility

- If scene is used as Render Layer node and something is
  connected to Alpha output of this node, ensure alpha mode
  for this scene is set to Premultiplied.

Basically it shall give better compatibility and make
4K mango project just happy! :)
2013-02-08 16:25:35 +00:00
cef952a750 fix for error in own recent commit, null check before assignment. 2013-02-08 04:43:36 +00:00
7cb62127b3 Fix #34156: Spec. and Alpha Intensity OpenGL issue
Issue was caused by alpha pipeline cleanup: apparently depending on
use_alpha flag different channels for spec/alpha would be used.

Made it so talpha is computed from Image->ignore_alpha instead of
always considering to be TRUTH.

This is not so much trivial to understand what's going on here, but
it's not new issue. Anyway, if someone have got ideas how to improve
feedback here -- ideas are welcome! For now only regression is fixed.
2013-02-07 15:36:59 +00:00
441c7fb79a fix for crashes running some operators in background mode and some divide by zero errors. 2013-02-06 02:48:03 +00:00
f40dc45054 fix [#34125] Crash when bake margin = 0
regression since 2.65, just missing NULL check.
2013-02-06 00:48:17 +00:00
9ddf928dbd remove stringify macro from alloc's 2013-02-05 09:42:40 +00:00
791e38afd2 fix [#34105] bake artifacts
different threads could allocate the mask buffer and overwrite the same pointer, regression since 2.65
2013-02-05 08:16:04 +00:00
69993c5d40 style cleanup: spaces -> tabs 2013-02-04 00:18:09 +00:00
518bfbb1c9 style cleanup 2013-02-02 04:58:03 +00:00
6fca85780b style cleanup: also correct doc example for 'foreach_get/set' 2013-02-02 00:34:34 +00:00
cc96196f10 Fix #34004: crash when canceling ongoing render with scene strip
Issue was caused by recursive call of RE_BlenderFrame. Solved by
reshuffling image pool init/free in do_render_all_options.

Should be harmless, but doublecheck on this is welcome.
2013-01-28 13:29:10 +00:00
c411cde415 header cleanup, include BLI before BKE, also use bool for ntreeShaderExecTree 2013-01-24 21:57:13 +00:00
b12a019948 Usability
- Cycles materials now render in Blender Internal too, skipping the nodes.
  Not very useful, but at least things then show up on renders and in
  previews.

- Node editor: if wrong shader nodes are in a tree, they draw with thene
  color RED ALERT headers now. (Switching render engine will show it).
2013-01-24 16:11:07 +00:00
69900035b3 fix for G,G causing vertex slide in UV/Image window, also comment unused defines/enums. 2013-01-24 08:49:40 +00:00
59a187b338 Fix threading issues of viewport rendering when using movies/generated images
Issue was caused by the fact that guarded allocator is not thread-safe and
generated images/movies could allocate memory when loading pixels to Cycles.

Currently solved by switching memory allocator to using mutex lock (the same
as sued for jobs) when viewport rendering is used.

Nicer solution would be to make guarded allocator thread-safe by using atomic
operations and lock-free lists, but that's more serious change.
2013-01-24 08:14:20 +00:00
9ff704db39 style cleanup: bake 2013-01-23 23:28:22 +00:00
b9472cbd83 Code cleanup: move render baking code into own file. 2013-01-23 13:13:16 +00:00
a03cc5c6c5 Fix small issue found in vertex color bake bug that caused the result to be
different each time, due to float precision issues. The camera matrix itself
should not be modified in render, just its copy.
2013-01-23 13:13:10 +00:00
7c4f70178f fix for glitch with vertex bake:
- the mesh would be tagged to update, then updated before bake finished.
- also increase self-shadow offset, in some cases the offset wasn't enough.
2013-01-23 04:22:02 +00:00
c8dbf61f35 fix [#33729] Shadows produce artefacts in vertex colour baking 2013-01-23 03:01:43 +00:00
193df0f5a0 Fix #33951: Only margin is correctly baked for non-displacement baking
Was own mistake in recent changes.
2013-01-22 09:37:46 +00:00
95a13a2c02 Fix projection texture painting crash
It was caused by own mistake by not noticing externtex is used not
only by render engine. Now this function uses pool passed as argument
rather than using R.pool.
2013-01-22 08:05:00 +00:00
709a86a8d9 Multires baker: fix wrong normalization if baking happens to multiple images
Previously normalization will happen per image buffer individually, which
was wrong in cases different faces of the sane mesh uses different images.

Also solved possible threading issues when calculating min.max displacement.
2013-01-21 18:34:27 +00:00
effaa79ffb Multires baker: fix bad face->grid index conversion for displacement baker 2013-01-21 18:34:20 +00:00
64c85d89dd Multires baker: fix memory leak caused by threading issues
Didn't notice this before because of non-working guarded allocation
at the time threading was added to multires baker.
2013-01-21 18:34:14 +00:00
04affbe80e Support normalized displacement maps in cases maximal distance is not set
This will calculate maximal distance automatically and normalize displacement
to it. Before this change normalization will not happen at all in cases max
distance is not set manually.

This affects on "regular" baker only, there are still some fixes to come for
multiresolution baker, but that could be solved separately.
2013-01-21 09:05:05 +00:00
86991fbcb0 Fixed render time regression in Blender Internal
It was caused by image threading safe commit and it was noticeable
only on really multi-core CPU (like dual-socket Xeon stations), was
not visible on core i7 machine.

The reason of slowdown was spinlock around image buffer referencing,
which lead to lots of cores waiting for single core and using image
buffer after it was referenced was not so much longer than doing
reference itself.

The most clear solution here seemed to be introducing Image Pool
which will contain list of loaded and referenced image buffers, so
all threads could skip lock if the pool is used for reading only.
Lock only needed in cases when buffer for requested image user is
missing in the pool. This lock will happen only once per image so
overall amount of locks is much less that it was before.

To operate with pool:
- BKE_image_pool_new() creates new pool
- BKE_image_pool_free() destroys pool and dereferences all image
  buffers which were loaded to it
- BKE_image_pool_acquire_ibuf() returns image buffer for given
  image and user. Pool could be NULL and in this case fallback to
  BKE_image_acquire_ibuf will happen.

  This helps to avoid lots to if(poll) checks in image sampling
  code.

- BKE_image_pool_release_ibuf releases image buffer. In fact, it
  will only do something if pool is NULL, in all other case it'll
  equal to DoNothing operation.
2013-01-21 08:49:42 +00:00
38cee985bb code cleanup: style & warnings. 2013-01-21 02:30:40 +00:00
a08a3ab931 Fix #33916: 2.65a regression: particles duplicating objects with halo - crash
allow_render_dupli_instance used to pass zero-based index to give_current_material
which is wrong.

Before rev53332 it wasn't so much visible because give_current_material used
to clamp index internally. But that was wrong behavior here anyway, and why
nobody noticed this for so long? :)
2013-01-18 12:29:18 +00:00
Alex Fraser
55030a4c1a Applying sRGB color space transform when baking to vertex colors. Thanks to Campbell Barton and Sergey Sharybin for their help! 2013-01-18 09:19:43 +00:00
8b204f131a Render: set minimum render size to 1x1 instead of 2x2. As far as I can tell this
works ok, and it's useful for debugging.
2013-01-15 10:47:13 +00:00
18536e201f add a segfault handler that writes out the info log into a crash file alongside the blend file. 2013-01-10 16:37:48 +00:00
b02dd1e719 Fix #33815: blender internal crash rendering material pass with strands.
Patch from Sergey with modifications.
2013-01-09 15:39:26 +00:00
1bf5832dfb code cleanup: warnings and use stdbool for bpy* funcs. 2013-01-07 05:26:12 +00:00
6747dec926 style cleanup 2013-01-07 03:24:22 +00:00
4190169282 code cleanup, also remove glError check in font drawing code since its now a debug option. 2013-01-04 17:24:40 +00:00
Alex Fraser
5e0e62f040 Patch [#29035] Vertex colour baking
There is a new option in the Bake panel to enable baking to vertex colors. Unlike regular baking, this mode does not require a UV map or image to bake to, however the object must have a vertex color layer.

Thanks to:
 - AutoCRC for funding
 - Brech van Lommel and Dalai Felinto for their initial advice on how to implement it
 - Campbell Barton for helping to make this feature work with modifiers and bmesh
2013-01-02 00:05:30 +00:00
2e0e2cb170 Highlight currently rendering tiles
This commit implements highlight of tiles which are being currently
rendered for both Blender Internal and Cycles (and should be possible
to use it for other external engines as well).

Couple of implementation details:

- Added one extra boolean flag to render engine which should be set
  to truth if render engine wants to highlight tiles. If so, property
  use_highlight_tiles should be set to True.

- Render Part's ready boolena was changed by status enum, which could
  be NONE, IN_PROGRESS and READY. All render part with IN_PROGRESS
  status will be highlighted in image editor.

- For external engines render part's status is filling in automatically.
  Initially all render parts has got NONE status, then one external
  engine acquire render result, corresponding part will change status
  to IN_PROGRESS. As soon as render result is finished, corresponding
  render part will change status to FINISHED

  This should make it easy to highlight tiles for other engines as well.
2013-01-01 16:15:13 +00:00
08cea96ab0 Alpha premul pipeline cleanup
This assumptions are now made:
- Internally float buffers are always linear alpha-premul colors
- Readers should worry about delivering float buffers with that
  assumptions.
- There's an input image setting to say whether it's stored with
  straight/premul alpha on the disk.
- Byte buffers are now assumed have straight alpha, readers should
  deliver straight alpha.

Some implementation details:

- Removed scene's color unpremultiply setting, which was very
  much confusing and was wrong for default settings.
  Now all renderers assumes to deliver premultiplied alpha.

- IMB_buffer_byte_from_float will now linearize alpha when
  converting from buffer.

- Sequencer's effects were changed to assume bytes have got
  straight alpha. Most of effects will work with bytes still,
  however for glow it was more tricky to avoid data loss, so
  there's a commented out glow implementation which converts
  byte buffer to floats first, operates on floats and returns
  bytes back. It's slower and not sure if it should actually
  be used -- who're using glow on alpha anyway?

- Sequencer modifiers should also be working nice with straight
  bytes now.

- GLSL preview will predivide float textures to make nice shading,
  shading with byte textures worked nice (GLSL was assuming straight
  alpha).

- Blender Internal will set alpha=1 to the whole sky. The same
  happens in Cycles and there's no way to avoid this -- sky is
  neither straight nor premul and doesn't fit color pipeline well.

- Straight alpha mode for render result was also eliminated.

- Conversion to correct alpha need to be done before linearizing
  float buffer.

- TIFF will now load and save files with proper alpha mode setting
  in file meta data header.

- Remove Use Alpha from texture mapping and replaced with image
  datablock setting.

  Behaves much more predictable and clear from code point of view
  and solves possible regressions when non-premultiplied images were
  used as textures with ignoring alpha channel.
2012-12-31 13:52:13 +00:00
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
857df8065f style cleanup 2012-12-28 14:19:05 +00:00
6a0c8790d8 Better error report when no camera is found.
While trying to render a RenderLayer from a linked scene, I couldnt tell why it wasnt doing anything. It just stopped rendering. Until I look on the console and see the No Camera print.

This commit replaces the simple terminal printf with an actual error report, that shows in both terminal and to the user:
http://pasteall.org/pic/show.php?id=42499

I believe this commit is pretty harmless, and only adds functionality. But feel free to remove it.
2012-12-27 22:00:31 +00:00