Commit Graph

2256 Commits

Author SHA1 Message Date
Sergey Sharybin
bf4c44491a Cycles: Some more constants fixes for fast math 2015-02-06 15:40:07 +05:00
Sergey Sharybin
460681bd62 Cycles: Use proper constant name for 1/pi in fast math 2015-02-06 15:15:55 +05:00
Bastien Montagne
138c9dba9b Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.

See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.

Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.

Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.

Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:32:57 +01:00
Sergey Sharybin
25f33e058a Fix T43562: Cycles gets stuck with camera in volume in certain setup
The issue was caused by the way how we shoot the ray to see which rays we're
inside which might start bouncing back-n-forth between two close to parallel
intersecting faces.

Real solution would be to record all the intersections when shooting the ray,
but it's kinda tricky on GPU because of needed sorting and uncertainty of
how huge intersection array should be.

For now we'll just limit number of steps in the check so in worst case we'll
have some samples not being correct which will be compensated with further
sampling. Shouldn't be an issue since probability of such a lock is quite
small actually.
2015-02-05 16:10:50 +05:00
Sergey Sharybin
f8c650aa7a Fix T43561: Wrong include path to standard OSL headers
Issue was in fact only visible in certain circumstances:

- OSL was compiled with Boost Wave
- or system's cpp didn't handle space between -I and path

Now made it so both wave and cpp code paths are always happy.

Original patch from Shane Ambler with own modifications to
mimic what variable holds on more verbose.
2015-02-05 12:34:29 +05:00
Sergey Sharybin
da06dab4e5 Cycles: Use pre-aligned triangle vertex coordinates for subsurface intersection
This gives small speedup (around 2% in quick tests) for ray scattering.
2015-02-04 14:49:19 +05:00
Sergey Sharybin
e224b5b9ca Cycles: OSL kernel now also ignores maybe-uninitialized
This is a bit of a mess because of the header dependency hell, but
since the tweak is small enough it's gonna be fine.
2015-02-02 22:15:33 +05:00
Sergey Sharybin
432e478f43 Cycles: Further tweaks to T43511 to solve compilation error on 32bit platforms 2015-02-02 22:09:02 +05:00
Sergey Sharybin
30e4009f0a Cycles: Solve dependency between camera and object synchronization
IN theory object might depend on camera location (spatial adaptive subdivisions
for example) which became not possible to achieve after camera in volume support.

Should be no functional changes for artists.
2015-02-02 22:09:01 +05:00
Sergey Sharybin
ddba5c27a7 Cycles: Ignore -Wmaybe-uninitialized from the kernel in release builds
This warning provided too much false-positive issues in release version of the
kernel, making it really easy to miss actual warnings.
2015-02-02 22:09:01 +05:00
Sergey Sharybin
5030daf2a8 Cycles: Remove redundant calculation of w in recent cubic commit
Was rather harmless since compiler will optimize it out, but nice to get
rid of this anyway.
2015-02-02 17:35:57 +05:00
Sergey Sharybin
31263192bb Fix T43511: Major slow down with many instanced objects in cycles GPU
Slowdown was caused by watertight intersection commit and follow-up workaorund
for compiler crash which uninlined utility function which rotates the ray.

Now it's only uninlined for sm_50 and sm_52 experimental kernels which are the
only ones which failed to compile.

Rendering still might be a bit slower but at least shouldn't be that dramatic.
2015-02-02 17:35:57 +05:00
Sergey Sharybin
7ea7c2aab2 Cycles: Fix inconsistent command line used for runtime kernel compilation
Basically build-time compiled kernels were using --fast-math (which is correct)
but run-time compiled did not.
2015-02-02 15:00:21 +05:00
Sergey Sharybin
b757f04a15 Cycles: Indentation fix for the previous commit 2015-02-02 02:04:47 +05:00
Sergey Sharybin
3b9d455a90 Cycles: Implement cubit image interpolation on CPU
Basically title says it all. Could be not totally optimized but the code is there now.
2015-02-02 02:02:10 +05:00
Sergey Sharybin
77e6f2212f Cycles: Allow paths customization via environment variables
This is for development and test environment setup only, not for
regular users usage hence no mentioning in the man page needed.
2015-02-02 02:02:10 +05:00
Sergey Sharybin
03cb146afa Fix T43496: Infinite loop in kernel when using surface attribute for volume
The issue was caused bu the optimization in surface attributes for cases when
there's only a volume shader used. Some attributes doesn't make sense in that
case and were skipped from calculation.

