Commit Graph

3098 Commits

Author SHA1 Message Date
6d3757a3ce Better fix for T42139
Noise function's significant bits are up to 31st bit. This should now
give the same visual result as before, minus the stripes.

Issue pointed out by Anthony Edlin, thanks!
2014-10-15 11:04:53 +02:00
539a61bce2 Code cleanup: Use generic isnan() function instead of own ifdef 2014-10-10 02:04:36 +06:00
5f6e47e767 Minor cleanup.
* Use pie direction, not draw type for pie item collision
* Strict function definitions.
* Initialize random array with system time
2014-10-09 17:12:32 +02:00
928be3013a Classic blenderplayer fix + small optimization 2014-10-09 16:05:00 +02:00
016e75ad64 Fix T42139, vertical noise stripe patterns in noise texture.
Two fixes here (only the second one is strictly needed to fix the issue,
but both make the system better).

First is introduction of a random generator array for use with threaded
systems where each thread needs to access its own number generator.
The random texture now uses this so it should not be influenced by other
random generator reseedings of the main random generator like it did
before.

Second, I reshuffled the texture code to resample the upper bits of the
random number first. According to Numerical Recipes, this is where the
most variance can be found, so by sampling those we avoid correlation
issues. Also, multiplying here is not ideal because if a pair of bits
are zero, then the whole result will also be zero.

Overall this is much more random (tm) than before, however result will
also be brighter, since we now have less black spots. Tweaking the
brightness/contrast should somewhat fix that, generally having the same
result as before is not possible anyway if we are to really fix this.

Also, seems like exposing procedural depth might be nice here since it
influences the precision of the texture lookup.
2014-10-09 15:48:52 +02:00
1a7b7bb74e Allow render engine to declare whether it's capable of the texture rendering or not
If render engine has bl_use_texture_preview set to truth blender wouldn't fallback to
the blender internal rendering for previews.
2014-10-07 14:22:37 +02:00
025955e549 Fix T41957: Shadow color texture mapping was using wrong factor 2014-10-07 12:30:54 +02:00
ada2a3a0fc Typo fix for new WITH_BF_CYCLES_DEBUG option. 2014-10-04 16:01:09 +02:00
27d660ad20 Cycles: Add support for debug passes
Currently only summed number of traversal steps and intersections used by the
camera ray intersection pass is implemented, but in the future we will support
more debug passes which would help checking what things makes the scene slow.
Example of such extra passes could be number of bounces, time spent on the
shader tree evaluation and so.

Implementation from the Cycles side is pretty much straightforward, could only
mention here that it's a build-time option disabled by default.

From the blender side it's implemented as a PASS_DEBUG with several subtypes
possible. This way we don't need to create an extra DNA pass type for each of
the debug passes, saving us a bits.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D813
2014-10-04 19:00:26 +06:00
202831fc4f Style cleanup 2014-09-30 17:28:29 +06:00
40fb21aafe Fix BI viewport render crash happening with zero render border area
This is better to be backported to the 2.72.
2014-09-29 22:33:37 +06:00
4a26d70e1e Fix T41988: Shadow pass inaccurate calculation 2014-09-29 18:28:24 +06:00
52330e5349 Fix T41993: Constant jittered bug
Rotated coordinate of the ray start was used when calculating
the ray direction, ending up with wrong direction.
2014-09-29 17:41:07 +06:00
bf8cd9011d Fix T41978: Shadow was not excluded from combined path unless shadow pass was rendered too.
Pretty straightforward, issue probably goes back to (pre)history!
2014-09-28 16:08:33 +02:00
3a40aed3d5 Cleanup: use float versions of functions when in/output are floats 2014-09-24 14:55:02 +10:00
9b28ab26b4 Freestyle: disallow with fields (was crashing) 2014-09-22 18:04:16 +10:00
ef0883bc2b Fix for Freestyle crash in bordered animation rendering 2014-09-22 17:52:22 +10:00
f2c8209756 Fix T40751 preview image not generated after baking.
A DAG_id_tag_update here is enough to fix the problem.
2014-09-19 15:36:49 +02:00
e5b2e9cdd3 Fix T41800: Freestyle + Cycles panoramic camera not compatible, renders are incorrect. 2014-09-13 11:40:08 +09:00
8837bb297b Fix crash happening with external engines and dependent objects in an invisible layers 2014-09-08 20:36:40 +06:00
3a47c1a9d3 Fix T40507: Blender Internal Render's Gather don't use node's emit color.
Node was simply ignored by occ shading (noted as TODO), though it's a mere matter
of a very few lines of code, nowadays... Just copied from similar task in bake code.
2014-09-06 22:50:31 +02:00
5a8644bd97 Fix T41721: Muting render layer input nodes has no effect 2014-09-05 16:02:20 +06:00
c1ae899463 Fix T41691: Blender-internal crash (counting edges) 2014-09-03 17:33:37 +10:00
Dalai Felinto
0b4da966f9 Bake-API: more MEM_callocN replacements by MEM_mallocN
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D561
2014-08-31 14:44:42 +02:00
55cacb2e63 Add callback for starting a render-job
We had complete/cancel, but no matching init for rendering,
render_pre/post callbacks aren't always usable.
2014-08-29 16:17:31 +10:00
Dalai Felinto
079689107a Bake-API: silencing warnings (and fixing a potential memory-access crash) 2014-08-28 12:14:24 +02:00
21da42bd7a Viewport resolution divider works fine for halos now 2014-08-20 15:30:31 +06: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
afa3469288 De-duplicate EWA filter code between renderer and compositor
The title says it all, move the EWA filter to BLI (currently it's
math_interp.c) and use the function from both BI renderer and the
compositor.

