Commit Graph

62191 Commits

Author SHA1 Message Date
Campbell Barton
64ab452131 Cleanup: shadowing (interface) 2015-11-23 17:40:55 +11:00
Campbell Barton
48b1656a6c Cleanup: shadowing (editors) 2015-11-23 17:40:50 +11:00
Campbell Barton
6e4cb463c4 Cleanup: shadowing (rna, modifiers, *misc*) 2015-11-23 17:40:49 +11:00
Campbell Barton
daa90de3fd Cleanup: shadowing (bmesh) 2015-11-23 17:40:10 +11:00
Campbell Barton
e2a79e8b6c Cleanup: shadowing (render) 2015-11-23 17:40:10 +11:00
Campbell Barton
2e348fd43e Cleanup: shadowing (blenkernel) 2015-11-23 17:40:10 +11:00
Campbell Barton
bc8504cb4c Cleanup: shadowing (blenlib, gpu, imbuf) 2015-11-23 17:40:10 +11:00
Campbell Barton
676d790d29 Cleanup: use rna_enum_ prefix for RNA enums
Definitions could shadow local vars.
2015-11-23 17:40:09 +11:00
Campbell Barton
a269287f36 Cleanup: use single struct for freestyle globals
Was shadowing local vars.
2015-11-23 17:40:09 +11:00
Campbell Barton
6a393fc998 Cleanup: redundant string escape 2015-11-23 17:40:08 +11:00
Campbell Barton
6edc573663 Cleanup: warning 2015-11-23 17:40:08 +11:00
Mike Erwin
8f2e9ac7b1 OpenGL: fix hq viewport dof on Mac / GL 2.1
My earlier fix for GL >= 3 on Windows broke it. Should work for both
platforms now.
2015-11-23 00:32:35 -05:00
Mike Erwin
2d708d9aec OpenGL: codegen formatting
Formatting of generated GLSL code:
- attribute/varying for version 120
- in/out for version 130+
- minor cosmetic stuff

Tested working on Windows 10, GL 4.3.
2015-11-23 00:13:57 -05:00
Mike Erwin
076e2ff2aa OpenGL: update geometry shaders, fixes T46838 2015-11-23 00:08:09 -05:00
Mike Erwin
05ffe2d174 OpenGL: choose compatible GLSL version
Fix GLSL version & geometry shader support query to consider core vs
compatibility.

All shaders need to be compatible with each other, and for now that
means GLSL 120. For drivers that support compatibility profiles, choose
the highest available (up to 150). If only core profile is supported,
max out at GLSL 130.
2015-11-22 21:14:23 -05:00
Mike Erwin
754df5cda8 revert file mode to 644 2015-11-22 21:14:22 -05:00
Mike Erwin
708779e60b OpenGL: bump gpu_extensions to GL 2.1, prepare for 3.x
Several changes. Tested working on Windows 10 GL 4.3 and MacOS 10.11 GL
2.1.

- document extensions used in this file
- some simple ARB/EXT suffix deletion
- stop checking for pre-2.1 features — they’re available!
- convert old ARB shader API to the one adopted in GL 2.0
- remove checks for old (pre-R600) ATI cards
- choose GLSL version at runtime, between 1.2 and 1.5
- prefer GLSL 1.5 for geometry shaders, fall back to
EXT_geometry_shader4 if needed

Differential Revision: https://developer.blender.org/D1632
2015-11-22 21:14:22 -05:00
d28431a648 OpenNL: make the API thread safe by always passing context.
Previously two laplacian smooth or deform modifiers executing
simultaneously could crash.
2015-11-22 22:49:43 +01:00
47ce2d7bef OpenNL: significantly simplify code using Eigen / STL. 2015-11-22 22:49:03 +01:00
e6c58df74e OpenNL: replace SuperLU by Eigen SparseLU solver.
Performance is roughly the same because it's using the same COLAMD ordering
and supernodal LU factorization algorithms. Solve results also appear to be
identical.
2015-11-22 22:49:03 +01:00
5e52433371 OpenNL: convert source file to C++, remove some unused functions. 2015-11-22 22:49:03 +01:00
90b55ae1e5 OpenNL: removed unused softbody code. 2015-11-22 22:49:03 +01:00
Campbell Barton
b9e0fe2003 CMake: check GNU compiler before using extension
Minor edit, don't assume non-msvc compilers are gcc/gnu compatible.
2015-11-23 08:31:29 +11:00
4ff0126e89 C99 is now the C standard for all our C code.
The main new feature is mixed variable declarations and code, which can help
reduce uninitialized variables or accidental variable reuse.