However, it is possible that kernel would still try to access them (because of
the shader setup etc). Prevented an infinite loop in the kernel now, which
should not have much affect on regular renders.
2015-01-31 14:39:19 +05:00
Sergey Sharybin
3f5771475d Cycles: Don't perform re-intersection if ray distance is zero
It is possible that ray distance will be zero which would make intersection
refinement return NaN as the refined position which would later lead to all
sort of mathematical issues.

Don't think there are ways to improve intersection accuracy for such rays
so just return original intersection coordinate.

This should fix T43475.

TODO: Need to look into possible issues in Ashikhmin BSDF which might return
zero-length reflected/transmitted ray?
2015-01-31 01:49:48 +05:00
Sergey Sharybin
cb2007906f Cycles: Use bool for is_lead array
This way we save 3 bytes per BVH node while building BVH, which overall
gives 100Mb memory save when preparing Frank for render.

It's not really much comparing to overall memory usage (which is 11Gb
during scene preparation here) but still doesn't harm to have solved.
2015-01-31 01:49:41 +05:00
Sergey Sharybin
d632ef7c66 Cycles: Use fast math functions in hair BSDF
Precision of the fast functions seems to be enough in there and
since the code was heavily using inverse trigonometric functions
this change gives few percent speedup on Victor's hair.

From the tests files from ctests storage doesn't have any meaningful
difference, hair on Victor is all below 4% absolute error and only
few pixels are exceeding 1% absolute difference.

In any case, let it be as it is currently so it allows us to have
fast math file in sources for it's further evaluation and possible
usage in other areas as well.
2015-01-31 01:49:41 +05:00
Sergey Sharybin
dc1043dda0 Cycles: Add fast math function module
It is based on fmath.h from OIIO and could be used to give some speedup
in areas where absolute accuracy is not so critical.
2015-01-31 01:49:41 +05:00
Sergey Sharybin
a3c13fa9e8 Cycles: Remove confusing labels usage in hair BSDF
BSDF sampler function shouldn't give labels it's not intended to do.
That said reflection shouldn't give transmission ray and transmission
give reflection ray.

Added an assert in the transmission sampling but reflection still
needs some investigation because even after recent fixes the check
for projection onto the reflected ray could give both positive and
negative values.

It shouldn't have any affect on renders just makes internal logic
consistent and unleashes an issue to be investigate further.
2015-01-30 14:00:24 +05:00
Sergey Sharybin
bd10b72ad3 Fix T43458: Crashes with hair transmission BSDF
Hair BSDF did not have proper behavior because of non-normalized
tangent direction (which it expected to be normalized).This lead
to wrong labels being returned by the hair BSDF samplers.
2015-01-30 13:03:01 +05:00
Sergey Sharybin
d2e526a82d Cycles: Fix for bump node not working with object texture mapping
This was intended to be in the original patch of texco copy from object.
2015-01-29 21:48:22 +05:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Thomas Dinges
01cebb6e91 OSL: Updates for OSL 1.5 API changes.
* create() and destroy() are deprecated since OSL 1.5, use regular constructors / destructors.
2015-01-28 01:07:59 +01:00
Dalai Felinto
7b16fda379 Fix T43388 Cycles Baking gives different results than Cycles Render
Reported and nailed down by Michale (MeshLogic).
The code that fixes this was commented out, but Brecht gave the go ahead to use it even if it is not the real solution
2015-01-27 18:20:42 -02:00
Sergey Sharybin
3b50d3a04f Fix T43346: Window mapping is wrong in preview render
The issue was caused by the whole viewplane used for mapping calculation
which would for sure lead to differences between final camera render and
viewport render from the camera view.

This commit makes it so window texture mapping is the same as final render
when viewing from the camera in viewport render.

It's not totally clear what's the right thing to do when viewport is not
in the camera view mode and that part is left unchanged.
2015-01-27 21:47:00 +05:00
Sergey Sharybin
df07a25d28 Cycles: Support texture coordinate from another object
This is the same as blender internal's texture mapping from another object,
so this way it's possible to control texture space of one object by another.