This makes more central place of the algorithm, allowing to have
fixes and optimizaitons synchronized across the two usages.

This also fixes T41440: Displacement in compositing creates holes

Reviewers: campbellbarton, lukastoenne

Reviewed By: lukastoenne

Maniphest Tasks: T41440

Differential Revision: https://developer.blender.org/D748
2014-08-18 19:38:15 +06:00
88ee650263 Comments 2014-08-16 10:51:07 +10:00
Dalai Felinto
983cbafd18 Final Fix T41222 Blender gives weird ouput when baking (4096*4096) resolution on GPU
It now uses the tile size to split the job. For CPU this may add
overhead, but for GPU this is highly needed.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D690
2014-08-15 11:27:42 +02:00
be755f3873 Fix T41408: Render layer pass bug, second attempt
Missed some passes in the previous commit. Now seems all the passes
are covered, at least with my understanding of the things.

There're some weird things going around with the refraction pass,
but that is caused by some other issue in the code. Would rather
call it a TODO for now.
2014-08-13 22:45:21 +06:00
e5fd5599bc Fix T40566: Light instances disappears in rendered viewport (Blender Internal)
This is just another issue caused by convertblender overwriting the object
matrix at the time of creating render object. What's even worse here is that
original matrix is not stored for the lamps, only lamp_matrix*view_matrix is
stored.

For sure we can combine lar->co and lar->mat back to mat4, multiply by the
inverse view matrix and get object matrix, but this is not suitable for the
viewport render because every viewport rotation will accumulate the error.

For now let's store worldspace lamp matrix in the LampRen structure and use
it when rotating the scene.
2014-08-13 01:48:15 +06:00
d425cb06f6 Fix T41408: Diffuse and specular passes were incorrect with combined/color passes disabled 2014-08-12 13:45:55 +06:00
b606520791 Freestyle: Removed debugging code (use G.main instead of Freestyle-local struct Main). 2014-08-12 10:10:49 +09:00
7b1234be1c Removed/disabled debugging code. 2014-08-12 10:10:37 +09:00
a2a2d4679a Made temporary changes to use G.main rather than Freestyle-local Main for debugging. 2014-08-12 10:10:34 +09:00
1741df1e36 Removed debug prints. 2014-08-12 10:10:11 +09:00
db6d2a6fe1 Fix for nested Cycles sessions. 2014-08-12 10:10:09 +09:00
4a39df5bc3 Added debug prints. 2014-08-12 10:10:07 +09:00
f75d87bd76 Initial implementation of Cycles materials for Freestyle stroke rendering. 2014-08-12 10:10:06 +09:00
f70e1ad2fb Proof-of-concept implementation of Freestyle support for Cycles. 2014-08-12 10:10:05 +09:00
Dalai Felinto
9952699978 Bake-API: use size_t instead of width, height
(original patch by Sergey Sharybin)

Note: RNA API can't use size_t at the moment. Once it does this patch
can be tweaked a bit to fully benefit from size_t larger dimensions.
(right now num_pixels is passed as int)

Reviewed By: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D688
2014-07-31 00:35:16 -03:00
698a9a2434 Fix T41180: Crash when using motion blur with Freestyle.
In pipeline.c, do_render_3d() is called multiple times for each frame when
motion blur is used.  This caused duplicates of the same struct Render instance
in re->freestyle_renders, resulting in fatal double freeing of allocated memory.
2014-07-27 03:12:54 +09:00
8489b94e07 Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-21 18:57:35 +10:00
7c7b7302d3 Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing NULL's) 2014-07-20 14:01:42 +10:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
80d3eb6964 Fix a BI bug: when an object had dupliobjects children, it was never rendered at all,
even if having particle systems.

This was not matching behavior of Cycles and 3DView!
2014-07-18 00:06:15 +02:00
Dalai Felinto
50d30148b6 Fix T41044 Cycles Bake: world space location affects object space normal pass 2014-07-14 17:49:30 -03: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