Commit Graph

2278 Commits

Author SHA1 Message Date
Thomas Dinges
60679a171d Revert "Cleanup: Simplify camera sample motion blur code."
This reverts commit 8197f0bb645f73f41071daaccf205a7583e695f5.
2015-02-26 13:27:02 +01:00
Thomas Dinges
8197f0bb64 Cleanup: Simplify camera sample motion blur code. 2015-02-26 10:30:01 +01:00
Sergey Sharybin
a585cbd2af Fix T43783: Cycles clipping doesn't match viewport when camera is inside volume
Ray length adjustment got lost in some refactor commit back to 2.71 days.
2015-02-24 13:07:52 +05:00
Dalai Felinto
abd630de62 Disable Bake Jitter code (recently added)
The following commits were supposed to add anti-alias and help with OSL
baking:

7b16fda3799d5b7167ef7ffe533d654810f44e36
1b92dfa96160f8151972d73337d5a927d8b89297

However they introduced other issues (artifacts mostly), see T43550 .
Leaving the code ifdef'ed for now.
2015-02-23 17:50:44 -03:00
Thomas Dinges
97422ea64f Cleanup: Simplify brick texture code a bit. 2015-02-23 16:49:50 +01:00
Sergey Sharybin
63b0a7feb2 Cycles: Make it survive if preview_cycles.blend uses persistent data
Currently should be no functional changes, but nice thing to have fixed
for some further experiments.
2015-02-21 19:18:20 +05:00
Sergey Sharybin
578cc2143d Cycles: Add note about autodiff in OSL wireframe shader 2015-02-21 17:31:41 +05:00
Sergey Sharybin
888d810185 Cycles: Use lower progressive update timeout for preview rendering
This ways previews are refreshing with the same ratio as job was expecting
this to happen, giving more instant feedback on the changes.
2015-02-21 17:30:29 +05:00
Sergey Sharybin
a97bc1bedf Fix T43755: Wireframe attribute doesn't work with displace
This attribute missed derivatives calculation.

Not totally sure what's the proper approach for algebraic derivative
calculation, so calculating them by definition. This isn't fastest
way to do it in this case and could be replaced with some smarter magic
in the wireframe calculation loop.

At least currently implemented approach is better than nothing.
2015-02-21 17:30:29 +05:00
Thomas Dinges
7bd4c78a1a Cleanup: Put all Bump dx/dy code in the beginning here, same as with other nodes. 2015-02-21 12:55:19 +01:00
Sergey Sharybin
09893ec7fc Cycles: Workaround for NVidia OpenCL compilation
It was complaining about explicit __constant to __private memory conversion,
which is now worked around using implicit conversion.