Due to incomplete C99 support in VS 2013, variable length arrays are not
supported, BLI_array_alloca must still be used. The header <tgmath.h> is also
not supported.

Differential Revision: https://developer.blender.org/D1631
2015-11-22 22:31:22 +01:00
Antony Riakiotakis
db1f0e3616 Error out on Windows if driver does not support OpenGL 2.1 with an error
messagebox.
2015-11-22 20:53:57 +01:00
Antony Riakiotakis
c402a379a2 Remove vertex array support from GPUBuffers. Remove USER_DISABLE_VBO. All
GPUBuffer rendering is now done using vertex buffers.

Vertex arrays are completely removed from GL 3.2 core profile, so we'll
have to do this change at some point anyway.

This commit, though big, is not modifying blender in any way. Use should
be exactly as if the vetex buffer option is constantly on.
2015-11-22 19:47:54 +01:00
Kévin Dietrich
3e1a9ee386 Smoke drawing code cleanups (and little refactor)
This patch contains the following changes:

- the vertices and edges arrays would be assigned default values, and
then reassigned new ones right away. It appears that those arrays were
once global and then made local
(rB06a2ee4afed4237398b69ddf253e29a730b2f9f0), so it makes sense now to
initialize them with the right values.
- the flame spectrum texture was created whether it was needed or not,
so now it's only created if there's flame to be drawn, also split the
code in a separate function.
 - reduce the number of parameters to the main draw function, as most of
them are member of SmokeDomainSettings.
- some other minor cleanups: fold multiple operations into one to get
rid of one local variable, mark variables as `const` when necessary,
unecessary gl draw calls, reorder the code a bit...

Reviewers: campbellbarton, psy-fi

Differential Revision: https://developer.blender.org/D1368
2015-11-22 18:18:43 +01:00
Antony Riakiotakis
8623d75b46 Add check for OpenGL version 2.1 on linux.
Unfortunately there's no easy way to show a messagebox here, so just
print a warning on fstderr and exit. If we don't call exit() here we get
crashes on other blender systems (python, opensubdiv) and it can get
tricky to track the initialization state here, so just using exit()
should do the trick for now.
2015-11-22 18:14:46 +01:00
Mike Erwin
4310a76b60 OpenGL: bump gpu_buffers to GL 2.1
simple stuff!
- remove ARB suffix from core functions & enums
- remove checks for core features (VBOs, generic attribs)
- keep checks for non-core features (draw elements base vertex)
2015-11-22 11:35:21 -05:00
Bastien Montagne
307f1e7d23 Fix T46678: Extending left handle of a VSE multicam effect strip with snap creates frame stills.
Also fixes cache handling for those strips, they need more radical flushing...
2015-11-22 15:33:45 +01:00
Sergey Sharybin
56ead9d34b Cycles: Make branched path tracer covered with requested features
This gives few percent extra memory saving for the CUDA kernel when
using regular path tracing.

Still more like an experiment, but will be handy in the future.
2015-11-22 13:54:51 +05:00
Lukas Stockner
5c5df9dc18 Cycles: Save one transform inversion in the camera sync
Summary: By calculating the Camera-to-Screen-Matrix first, one inversion can be saved in the Camera sync.
It won't really improve speed and/or precision, it's mainly a small cleanup.

Reviewers: sergey, dingto

Subscribers:
2015-11-22 00:58:40 +01:00
Sergey Sharybin
f547bf2f10 Cycles: Make requested features struct aware of subsurface BSDF
This way we'll be able to disable SSS for the scene-adaptive kernel.
2015-11-21 23:00:29 +05:00
Sergey Sharybin
c08727ebab Cycles: Quick experiment with using feature-adaptive kernels for CUDA
Gives few percent of memory improvement for regular feature set kernel
and could give significant memory improvement for Experimental kernel.
It could also give some degree of performance improvement, but this I
didn't really measure reliably yet.

