The issue was caused by some numeric instability in triangle intersection which
was visible on avx2 CPUs and GPUs (at least sm_20 here) but maybe some others
too.
Committing rather a workaround for now to be safe for the release, still need
some investigation.
From tests with grass field from Gooseberry project didn't see measurable
slowdown.
Fix T45769: Image Texture Node clipping bug
Simple mistakes in the normalized/pixel-space coordinates handling.
Render tests for this feature are coming.
Avoid memmove() happening on every insert of duplicated node to the references
list. Temporary pre-allocated vector is used for new references which is then
being inserted into actual array in one go later.
Gives around 4x speedup building spatially split BVH for the grass field in the
cassette player shot from Gooseberry.
This commit implements object reference node spatial split making it possible
to use spatial split for top-level BVH.
The code is not in use yet because enabling spatial split on top level BVH is
not coming for free and it needs to be investigated if it's worth in terms of
improved render times.
This way it's easy to add more reference types allowed for splitting to the
BVH reference split function without making this function too much big. This
way it's possible to experiment with such features as splitting object instance
references.
So far should not be any functional changes.
In fact exit was getting called because we
had an error in shader compilation:
Uniform buffer objects are in fact required.
Since it looks like original intent was to
write the shader against older GLSL version,
I will be adding an extension here instead
of a version.
Thanks to Anshu Arya for letting me borrow his machine through
VPN to do the debugging :)
This is currently a requirement of OpenSudiv and original orientation code
was depending on this quite a lot.
This makes mesh conversion and comparison slower but solves some crashes.
With some trickery it could be optimized and become closer to original
performance.
Probably Campbell has some nice ideas here as well :)
Recent changes to kernel broke compilation of the kernels again, need some
other kind of solution for this issue.
Don't have much time for this currently, but will be addressed before the
release.
Meanwhile it's better to have some buildbot builds instead of totally failing
one.
The issue was caused by the following construction:
def = env['SOMETHING']
defs.append('SOMETHING_MORE')
Since first assignment was actually referencing environment option it was totally
polluted hawing weird and wonderful side effects on all other areas of Blender.
The idea is to cut as much code as possible and use compile-time
ifdefs rather than runtime if() statements.
Gives about 2x speedup on catmark_car model from OpenSubdiv repository
making our FPS much closer to what glViewer is capable of.
This is an alternate fix for T40964 which resolves bad handling of
caustics reported in T45609.
There were too much transmission rays being discarded by the original
fix, which caused by caustic light being totally disabled. There is
still some room for investigation why exactly original paper didn't
work that well, could be caused by the way how the pdf is calculated.
In any case current results seems rather correct now.
* Did not check data2, this partially fixes T45583.
* Initialize data2 in some closures to avoid potential problems.
Differential Revision: https://developer.blender.org/D1436
Clipping wasn't working totally correct, need to check original coordinates,
not the integer ones,
Now CPU gives the same exact results for both SVM and OSL, CUDA is still doing
something crazy with edges.