Quite straightforward change apart from the workaround for the stupidness of
the dependency graph. Now shader has flag telling that it depends on object
transform. This is the simplest way to know which shaders needs to be tagged
for update when object changes. This might give some false-positive tags now
but reducing them should not be priority for Cycles and rather be a priority
to bring new dependency graph.

Also GLSL preview does not support using other object for mapping.

This is actually correct for BI shading as well and to be addressed as
a part of general GLSL viewport improvements since it's not really clear
how to support this in GLSL.

Reviewers: brecht, juicyfruit

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1021
2015-01-27 13:36:30 +05:00
Sergey Sharybin
2dfe5e30ac Cycles: Don't re-generate blackbody/beckmann tables on every shaders update
This commit makes it so blackbody and beckmann lookup tables are stored on CPU
after being generated and then only being copied to the device if needed.

This solves lag of viewport update when tweaking shader tree by using 266KB of
CPU memory.
2015-01-23 14:00:48 +05:00
Sergey Sharybin
9617446be2 Cycles: Fix compilation error with some compilers
Not sure why this was not visible previously, but the change is
logical anyway.
2015-01-22 17:04:01 +05:00
Sergey Sharybin
fa46f5a289 Fix T43357: Cycles crash with spatial splits after recent changes
When doing BVH leaf node split we can't rely on leaf size limit from
BVH parameters in case there's spatial split enabled.

This commit basically reverts previous optimization change here which
used stack-allocated memory and uses heap-allocated vector now.

It's possible to boost this code up again by using own allocator.
2015-01-22 14:56:00 +05:00
Sergey Sharybin
1841b12900 Cycles: Add assert check to triangle packing
Handy for troubleshooting.
2015-01-22 14:27:13 +05:00
Sergey Sharybin
a1ffb49e49 Fix T43120: Cycles mapping node rotation order is different from viewport
Root of the issue goes to the fact that since the very beginning Cycles was
using ZYX euler rotation for mapping shader node but blender was always
using XYZ euler rotation.

This commit switches Cycles to use XYZ euler order and adds versioning code
to preserve backward compatibility.

There was no really nice solution here because either we're ending up with
versioning code or we'll need to deal with all sort of exceptions from blender
side in order to support ZYX order for the mapping node. The latest one is
also creepy from the other render engines points of view -- that might break
compatibility with existing bindings or introduce some extra headache for them
in the future.

This could also become a PITA for us with need of supporting all sort of weird
and wonderful exceptions in the refactored viewport project.

NOTE: This commit breaks forward compatibility, meaning opening new files in
older blender might not give proper result if Mapping node was used.

Also, libraries are to be re-saved separately from the scene file, otherwise
versioning code for them wouldn't run if scene file was re-saved with new
version of blender.

Reviewers: brecht, juicyfruit, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D973
2015-01-22 14:12:22 +05:00
Thomas Dinges
1aa8f0d3c0 Cleanup / Cycles: Code de-duplication for graph node relinking.
Differential Revision: https://developer.blender.org/D1018
2015-01-22 09:59:16 +01:00
Sergey Sharybin
dda355442d Cycles: Support tube projection for images
This way Cycles finally becomes feature-full on image projections
compared to Blender Internal and Gooseberry Project Team could
finally finish the movie.
2015-01-22 00:41:42 +05:00
Sergey Sharybin
12ccac657f Cycles: Support sphere mapping for the image texture 2015-01-22 00:41:42 +05:00
Thomas Dinges
cd72396797 Cycles: Optimization for black world backgrounds
* If a Background node is set to a black color or zero strength,
it now gets removed from the shader graph.

* In case the graph is empty (no background node), the kernel will skip
evaluating it and save some rendertime. This can help quite a bit in scenes,
where the majority of the image consists of a black background.

Example: http://www.pasteall.org/pic/show.php?id=82650
In this case the render is ~16% faster.

Differential Revision: https://developer.blender.org/D972
2015-01-21 20:16:18 +01:00
Lukas Tönne
76c7d693d9 Support in Cycles for the extra spiral keys in hair paths. 2015-01-20 09:30:10 +01:00
Sergey Sharybin
a1f4821b94 Fix T42212: Singular reflection pass is incorrect in regular path tracer
Issue seems to be caused by not totally proper pdf and eval values for this
closure. Changed it so they reflect to ggx/beckmann reflection with roughness
set to 0, which is effectively the same as the sharp reflection.
2015-01-20 03:03:45 +05:00
Bastien Montagne
0af11a1742 Make use/computation of lnors consistant.
Issue was, when requesting (building) lnors for a mesh that has
autosmooth disabled, one would expect to simply get vnors as lnors.