Code is ifdef-ed for now, since it's only working on Linux and requires
CUDA toolkit to be installed (other platform only use precompiled
kernels).

This is just an experiment for now and a base for the proper feature
support in the future (with runtime compilation using CUDA 7?).
2015-11-21 22:16:01 +05:00
Sergey Sharybin
f8ab3fd30f Cycles: add utility function to calculate MD5 hash of a given string 2015-11-21 22:07:59 +05:00
Sergey Sharybin
52d7bc624a Cycles: Make CUDA device internally operate with requested features
This just replaces internal argument `experimental` with `requested_features`
making it possible to access particular requested settings when building
kernels.
2015-11-21 21:49:00 +05:00
Sergey Sharybin
a106da7f1d Cycles: Move build options constructions to DeviceRequestedFeatures
This way it's easier to re-use requested features logic across multiple
device implementations.
2015-11-21 21:42:31 +05:00
Sergey Sharybin
9aafec1ce1 Cycles: Avoid multiple spaces in OpenCL build options
This should solve some compilation errors with compilation on OSX.
2015-11-21 21:33:08 +05:00
Joshua Leung
48f298f09d Fix/Request T46798: Alt+I removes keyframes from all bones, not only selected in Pose Mode
Technically this was more of a feature request, but now the Alt-I operator will
only remove keyframes related to selected bones in Pose Mode. In Object Mode,
it will continue to operate on all keyframes of the object.

This change makes this operator more meaningful when animating in the 3D view.
2015-11-21 16:38:11 +13:00
Campbell Barton
d47fbece51 BMesh: improve face-path-picking w/ tri-fans
Face paths including triangle-fans would often be avoided because
the face center and edge would 'zig-zag'.

Resolve using wighted face center and picking an edge-point between face centers.
2015-11-21 10:12:10 +11:00
Bastien Montagne
9a2290a30b Fix T46826: EXR Compression method set in UI does not always get passed correctly to the actual OpenEXR writing code. 2015-11-20 19:22:51 +01:00
Sergey Sharybin
7e71be261b Cycles: Fix filter glossy being broken after recent changes
Basically we can not use sharp closure as a substitude when filter glossy is
used. This is because we can not blur sharp reflection/refraction.

This is quite quick and not really clean implementation. Not really happy
with manual handling of original settings, but this is as good as we can do
in the quick patch. It's a good acknowledgment and we now can re-consider
some aspects of graph simplification to make such cases more natively
supported.

P.S. This failure would have been shown by our regression tests, so please,
bother a bit to run Cycles's test sweep before doing such optimizations.
2015-11-20 18:18:27 +05:00
Campbell Barton
c4188c2bba Correct error in background job template
Remove check for the path being writable,
the operator raises error in this case.
2015-11-20 16:09:02 +11:00
Campbell Barton
d96ffde491 Fix switching scenes w/ background render
Caused by own de-duplication, b3492978

Scene switching relies on the window context being cleared.
2015-11-20 09:35:37 +11:00
Campbell Barton
86cb772eb7 Cleanup: variable names, ascii diagram 2015-11-20 08:22:44 +11:00
Campbell Barton
410ca0ed92 Recent change to bmesh_jekv caused assert
Note that the mesh was valid, this just stops the radial check from failing.
2015-11-20 08:22:44 +11:00
Bastien Montagne
29d9140fce Fix T46804: Crash using triangulate modifier on a specific mesh.
Issues was again the ugly hack of swapping last generated tri with original face
we use in BMesh triangulate code - here it could lead in some rare case to have
invalid face pointer in doubles list.
2015-11-19 22:02:22 +01:00
Campbell Barton
c7c3f09269 Recent edits to grid-fill removed edgeloop flip 2015-11-20 07:30:16 +11:00
Bastien Montagne
8bdb884289 Fix related to T46804 - BMesh validate code would use invalid pointers after checking them!
Note that this does not fix the issue reported in T46804, juts makes it crash later down in code...
2015-11-19 20:42:46 +01:00
Bastien Montagne
c8bf45c323 Fix T48806: mesh.materials.clear() does not decrement users counts. 2015-11-19 18:03:38 +01:00