Sybren A. Stüvel [Fri, 28 Apr 2017 13:52:07 +0000 (15:52 +0200)]
Merge branch 'master' into blender2.8
Campbell Barton [Fri, 28 Apr 2017 13:52:02 +0000 (23:52 +1000)]
Hide object center and other info when drawing sets
Sybren A. Stüvel [Fri, 28 Apr 2017 11:48:00 +0000 (13:48 +0200)]
Alembic: use object-oriented approach in ABC_read_mesh()
This is easier to extend than the if/else if/else chain that was in place,
and allows for somewhat more granular error messages.
Sybren A. Stüvel [Wed, 26 Apr 2017 14:56:50 +0000 (16:56 +0200)]
Alembic: Construct ISampleSelector once and pass along
Sybren A. Stüvel [Fri, 28 Apr 2017 13:28:41 +0000 (15:28 +0200)]
Fix T51331: fixes for Alembic unit tests on Windows
Sergey Sharybin [Fri, 28 Apr 2017 13:20:34 +0000 (15:20 +0200)]
Cycles: De-duplicate bit magic for decoding image options in OpenCL kernel
Sergey Sharybin [Fri, 28 Apr 2017 13:15:15 +0000 (15:15 +0200)]
Cycles: Simplify code around maximum OpenCL info size allocation
Sergey Sharybin [Fri, 28 Apr 2017 13:08:54 +0000 (15:08 +0200)]
Cycles: Cleanup, de-duplicate image packing of various types
Campbell Barton [Fri, 28 Apr 2017 13:04:29 +0000 (23:04 +1000)]
Correct comment, we need wire_outline data in this case
Sergey Sharybin [Fri, 28 Apr 2017 12:56:22 +0000 (14:56 +0200)]
Cycles: Quick (real) fix for broken textures on OpenCL
Previous fix did not work for mixed textures. This one will over-allocate
information array, but it's better than not being able to render at all.
Some more cleanup and improvement is coming.
Sergey Sharybin [Fri, 28 Apr 2017 12:48:40 +0000 (14:48 +0200)]
Revert "Cycles: Fix image textures were completely broken since recent unlimited textures commit"
This reverts commit
8f4166ee495531fa38b676b0a5ef4c482e89f9a5.
The fix was not correct for cases when we've got float textures.
Campbell Barton [Fri, 28 Apr 2017 12:30:21 +0000 (22:30 +1000)]
Draw Manager: pose-mode custom bone display
Sergey Sharybin [Fri, 28 Apr 2017 12:10:21 +0000 (14:10 +0200)]
Cycles: Cleanup, spelling and braces
Sergey Sharybin [Fri, 28 Apr 2017 12:04:27 +0000 (14:04 +0200)]
Cycles: Fix image textures were completely broken since recent unlimited textures commit
The indexing was totally wrong in both image packing code and image sampling in kernel.
Fixes T51341: Cycles OpenCL corruption in todays buildbot
Sergey Sharybin [Fri, 28 Apr 2017 11:39:14 +0000 (13:39 +0200)]
Cycles: Cleanup, always use braces for blocks
Sergey Sharybin [Fri, 28 Apr 2017 11:24:09 +0000 (13:24 +0200)]
Cycles: Cleanup, indentation in preprocessor
Sergey Sharybin [Fri, 28 Apr 2017 11:22:07 +0000 (13:22 +0200)]
Cycles: Cleanup, use ccl::vector instead of std::vector
Sergey Sharybin [Fri, 28 Apr 2017 11:21:17 +0000 (13:21 +0200)]
Cycles: Cleanup, indentaiton and trailing whitespace and wrapping
Campbell Barton [Fri, 28 Apr 2017 08:43:46 +0000 (18:43 +1000)]
Recent commit state broke lattice vertex drawing
e4d856e3 caused lattice vertices not to draw in editmode.
Campbell Barton [Thu, 27 Apr 2017 19:22:30 +0000 (05:22 +1000)]
Fix draw manager draw-modes interfering with eachother
Campbell Barton [Thu, 27 Apr 2017 18:33:58 +0000 (04:33 +1000)]
Draw Manager: basic text overlay support
Mike Erwin [Thu, 27 Apr 2017 18:32:47 +0000 (14:32 -0400)]
OpenGL: manage legacy state only when WITH_LEGACY_OPENGL=ON
- enabled lights
- alpha test
- texture environment
- point sprites (always enabled in modern GL)
Moved is_clip_plane for better struct packing, no functional change there.
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 18:24:32 +0000 (14:24 -0400)]
OpenGL: don't set texture LoD bias via glTexEnvf
Not supported in core profile. We could do this in GLSL if it's really needed.
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 18:00:38 +0000 (14:00 -0400)]
OpenGL: early exit from functions that don't mix with core profile
These parts will not be part of final viewport, but are called indirectly during the transition. To avoid runtime errors on core profile, exit early -- functions effectively do nothing.
I put the early exits inside the functions to avoid cluttering the code that calls these. But (long term) the calling functions need to change.
Basic shader's detect_options function was unused and full of old, so I deleted it.
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 18:18:33 +0000 (14:18 -0400)]
OpenGL: fix color logic op
GL_LOGIC_OP is a synonym for GL_INDEX_LOGIC_OP, from OpenGL 1.0's indexed color drawing. It's not part of modern GL and causes an error in core profile.
GL_COLOR_LOGIC_OP is still supported in the latest GL. It's the last stage before writing to the framebuffer.
Part of T51164
Campbell Barton [Thu, 27 Apr 2017 17:04:51 +0000 (03:04 +1000)]
Add back text color for legacy drawing
Mike Erwin [Thu, 27 Apr 2017 14:16:20 +0000 (10:16 -0400)]
Gawain: safely orphan immediate mode's VBO
There are multiple ways to orphan a buffer resource, and this code picks the oldest/safest way no matter which OpenGL version we're running.
TODO: use other (more recent) methods after thorough testing
Follow up to
8e0c57a812e8
Mike Erwin [Wed, 26 Apr 2017 22:06:00 +0000 (18:06 -0400)]
OpenGL: don't glGet(GL_RED_BITS) in core profile
or GREEN or BLUE. These are deprecated and cause errors under core profile.
TODO: get color depth value another way
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 15:24:35 +0000 (11:24 -0400)]
OpenGL: stop enabling GL_TEXTURE
Texturing is always enabled in GLSL. Simply use a sampler in the shader.
Replaced gpu_generate_mipmap with glGenerateMipmap since the former just Enabled/Disabled the texture target and called the latter.
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 14:35:12 +0000 (10:35 -0400)]
OpenGL: stop using GL_NORMALIZE
With GLSL there is no need for GL_NORMALIZE. We explicitly normalize in the shader, or (better) send in unit vectors.
Part of T51164
Mike Erwin [Thu, 27 Apr 2017 13:59:19 +0000 (09:59 -0400)]
Gawain: fix pointer arithmetic warning
void* + offset = ???
This Mac-only code works, but wasn't strictly correct. clang doesn't warn about this, gcc does.
Mike Erwin [Wed, 26 Apr 2017 22:12:52 +0000 (18:12 -0400)]
fix Clay compatibility comment
When building WITH_LEGACY_OPENGL, Mac uses GL 2.1, Mesa uses GL 3.0. Has nothing to do with Intel!
Clay assumes GL 3.3 is available.
Mike Erwin [Wed, 26 Apr 2017 21:59:51 +0000 (17:59 -0400)]
OpenGL: restore all 8 lights
fixes a copy/paste mistake
Mike Erwin [Wed, 26 Apr 2017 21:55:59 +0000 (17:55 -0400)]
OpenGL: remove GL_MAP1_VERTEX_3
This is related to OpenGL evaluators (old feature). From my understanding, we don't seem to be actually using it.
Part of T51164
Mike Erwin [Wed, 26 Apr 2017 21:23:43 +0000 (17:23 -0400)]
support OpenGL 3.0 on Linux only when WITH_LEGACY_OPENGL=ON
Part of T49012
Bastien Montagne [Thu, 27 Apr 2017 13:27:00 +0000 (15:27 +0200)]
Getting rid of setlinestyle: transform code.
Note that I also made 'dash anchor point' consistent (the static one,
not the mouse one), in previous code somtimes dashed were anchored to
the static center point, in others, to the moving mouse position, the
later was rather disturbing imho...
brunoT [Thu, 27 Apr 2017 12:54:06 +0000 (08:54 -0400)]
Fix: T50271: Bilateral/Directional blur's iterations is zero by default
Differential Revision: https://developer.blender.org/D2632
Campbell Barton [Thu, 27 Apr 2017 12:01:31 +0000 (22:01 +1000)]
Error in last commit
Campbell Barton [Thu, 27 Apr 2017 11:58:43 +0000 (21:58 +1000)]
Cleanup: split cmake source/headers
Campbell Barton [Thu, 27 Apr 2017 11:48:01 +0000 (21:48 +1000)]
Revert "Fix T51328: Add note to cmdline help that threads must be first"
The help message already notes that argument order matters,
and this doesn't need to be the first.
Campbell Barton [Thu, 27 Apr 2017 11:41:57 +0000 (21:41 +1000)]
Merge branch 'master' into blender2.8
Campbell Barton [Thu, 27 Apr 2017 11:40:18 +0000 (21:40 +1000)]
Cleanup: spelling
Campbell Barton [Thu, 27 Apr 2017 11:35:31 +0000 (21:35 +1000)]
Cleanup: remove unused matrix arg
Campbell Barton [Thu, 27 Apr 2017 09:43:27 +0000 (19:43 +1000)]
3D widgets were obscured by view geometry
Campbell Barton [Thu, 27 Apr 2017 09:31:19 +0000 (19:31 +1000)]
Pose-mode drawing used alpha where it shouldn't
Thomas Dinges [Thu, 27 Apr 2017 09:11:08 +0000 (11:11 +0200)]
Cleanup: Some style and code tweaks to Image Code after changes.
Whitespace and order of switch/case etc. Let's try to stick to float4/byte4/half4/float/byte/half order as defined in "ImageDataType".
Campbell Barton [Thu, 27 Apr 2017 08:44:57 +0000 (18:44 +1000)]
Fix gpuScaleUniform (caused strange pose-bone size)
Campbell Barton [Thu, 27 Apr 2017 08:17:47 +0000 (18:17 +1000)]
Use pose-mode colors for pose-bone drawing
Also move static vars into structs
Stefan Werner [Thu, 27 Apr 2017 07:34:51 +0000 (09:34 +0200)]
Unlimited number of textures for Cycles
This patch allows for an unlimited number of textures in Cycles where the hardware allows. It replaces a number static arrays with dynamic arrays and changes the way the flat_slot indices are calculated. Eventually, I'd like to get to a point where there are only flat slots left and textures off all kinds are stored in a single array.
Note that the arrays in DeviceScene are changed from containing device_vector<T> objects to device_vector<T>* pointers. Ideally, I'd like to store objects, but dynamic resizing of a std:vector in pre-C++11 calls the copy constructor, which for a good reason is not implemented for device_vector. Once we require C++11 for Cycles builds, we can implement a move constructor for device_vector and store objects again.
The limits for CUDA Fermi hardware still apply.
Reviewers: tod_baudais, InsigMathK, dingto, #cycles
Reviewed By: dingto, #cycles
Subscribers: dingto, smellslikedonkey
Differential Revision: https://developer.blender.org/D2650
Campbell Barton [Thu, 27 Apr 2017 07:06:52 +0000 (17:06 +1000)]
Cleanup: use doxy groups for armature
Campbell Barton [Thu, 27 Apr 2017 06:57:11 +0000 (16:57 +1000)]
Fix basic pose-mode select drawing
Campbell Barton [Thu, 27 Apr 2017 06:21:56 +0000 (16:21 +1000)]
Fix wrong scene assigned when using sets
Depsgraph was left with wrong set-scene.
Campbell Barton [Thu, 27 Apr 2017 05:56:04 +0000 (15:56 +1000)]
Fix/workaround crash with non mesh geometry
eevee was crashing on curve grometry, draw without material for now.
Aaron Carlisle [Thu, 27 Apr 2017 02:44:43 +0000 (22:44 -0400)]
Fix T51328: Add note to cmdline help that threads must be first
Mai Lavelle [Wed, 26 Apr 2017 14:22:48 +0000 (10:22 -0400)]
Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
Mai Lavelle [Wed, 26 Apr 2017 14:05:10 +0000 (10:05 -0400)]
Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
Mai Lavelle [Fri, 21 Apr 2017 03:14:34 +0000 (23:14 -0400)]
Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
lazydodo [Wed, 26 Apr 2017 14:46:35 +0000 (08:46 -0600)]
[msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds.
Bastien Montagne [Wed, 26 Apr 2017 19:22:05 +0000 (21:22 +0200)]
Getting rid of setlinestyle: Paint 'line' strokes.
Bastien Montagne [Wed, 26 Apr 2017 18:56:10 +0000 (20:56 +0200)]
Getting rid of setlinestyle: armature drawing code.
Firts usage of 3D version of new dashed line shader... Though not sure
whether that code will be kept for long?
Bastien Montagne [Wed, 26 Apr 2017 18:55:14 +0000 (20:55 +0200)]
Add 3D version of dashed line shader.
This is actually nearly same code as 2D version, maybe we can
deduplicate that later?
Bastien Montagne [Wed, 26 Apr 2017 18:51:17 +0000 (20:51 +0200)]
2D dashed line shader: changed to use viewport side instead of scale.
The scale version was working(ish), but it was not really extendable to
a 3D line version of the shader.
Also note that sequencer view still keeps its 'UI scale' adaptation
(dashes grow together with UI scale setting). Would be nice to do that
everywhere ultimately imho, but nothing urgent here.
Campbell Barton [Wed, 26 Apr 2017 16:49:13 +0000 (02:49 +1000)]
Cleanup: rename select engine -> basic
This is used by depth drawing too and had no selection specific code.
Campbell Barton [Wed, 26 Apr 2017 16:36:56 +0000 (02:36 +1000)]
Pass graph to depth functions
Campbell Barton [Wed, 26 Apr 2017 16:04:56 +0000 (02:04 +1000)]
Draw Manager: cleanup, use doxy categories
Also add DRW_state for accessing current draw state.
Campbell Barton [Wed, 26 Apr 2017 15:43:05 +0000 (01:43 +1000)]
Draw Manager: use engine drawing for depth drawing
Campbell Barton [Wed, 26 Apr 2017 15:01:20 +0000 (01:01 +1000)]
View3D: move depth drawing into own function
No functional changes
Campbell Barton [Wed, 26 Apr 2017 14:58:28 +0000 (00:58 +1000)]
Merge branch 'master' into 28
Sybren A. Stüvel [Wed, 26 Apr 2017 14:50:29 +0000 (16:50 +0200)]
Merge commit 'master@
6ed15c5a41130b55cb57a43a8a9470a91d38c3d5' into blender2.8
# Conflicts:
# source/blender/alembic/intern/abc_exporter.cc
Mai Lavelle [Wed, 26 Apr 2017 14:22:48 +0000 (10:22 -0400)]
Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
Mai Lavelle [Wed, 26 Apr 2017 14:05:10 +0000 (10:05 -0400)]
Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
Mai Lavelle [Fri, 21 Apr 2017 03:14:34 +0000 (23:14 -0400)]
Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
lazydodo [Wed, 26 Apr 2017 14:46:35 +0000 (08:46 -0600)]
[msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds.
Sergey Sharybin [Wed, 26 Apr 2017 13:58:40 +0000 (15:58 +0200)]
Cycles: Fix over-allocation of triangles storage for triangle primitive hair
Was also causing some bad memory access caused by read data from non-initialized
arrays.
Repoted by bzztploink in IRC, thanks!
Sergey Sharybin [Wed, 26 Apr 2017 13:40:32 +0000 (15:40 +0200)]
Fix race condition invalidating object data's bounding box
Sergey Sharybin [Wed, 26 Apr 2017 13:23:46 +0000 (15:23 +0200)]
Ensure task scheduler exists before any threading starts in Blender
Sergey Sharybin [Wed, 26 Apr 2017 13:11:58 +0000 (15:11 +0200)]
Avoid race condition copying Scene for off-thread OpenGL image save
Sergey Sharybin [Wed, 26 Apr 2017 13:06:31 +0000 (15:06 +0200)]
User preferences: Use checkbox for Cycles device selection
It was totally unclear whether the device is enabled or disabled.
Lots of people got fully lost in the current interface.
While the solution is not fully ideal, it is at least solves
ambiguity in the interface.
Sergey Sharybin [Wed, 26 Apr 2017 12:50:21 +0000 (14:50 +0200)]
Threading: Remove thread lock which seems useless
Render data is never guarded by image drawe lock.
Campbell Barton [Wed, 26 Apr 2017 14:01:23 +0000 (00:01 +1000)]
Move depth select loop into its own function
Useful for splitting out draw logic in 2.8x
Sybren A. Stüvel [Wed, 26 Apr 2017 13:31:03 +0000 (15:31 +0200)]
Alembic export: support simple child hairs (Fix T51144)
Simple child hairs don't have a face index number assigned, so the
call to dm->getTessFaceData(dm, num, CD_MFACE) would cause a crash. To
work around this, UV and normal vectors are copied from the parent
hair.
I've also removed an unnecessary call to dm->getTessFaceArray(dm);
Reviewers: kevindietrich
Differential Revision: https://developer.blender.org/D2638
Sybren A. Stüvel [Wed, 26 Apr 2017 13:17:28 +0000 (15:17 +0200)]
Alembic: fixed indentation
Sybren A. Stüvel [Wed, 26 Apr 2017 13:17:19 +0000 (15:17 +0200)]
Alembic: fixed memory leaks
Sybren A. Stüvel [Wed, 26 Apr 2017 13:12:51 +0000 (15:12 +0200)]
Alembic: fixed refcount issue when duplicating imported objects
Duplicating an imported object didn't increment the cache reader's refcount,
whereas removing the duplicate did decrement it. This caused problems.
Sybren A. Stüvel [Wed, 26 Apr 2017 11:01:19 +0000 (13:01 +0200)]
Fix T51280: Alembic: Crash when removing cache modifier
The calls to id_us_plus/min were unnecessary (and caused assertion
failures) as this is already taken care of by transformcache_id_looper().
Bastien Montagne [Wed, 26 Apr 2017 13:16:15 +0000 (15:16 +0200)]
Getting rid of setlinestyle: 3DView ruler.
Bastien Montagne [Wed, 26 Apr 2017 13:15:42 +0000 (15:15 +0200)]
Gawain: add immAttrib2fv helper.
Bastien Montagne [Wed, 26 Apr 2017 11:02:13 +0000 (13:02 +0200)]
Getting rid of setlinestyle: non-camera 3DView render border.
Also fixed wrong color for in-camera render border, and added a comment
to imm_cpack about expected color components order in integer parameter.
Dalai Felinto [Wed, 26 Apr 2017 12:36:32 +0000 (14:36 +0200)]
Fix material preview for Cycles and BI
I had to update the .blend files too, and get them to use collections over the nameless old layers.
Campbell Barton [Wed, 26 Apr 2017 12:39:12 +0000 (22:39 +1000)]
Last commit broke object-armature select
Campbell Barton [Wed, 26 Apr 2017 12:25:38 +0000 (22:25 +1000)]
Draw Manager: pose-bone selection
Jens Verwiebe [Wed, 26 Apr 2017 12:28:36 +0000 (14:28 +0200)]
OSX buildbot: remove redundant option
Jens Verwiebe [Wed, 26 Apr 2017 12:02:53 +0000 (14:02 +0200)]
OSX buildbot: disable unsupported calls for now and use quicktime off default
Campbell Barton [Wed, 26 Apr 2017 11:06:00 +0000 (21:06 +1000)]
Avoid platform dependant PATH_MAX
Bastien Montagne [Wed, 26 Apr 2017 10:26:30 +0000 (12:26 +0200)]
Getting rid of setlinestyle: Squencer space.
Not much to add here, except that it needs the scale of its MVP matrix
to be taken into account here...
Reviewers: merwin, dfelinto
Differential Revision: https://developer.blender.org/D2647
Sybren A. Stüvel [Wed, 26 Apr 2017 10:26:21 +0000 (12:26 +0200)]
Alembic export: also export empties
Exporting an empty creates an Alembic XForm object. The empties can also
be animated.
Sybren A. Stüvel [Wed, 26 Apr 2017 10:25:45 +0000 (12:25 +0200)]
Alembic export: renamed func object_is_shape → object_type_is_exportable
The function doesn't return whether the object is a shape at all, since
it also returns true for camera objects (and soon also for empties). It
returns true when objects of this type can be exported to Alembic at all.
This is now reflected in the name.
Bastien Montagne [Wed, 26 Apr 2017 10:17:46 +0000 (12:17 +0200)]
Getting rid of setlinestyle: 3DView camera view.
Use new 2D dashed line shader in 3DView camera view.
Note that this also involved converting UI_draw_safe_areas() to this
dashed shader, which means it cannot be used anymore with other shaders.
Part of D2647.
Bastien Montagne [Wed, 26 Apr 2017 10:11:40 +0000 (12:11 +0200)]
Move imm_draw_line_box_dashed to GPU_immediate_util.
Bastien Montagne [Wed, 26 Apr 2017 10:04:35 +0000 (12:04 +0200)]
Tweak 2D line dashed shader to take a scale parameter.
Even though in some cases this does not seems useful, in others (like
zommed 2D views) we have to correct MVP matrix scaling to get fixed
dashes size.
Note that we could do that differently (commented about it in shader),
would also have been cleaner to extract that MVP scale from within the
shader, but there does not seem to be a way to initialize uniform values
from within a shader, and would rather avoid recomputing the scale for
every run (especially since 3DViewport does not need it e.g.).
Part of D2647.