Until now, it wasn't the case, which was bad e.g. for normal projections
of loops in recent remap code (projecting along split loop normals
when you would expect projection along vertex normals...).

Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`.
This should *always* use mesh settings (both autosmooth and smoothresh),
otherwise once again we'd get inconsistencies in some cases.
Will update fbx and obj addons too.
2015-01-19 15:51:20 +01:00
Sergey Sharybin
694806a9cf Cycles: Correction to camera in volume detection after clipping commit
The check should also become aware of the fact were using clipping plane
instead of clipping sphere now.
2015-01-19 19:28:28 +05:00
Sergey Sharybin
7fd4c440ec Fix T43311: using displacement shader crashes blender
Issue was caused by wrong order of scene device update, which could
lead to missing object flags in shader kernel.

This patch solves a bit more than that making sure objects flags are
always properly updated, so adding/removing volume BSDF will properly
reflect on viewport where camera might become being in volume and so.
2015-01-19 19:23:21 +05:00
Sergey Sharybin
2f4aef9f3b Cycles: Avoid crash in statistics when canceling BVH build
Also add missing render_time initialization in progress.
2015-01-19 13:39:35 +05:00
Campbell Barton
09c83d6fea Viewport: Add adjustable safe areas, 3d-view & VSE
Also adds safe-area presets.

D325 by Diego Gangl with own edits.
2015-01-19 16:47:57 +11:00
Sergey Sharybin
89e562e19b Cycles: Fix compilation error with latest OSL
They went back from string_view to string for compiler options.

Still having linking errors here, but maybe others will be more lucky to fully
compiler blender with new OSL.
2015-01-17 00:15:47 +05:00
Sergey Sharybin
09ac6cae09 Cycles: Cleanup and optimization comment update 2015-01-17 00:15:47 +05:00
Sergey Sharybin
eff2fe9a72 Cycles: Minot cleanup, save some cpu tics per curve segment export 2015-01-17 00:15:47 +05:00
Sergey Sharybin
9bb06c99f3 Cycles: Minor typo fix in debug print 2015-01-16 18:03:58 +05:00
Sergey Sharybin
5d5077957e Cycles; Correction to previous debug print to survive prints from multiple threads
This commit basically makes it so statistics print from different BVH trees are not
being interleaved with each other. Glog ensures this when debug print is done as a
single put to stream operator.
2015-01-16 16:39:02 +05:00
Sergey Sharybin
5684ad8072 Cycles: Report BVH statistics after build 2015-01-16 15:05:53 +05:00
Sergey Sharybin
3f60d665bb Cycles: Fix stupid typo in the previous commit 2015-01-16 02:21:35 +05:00
Sergey Sharybin
146eb7947e Cycles: Tweak to leaf creation criteria in all BVH types
Since leaf node gets split further into per-primitive type leaves old check
for number of curves became a bit ridiculous -- it might lead to two leaf nodes
each of which would contain only one curve primitive (one motion curve and one
regular curve).

This lead to quite dramatic slowdown for Victor model -- around 40%, which is
totally unacceptable.

This commit is aimed to prevent such situation and from quick render test it
seems victor is now back to normal render time. Further testing is needed tho.

There are also other ideas about splitting the node, will need to look into
them next.
2015-01-16 01:42:58 +05:00
Sergey Sharybin
197dcfdc19 Cycles: Fix compilation error happened after recent render time commit 2015-01-15 21:28:04 +05:00
Sergey Sharybin
b8dd68cfc4 Cycles: Fix equiangular textures after recent commit
Just wrong constant used, names are indeed too close to each other.
2015-01-15 21:21:58 +05:00
Bastien Montagne
1ec44b22e9 Make grumpy gcc happy (double to float conversion...). 2015-01-15 10:29:14 +01:00
Thomas Dinges
08cc4bfa61 Small change for the new Lat/Long properties.
We use upper case for properties.
2015-01-15 08:23:27 +01:00
Lukas Stockner
4118c1b4e6 Cycles: Adding field-of-view options to the equirectangular panorama camera
This patch adds the option to set minimum/maximum latitude/longitude values for
the equirectangular panorama camera in Cycles, as discussed in T34400.

The separate functions in kernel_projection.h are needed because the regular
ones are also used as helper functions for environment map sampling.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: dingto, sergey, brecht

Differential Revision: https://developer.blender.org/D960
2015-01-14 23:22:24 +05:00
Lukas Stockner
193871ae7d Cycles: Ignore preprocessing time in ETA calculation
This patch makes Cycles ignore the time spent in BVH construction etc. when
estimating the remaining time. Considering that the remaining time is calculated
based on the average time per tile so far, as far as I understand it makes no
sense to include the preprocessing time.

Reviewers: sergey, #cycles

Reviewed By: sergey, #cycles

Subscribers: sergey

Projects: #cycles

Differential Revision: https://developer.blender.org/D895
2015-01-14 23:14:16 +05:00
Sergey Sharybin
c8a9a563a7 Fix T42621: Glossy world ray visibility affects on transmission rays
There seems to be inconsistency in flags checks in Cycles kernel. In the interface
glossy means "Glossy Reflection" and it is properly taken into  account when doing
visibility check in BVH traversal.

The check in indirect background/light emission was treating this flags as "any of
glossy reflection or transmission" which is kind of weird.

Made it so emission code follows ray visibility assumptions in other parts of the
kernel now.
2015-01-14 15:33:38 +05:00
Sergey Sharybin
54fd3f36a0 Fix T43195: Cycles uses clipping sphere instead of clipping plane
Basically the title tells it all, now Cycles uses proper clipping plane,
matching other render engines.
2015-01-14 02:34:49 +05:00
Sergey Sharybin
e6c79b7369 Cycles: Fix QBVH refit nodes not setting primitive type properly 2015-01-14 02:17:28 +05:00
Sergey Sharybin
3f0113be4d Fix T43156: Cycles incorrect final render, proper viewport with moblur disabled
Really stupid issue caused by typo in bitfield bit lead to bit conflict,

Not sure how it was done, could be some bad merge conflict resolve in the
original commit or just pure man stupidnes.

This is a nice example when having set of small test render scenes hooked
to the ctest would really help.

It's probably not that stopper issue (even tho still quite bad) since it
was made 2 months ago. But if we ever do 'a' this time it's a nice change
to include.
2015-01-13 20:56:34 +05:00
Sergey Sharybin
51779d9407 Cycles: Fix crash after recent BVH changes on empty BVH trees
It's apparently not nice to access 0th element of zero-size vector in C++.
2015-01-12 19:11:32 +05:00
Sergey Sharybin
e8730af87f Cycles: Fix compilation error on platforms without SSE support
Overview this in one of the previous BVH commits.
2015-01-12 17:14:40 +05:00
Sergey Sharybin
5719ed1225 Cycles: Add leaf primitives sanity check asserts to the kernel
This way we'll notice that leaf splitting didn't happen correct pretty easily
in debug builds.

There'll be absolutely no impact on release builds.
2015-01-12 15:05:14 +05:00
Sergey Sharybin
bc7ff3c2b4 Cycles: Enable leaf split by primitive type and adopt BVH traversal for this
This commit enables BVH leaf nodes split by the primitive type and makes it
so BVH traversal code is now aware and benefits from this.

As was mentioned in original commit, this change is crucial to be able to do
single ray to multiple triangle intersection. But it also appears to give
barely visible speedup in some scene.

In any case there should be no noticeable slowdown, and this change is what
we need to have anyway.
2015-01-12 15:04:52 +05:00
Sergey Sharybin
c707b91ce6 Cycles: Optimize leaf splitting code by avoid vector allocation
Use variables allocated in the stack and avoid heap allocation which should make
leaf splitting code a bit faster.
2015-01-12 14:49:59 +05:00
Sergey Sharybin
b56f5900dc Cycles: BVH params option to split leaf node by primitive types
The idea of this change is make it possible to split leaf nodes by primitive
type, making leaf containing primitives of the same type.

This would become handy when working on a single ray to multiple triangles
intersection code, plus with careful implementation it might give some extra
benefits on BVH traversal code by avoiding primitive type fetch and check for
each primitive in the node. But that's a bit tricky to have benefits on this
change only because depth of BVH increases.

This option is not exposed to the interface at all and not used even secretly,
the commit is only needed to help working further in this direction without
messing around with local patches and worrying of them running out of date.
2015-01-12 14:49:56 +05:00
Sergey Sharybin
a922be9270 Cycles: Repot CPU and CUDA capabilities to system info operator
For CPU it gives available instructions set (SSE, AVX and so).

For GPU CUDA it reports most of the attribute values returned by
cuDeviceGetAttribute(). Ideally we need to only use set of those
which are driver-specific (so we don't clutter system info with
values which we can get from GPU specifications and be sure they
stay the same because driver can't affect on them).
2015-01-06 14:13:21 +05:00
Sergey Sharybin
1369bd562c Cycles: Fix compilation error on AVX platforms with -arch-native
Was a conflict in headers between clew and util_optimization.h.
2015-01-03 00:11:28 +05:00
Sergey Sharybin
2a8a56929b Cycles: Fix unneeded int/float conversion happened in previous commit 2015-01-02 17:21:24 +05:00
Sergey Sharybin
4f2583ee13 Fix T43027: OpenCL kernel compilation broken after QBVH
OpenCL apparently does not support templates, so the idea of generic
function for swapping is a bit of a failure. Now it is either inlined
into the code (in triangle intersection) or has specific implementation
for QBVH.

This is probably even better, because we can't create QBVH-specific
function in util_math anyway.
2015-01-02 14:58:01 +05:00
Campbell Barton
4abe548527 cleanup: style 2015-01-02 19:29:00 +11:00
Sergey Sharybin
e9596e5def Cycles: Post-reintegration tweaks to ensure things do compile
This commit contains all the tweaks which were missing in initial patch
re-integration from the standalone Cycles repository.

This commit also contains an utility cmake macro to help linking targets
with different libraries for release/debug builds, the name currently is

  target_link_libraries_decoupled

it gets a target and list of libraries and makes sure debug builds are
using libraries with "_d" suffix.

After all this changes it'll hopefully be easier to interchange patches
between blender and standalone repositories, because they're now quite
identical.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
b8fc4fe5aa Cycles: Correction to previous SSE/AVX flags detection
Ensure AVX/AVX2 is not used when Cycles is configured with
WITH_CPU_SSE set to OFF.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
93ca68b50c Cycles: Be ready for gflags namespace auto-detect
This way it is now possible to use gflags >= 2.1, where all the
functions were moved from google to gflags namespace.

This isn't currently used in blender, but for standalone repository
this change is essential.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
405c0fddb4 CMake: Rework linking strategy a bit
Made it a dedicated macro to link release/debug targets against lib/lib_d
libraries which helps keeping code a bit more clean.

Also made it so MSVC is now happy about building debug Cycles with OSL
support.

Reshuffled code a bit and put some comments about what's going on, which
should make it a bit more clear.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
2382c8decd Cycles: Fix compilation error with compilers which doesn't support AVX
For SSE checks still could be decoupled to be able to compile SSE2
kernel and not SSE4 depending on the CPU or so.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
3b6b32d6a3 Cycles FTBFS: Send Boost after OIIO to the linker since the order matters 2015-01-01 01:31:08 +05:00
Sergey Sharybin
9b8942ac71 Cycles Standalone: Add initial support for compilation on Windows
This applies to an application comiling from the standalone Cycles repository
only.

There's still lack of proper install target, so currently pthreads
library is to be copied next to cycles.exe manually.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
9e2e408323 Cycles: Add logging to OSL and CUDA initialization/compilation
This is what was handy troubleshooting issues in the studio,
plus this is exactly the same thing which would be helpful
when solving issues with paths to compiled shaders and cubins
for standalone repository.
2015-01-01 01:31:08 +05:00
Sergey Sharybin
bbf12722ed Cycles: Fully support WITH_CYCLES_LOGGING option
This commit generalizes logging module a little bit in making it possible to use
Glog logging in standalone Cycles repository.
2015-01-01 01:31:07 +05:00
Sergey Sharybin
f2665d52e2 CMake: Minor cleanup 2015-01-01 01:31:07 +05:00
Sergey Sharybin
e0a809fb1d Cycles: Fix compilation error when OIIO is compiled with external PugiXML parser
Basic idea is to check whether OIIO is compiled with embedded PugiXML parser
and if so use PugiXML from OIIO, otherwise find a standalone PugiXML library.
2015-01-01 01:31:07 +05:00
Campbell Barton
a4c3ca8671 CMake: use pthreads on all os's 2015-01-01 01:31:07 +05:00
Sergey Sharybin
b6c175b27a Cycles: Solve linking error caused by missing pthreads library
Not sure why it worked on Debian but didn't work on Arch, could have
been some indirect link dependency or so.

Anyway, we explicitly depends on pthreads, so need to do corresponding
find_package().
2015-01-01 01:31:07 +05:00
Sergey Sharybin
4497b6ac84 Cycles: Synchronize changes with standalone repository
This changes were done in original commit of the standalone Cycles repository
and needed here for easier patch synchronization.
2015-01-01 01:31:07 +05:00
Sergey Sharybin
caa2306d16 Libmv: Update to latest upstream version
Main purpose of this is to bring new gflags library which is more likely
to have a fix for undefined order of static variables initialization and
also to bring new glog where some compilation error are fixed (which are
only visible with more strict checks with clang and c++11 enabled).
2014-12-31 16:02:04 +05:00
Sergey Sharybin
7778f0ff20 Cycles: Fix MSVC which desn't like condition to be split by preprocessor 2014-12-29 21:10:37 +05:00
Sergey Sharybin
c5927cd977 Revert "Fix T42888: Separate and Combine HSV distorts the hue value"
This reverts commit 1549fea9995c348bc14a9105df5e460644e2b33a.

After some further discussion with other developers in the team it becomes
clear there's no correct solution here. It is just more matter of what's
more convenient in particular case.

We're just going back to old code to avoid possible frustration with the
older files in newer blenders. This also means all HSV/HSL is considered
to be "linear" in the shading nodes.

Would be ported to 2.73 final.
2014-12-29 18:14:08 +05:00
Sergey Sharybin
4088fad6dd Cycles: Add asserts around BVH stack pushes
This way we're kind of safer to troubleshoot possible stack overflow issues.
2014-12-29 14:02:15 +05:00
Sergey Sharybin
40517283ca Cycles: Bump stack size for QBVH traversal code
Traversal now can push up to 2x of nodes to the stack, so need some tweaks
to the stack size.
2014-12-29 13:37:18 +05:00
Sergey Sharybin
9c4aba11c9 Cycles: Add some sanity check asserts in the traversal code
This way we'll be sure (in debug builds) that regular BVH traversal is not used
for QBVH tree (could happen because of mismatch of logic in kernel and render).
2014-12-29 13:35:31 +05:00
Sergey Sharybin
ba9453f46f Cycles: Disable QBVH on 32bit systems all together
The reason for this is that we don't sue SSE optimization for 32bit platforms
because of T36316.

Things to look into:

- Nail the root of the issue of that report
- Implement non-SSE traversal code for QBVH
2014-12-29 13:23:44 +05:00
Sergey Sharybin
b11a2f7075 Cycles: Mark visibility TODO as resolved 2014-12-27 23:38:29 +05:00
Sergey Sharybin
91bbaaa271 Cycles: Fix visibility check for instanced nodes
The issue is that only instance node contains proper visibility flags,
nodes from instanced BVH are not correct.
2014-12-27 23:33:50 +05:00
Sergey Sharybin
836ea4b70f Fix T43019: Child of objectes used by duplis are visible in Cycles
Seems the parent check didn't go deep enough and only checked single parent.
Now it checks the chain of parents which seems to be correct but requires
much more intense testing.
2014-12-26 13:36:45 +05:00
Sergey Sharybin
cd095aae13 Cycles: Distance optimization for QBVH
This commit implements heuristic which allows to skip nodes pushed to the stack
from intersection if distance to them is larger than the distance to the current
intersection.

This should solve speed regression which i didn't notice in the original QBVH
commit (which could have because i had WIP version of this patch applied in my
local branch).

From quick tests speed seems to be much closer to what is was with regular BVH.

There's still some possible code cleanup, but they'll need a bit of assembly
code check and now i want to make it so artists can happily use Cycles over the
holidays.
2014-12-25 22:40:02 +05:00
Thomas Dinges
5f3dc592c8 Revert QBVH switch, after discussion with Sergey. 2014-12-25 12:18:51 +01:00