It's not a real fix i'm afraid and i'm still failing to build OpenCL kernel
with latest Linux drivers, but maybe it'll let someone else to investigate
what causes compiler to run out of memory?
2015-02-21 12:35:06 +05:00
Sergey Sharybin
1b92dfa961 Fix T43550: Bug in Cycles Bake Texture
Issue was caused by the changes in 7b16fda which changed the initial
state for rng. This commit makes it so the same initial hash is used
(which solves the regression without distorting AA-looking image.

It also makes it so OpenCL compiler is happy about this code (before
this change it'll complain about trying to cast private variable to
global one).
2015-02-21 01:56:48 +05:00
Sergey Sharybin
de4dcda545 Fix T43651: New pointiness attribute doesn't work with displacement
Simple fix: just make pointiness aware of bump offset.
2015-02-20 17:20:24 +05:00
Sergey Sharybin
83220ab7fb Cycles: Use size_t for aligned allocator
Seems it got changes by accident to int during guarded allocation work,
causing bad memory allocations.
2015-02-19 22:19:29 +05:00
Sergey Sharybin
7f406a53c7 Cycles: Cleanup for indentation in device_cpu.cpp
Perhaps became broken after rather recent change about which entry point
to kernel to use.
2015-02-19 19:05:04 +05:00
Sergey Sharybin
3bc9ac19f5 Cycles: Free memory used by intermediate BVH vectors earlier
Ideally we should get rid of those temporary vectors anyway, but
it's not so trivial because of the alignment. For untl then we'll
just have a bit worse solution. This part of code is not the root
of the issue of memory spikes for now anyway.

But since we're getting rid of temporary memory earlier actual spike
is a bit smaller as now. For example in franck_sheep file it's now
5489.69MB vs. previously 5599.90MB.
2015-02-19 18:58:21 +05:00
Sergey Sharybin
0f652501c7 Cycles: Reduce memory used by background light update
Simple change: just get rid of intermediate data a bit earlier, before
final pixels array is being allocated. This gives around 30% of memory
save during light update (this is about 60meg in the frank sheep file
i'm using here).

This isn't really visible by artists a lot, because actual spike happens
on BVH construction. But it doesn't mean we shouldn't be accurate with
memory usage in other areas.
2015-02-19 18:18:04 +05:00
Thomas Dinges
27d1446d24 Cleanup: Restructure curve settings code a bit.
This is a bit more logical, as it better represents the 3 primitive types we have.
2015-02-19 12:37:56 +01:00
Sergey Sharybin
3e534833e3 Cycles: Make sphere and tube image mapping friendly with OpenCL
OpenCL doesn't let you to get address of vector components, which
is kinda annoying. On the other hand, maybe now compiler will have
more chances to optimize something out.
2015-02-19 12:52:48 +05:00
Sergey Sharybin
5004b58262 Cycles: Make util_math_fast.h compatible with OpenCL 2015-02-19 12:29:06 +05:00
Sergey Sharybin
0f2adc0817 Cycles: Make aligned allocation to respect WITH_BLENDER_GUARDEDALLOC
Title pretty says it all actually. Can only briefly mention that we're
indeed entering that state when after applying some WIP patches having
much fuller statistics about memory usage would help giving exact memory
benefit.
2015-02-19 01:50:46 +05:00
Campbell Barton
483fa4c387 CMake: picky style edit
'cmake_consistency_check.py' relies on this formattng.
2015-02-19 07:15:00 +11:00
Sergey Sharybin
c9fa37fbcd Cycles: Initialize "headless" flags on engine initialization
This flag is global for all the sessions and never changes. so it doesn't
really make sense to pass it around to all sessions and synchronization
routines.

Switched to a static member of BlenderSession now, but it's probably more
logical to introduce some sort of BlenderGlobals. Doesn't currently worth
a hassle for a single boolean flag tho.
2015-02-18 21:52:51 +05:00
Thomas Dinges
6f3500db05 Cleanup: Remove unused SD_PHASE_HAS_EVAL flag.
We only have a non-singular volume closure and therefore no need to distinguish it.
2015-02-18 16:33:31 +01:00
Thomas Dinges
a2366a3a2e Cleanup for Cycles hair shader ifdefs.
sc->T and sc->data2 were behind __HAIR__ ifdef, now they are not anymore, so we can always assign the correct value.
2015-02-18 15:57:39 +01:00
Thomas Dinges
bf0a001e61 Cleanup: Remove support for Boost filesystem 2.
This is deprecated since Boost 1.48.
2015-02-18 13:49:49 +01:00
Thomas Dinges
7f7413bce2 Cleanup: Use bools in BVHParams class. 2015-02-18 12:05:59 +01:00
Thomas Dinges
bd92168643 Cycles / BVH: Remove unused temp copy of prim_object.
This will save some memory during BVH Build.
2015-02-18 01:14:59 +01:00
Sergey Sharybin
ef11be0e77 Cycles: Avoid over-allocation in decouple ray marching
It could have happened with really long rays and small steps.

Step size will be adjusted to the clamped number of steps in order
to preserve render result compatibility as much as possible.

We should probably reformulate this a bit, so it will give the
same looking results without step tweaks. But this new behavior
should already be much better that it was before.
2015-02-18 02:26:24 +05:00
Thomas Dinges
7e73b6aa25 Cleanup: Add comment about light_p being modified in one case. 2015-02-17 19:24:37 +01:00
Sergey Sharybin
1aa93dd9fd Cycles: Cleanup after recent changes 2015-02-17 23:21:53 +05:00
Thomas Dinges
e6f40b4ceb Some tweaks to last commit, this is better. 2015-02-17 19:03:50 +01:00
Sergey Sharybin
f3e831f02d Cycles: Fix for hair transmission BSDF not returning proper label 2015-02-17 22:40:00 +05:00
Thomas Dinges
6f820664c4 Cleanup: Deduplicate area light sampling code. 2015-02-17 18:39:37 +01:00
Thomas Dinges
a0d7db503d Cycles: Small tweaks for Henyey Greenstein closure code.
* Avoid duplicative fabs(g) check in sample code.
* Avoid dot product in eval code.

Helps like ~1% when Scatter Anisotropy is 0.
2015-02-17 17:48:18 +01:00
Thomas Dinges
bf878d3c3d Cycles: Remove empty closure blur code and the corresponding entries in the switch.
Most compilers will probably optimize that out, but I still don't see a reason to keep it.
2015-02-17 13:44:25 +01:00
Sergey Sharybin
4660c00ac5 Cycles: Make blender session aware of rendering from command line
This way we can do some more aggressive policy about releasing temporary
data during synchronization.
2015-02-17 16:25:16 +05:00
Sergey Sharybin
cdc1dab073 Fix T43685: New pointiness attribute error with auto-smooth enabled
Simple fix: all vertex attributes should be filled in before split.
2015-02-17 13:49:11 +05:00
Sergey Sharybin
587d8771e0 Cycles: Minor code cleanup in recent attributes changes 2015-02-17 13:46:25 +05:00
Thomas Dinges
fa9311c9a4 Cleanup: Update comments and make it more clear what volume interpolation is for. 2015-02-16 22:11:41 +01:00
Bastien Montagne
00a3c9afc8 UI messages fixes and cleanup. 2015-02-16 20:38:07 +01:00
Thomas Dinges
fd4f0ed39e Cleanup: Remove unused code from hair BSDF. 2015-02-16 15:23:01 +01:00
Thomas Dinges
7c3d5a3337 Cycles: Use some more bools in microfacet code. 2015-02-16 12:32:42 +01:00
Sergey Sharybin
9daac198f5 Cycles: Correction for C++11 compilation error after recent vector changes 2015-02-16 15:38:13 +05:00
Sergey Sharybin
478d67e858 Cycles: Hopefully compilation error fix for OSX 2015-02-15 23:11:33 +05:00
Sergey Sharybin
a83b2d3fd9 Cycles: Fix wrong attribute count calculation in prevous commit
The workaround for generated texture coordinates is to be done before
calculating number of elements for attribute, otherwise counter wouldn't
include those attributes.
2015-02-15 02:55:18 +05:00
Sergey Sharybin
1862fbf203 Cycles: Optimize memory usage when creating mesh attributes
The idea behind the change is to pre-allocate attribute arrays in advance,
which avoids re-allocation of arrays later for each of meshes being handled.

This reduces peak memory used by Cycles database from 1.3G to 0.9G for
victor.blend from Gooseberry.

It doesn't mean every file will benefit from this change since peak memory
usage is happening in the different places of the rendering code.

Also, unfortunately, attributes export might not cause the peak of render
preparation stage. That said, it's actually object_to_mesh() which causes
the memory to peak in the same test file. So we really need to optimize that
part first in order to get visible results for artists. But in any case it's
now quite easy to track hotspots in Cycles itself which is good.
2015-02-15 02:01:48 +05:00
Sergey Sharybin
18937f6fb5 Cycles: Add ifdef switch to use blender's guardedalloc for vector allocation
It's actually a bad level call, but it's inside ifdef block and disabled by
default and only intended to be used for development purposes.

Main idea of this change is to combine statistics coming from Cycles and
Blender during scene synchronization step, to see if further changes are
actually reducing memory footprint.
2015-02-15 02:01:48 +05:00
Sergey Sharybin
d0cc1180b0 Cycles: Add utility method to vector which totally frees memory used the vector
The method is called vector::free_memory(). Use with care since it'll invalidate
all the pointers to vector memory, all iterators and so on.

Currently unused, but might become handy when clearing unused data.
2015-02-15 02:01:48 +05:00
Sergey Sharybin
aad96506c1 Cycles: Report system memory usage and peak after scene device update
This only happens when built with WITH_CYCLES_DEBUG flag, memory statistics
is coming from guarded STL allocator.
2015-02-15 02:01:48 +05:00