Now baking does one AA sample at a time, just like final render. There is
also some code for shader antialiasing that solves T40369 but it is disabled
for now because there may be unpredictable side effects.
Cycles expects to find all node sockets with their correct names, but
this can be changed via the API (see bug report discussion).
Solution for now is to let cycles accept this case gracefully instead
of crashing. The shader will simply use the internal default values for
inputs and any connections will be ignored.
Would be nice to report the error somewhere, but cycles doesn't have a
proper logging system for this purpose yet.
it's possible that runtime optimizer would call get_attribute
with NULL renderstate. As per documentation, it's valid to
return false in that cases and in worst case we'll just miss
some possible optimization.
Supporting such cases would require some bigger changes to
Cycles since attributes are only set to up for the kernel
after shader compilation.
Thanks Brecht for review!
Transparent objects could become subtly visible by the different sampling
patterns for pixels covered and not covered by the object. It still converged
to the right solution but that can take a while. Now we try to use the same
sampling pattern here.
This reverts commit 12abe94de827d9ae9c0dd6cc49bc6c3e377842ad.
After a long discussion in the bug tracker we decided baking should use
the faces normals for glossy (and combined). This is what Blender
Internal is doing, and one of the more predictable way of yielding
predictable results.
That also means the result will not match the render perfectly, but this
is preferrable over the alternatives at hand.
Conflicts:
intern/cycles/kernel/kernel_bake.h
Comments from Brecht Van Lommel:
"""
Currently the viewing direction for each pixel is set to the normal, so
at every pixel glossy is evaluated as if you're looking straight at it.
Blender Internal works the same.
"""
This patch makes baking glossy as viewed from the camera.
Reviewers: brecht
CC: zanqdo
Differential Revision: https://developer.blender.org/D555
The kernel for baking the world texture was the same as the one used for
baking. Now that's separate which allows the kernel to reserve much less
memory.
CMake had this --fast-math flag but scons not, makes a big difference on some
files. Slightly slower rendering might still happen though, but it should not
be this much.
The remaining functions in blender_python.cpp changed from using the
MACRO to use python_thread_state_save/python_thread_state_restore
Since this bug only happens when 'Persistent Images' is on it was
introduced in some of the early merges with master and I never caught
it.
Thanks Daniel Salazar for helping with the bug hunting.
If we are using a mix node we still need to evaluate the BSDF lighting
even if scattering is successful.
Note: this was working for branched path (probably an oversight when
branched path support was introduced for baking, a good oversight though
;)
Fixes T40027. This means we get more CPU usage again when using multiple CUDA,
but the impact on performance is too big a problem with the current code.