blender.git
3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 4 May 2017 08:05:01 +0000 (10:05 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix relationship lines in draw manager [*]
Dalai Felinto [Thu, 4 May 2017 07:57:17 +0000 (09:57 +0200)]
Fix relationship lines in draw manager [*]

This fix doesn't really fix the situaion now because at the moment we
only flush the evaluated flags at DEG_OBJECT_ITER time, which is silly.

But it's all we can do until we have CoW.

So the parent visibility flag is not flushed. And even if we flushed its
visibility flag, we would need to rely on having the parent flag flushed
before we get to the object in question.

Anyways, take this commit as a future fix for when depsgraph comes to
rescue all our souls.

3 years agoFix relationship lines visibility test for legacy viewport
Dalai Felinto [Thu, 4 May 2017 07:47:17 +0000 (09:47 +0200)]
Fix relationship lines visibility test for legacy viewport

3 years agoCycles: Fix unused argument warning when building without debug passes
Sergey Sharybin [Thu, 4 May 2017 07:33:51 +0000 (09:33 +0200)]
Cycles: Fix unused argument warning when building without debug passes

3 years agoBetter fix for duplicate objects not moving them
Dalai Felinto [Wed, 3 May 2017 22:21:28 +0000 (00:21 +0200)]
Better fix for duplicate objects not moving them

(original fix on 51a977a86f6f)

3 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Wed, 3 May 2017 21:55:29 +0000 (23:55 +0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

3 years ago[msvc/make.bat] Limit the amount of simultaneously compiled projects.
lazydodo [Wed, 3 May 2017 21:15:35 +0000 (15:15 -0600)]
[msvc/make.bat] Limit the amount of simultaneously compiled projects.

This was set to maxcpu which in an 8 core box would be 8, each project would then spawn
8 instances of cl.exe, making a possible of 64 simultaneously running compiler instances
slowing the compile down instead of speeding it up.

3 years agoFix Cycles build on Windows
Dalai Felinto [Wed, 3 May 2017 19:16:45 +0000 (21:16 +0200)]
Fix Cycles build on Windows

3 years agoFix projection paint initialization failing
Campbell Barton [Wed, 3 May 2017 19:06:56 +0000 (05:06 +1000)]
Fix projection paint initialization failing

3 years agoSelect new object bases using object's base flag
Campbell Barton [Wed, 3 May 2017 18:14:58 +0000 (04:14 +1000)]
Select new object bases using object's base flag

This fixes object duplicate operator.

3 years agoFix building on Windows and blenderplayer linking after weightpaint engine
Dalai Felinto [Wed, 3 May 2017 18:22:48 +0000 (20:22 +0200)]
Fix building on Windows and blenderplayer linking after weightpaint engine

Those problems were introduced on 20f95de6ba2d32dcff553251ff4de2efd5b76955.

3 years agoFix potential crash introduced by weightpaint engine when no active object
Dalai Felinto [Wed, 3 May 2017 18:10:54 +0000 (20:10 +0200)]
Fix potential crash introduced by weightpaint engine when no active object

3 years agoCleanup: line length
Campbell Barton [Wed, 3 May 2017 17:35:01 +0000 (03:35 +1000)]
Cleanup: line length

3 years agoCorrect struct type (harmless)
Campbell Barton [Wed, 3 May 2017 17:14:08 +0000 (03:14 +1000)]
Correct struct type (harmless)

3 years agoFix error in node flag check
Campbell Barton [Wed, 3 May 2017 16:57:39 +0000 (02:57 +1000)]
Fix error in node flag check

3 years agoWeight painting with draw manager
Luca Rood [Wed, 3 May 2017 16:55:40 +0000 (18:55 +0200)]
Weight painting with draw manager

This implements weight rendering with the draw manager, with all drawing
options (Shading, wire, face masking, vertex masking).

This is part of T51208

Reviewers: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D2654

3 years agoMerge branch 'master' into 28
Campbell Barton [Wed, 3 May 2017 16:58:26 +0000 (02:58 +1000)]
Merge branch 'master' into 28

3 years agoMerge branch 'master' into blender2.8
Lukas Stockner [Wed, 3 May 2017 16:33:02 +0000 (18:33 +0200)]
Merge branch 'master' into blender2.8

3 years agoCorrect over-alloc struct declaration
Campbell Barton [Wed, 3 May 2017 16:14:51 +0000 (02:14 +1000)]
Correct over-alloc struct declaration

3 years agoDraw Manager: Bring pose bones to the pose engine
Dalai Felinto [Wed, 3 May 2017 14:34:28 +0000 (16:34 +0200)]
Draw Manager: Bring pose bones to the pose engine

Note: We should test if the armature is the "armature modifier" parent of the
object.

If any good samaritan feels like tackling this, the function to change
is: DRW_pose_mode_armature

3 years agoMove pose-bone colors into draw_data
Campbell Barton [Wed, 3 May 2017 15:32:16 +0000 (01:32 +1000)]
Move pose-bone colors into draw_data

Also only allocate necessary number of bone segments.

3 years ago"Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.
Bastien Montagne [Wed, 3 May 2017 15:01:00 +0000 (17:01 +0200)]
"Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.

We unfortunately cannot fix this for previous versions of Blender, but
at least the issue (Blender crashing on unknown IDProp types) should now
be addressed for future.

Simply reset unknown IDProp types to integer one, and reset its value to zero.

3 years agoRender API/Cycles: Identify Render Passes by their name instead of a type flag
Lukas Stockner [Tue, 2 May 2017 22:21:18 +0000 (00:21 +0200)]
Render API/Cycles: Identify Render Passes by their name instead of a type flag

Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.

To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.

To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.

From a user perspective, nothing should change with this commit.

Differential Revision: https://developer.blender.org/D2443

Differential Revision: https://developer.blender.org/D2444

3 years agoError in last commit
Campbell Barton [Wed, 3 May 2017 14:43:34 +0000 (00:43 +1000)]
Error in last commit

3 years agoRename bPoseChannel's temp/cache pointer for DrawManager to draw_data.
Bastien Montagne [Wed, 3 May 2017 14:10:25 +0000 (16:10 +0200)]
Rename bPoseChannel's temp/cache pointer for DrawManager to draw_data.

More generic name, this remains a temp solution anyway, until we have
proper handling of temp data from 'magic DEG'! ;)

3 years agoFix bad scaling of BBone single-segment bones in new Armature drawing code.
Bastien Montagne [Wed, 3 May 2017 13:33:30 +0000 (15:33 +0200)]
Fix bad scaling of BBone single-segment bones in new Armature drawing code.

Reported by @campbellbarton over irc, thanks.

3 years agoDraw Manager: Use color-sets for solid pose-bones
Campbell Barton [Wed, 3 May 2017 14:16:31 +0000 (00:16 +1000)]
Draw Manager: Use color-sets for solid pose-bones

3 years agoDraw Manager: use pose bone theme and constraint colors
Campbell Barton [Wed, 3 May 2017 14:00:17 +0000 (00:00 +1000)]
Draw Manager: use pose bone theme and constraint colors

3 years agoCycles: Split kernel - sort shaders
Hristo Gueorguiev [Wed, 3 May 2017 13:30:45 +0000 (15:30 +0200)]
Cycles: Split kernel - sort shaders

Reduce thread divergence in kernel_shader_eval.

Rays are sorted in blocks of 2048 according to shader->id.

On R9 290 Classroom is ~30% faster, and Pabellon Barcelone is ~8% faster.

No sorting for CUDA split kernel.

Reviewers: sergey, maiself

Reviewed By: maiself

Differential Revision: https://developer.blender.org/D2598

3 years agoCode Style: Don't add padding in a function call
Dalai Felinto [Wed, 3 May 2017 12:32:16 +0000 (14:32 +0200)]
Code Style: Don't add padding in a function call

3 years agoMove GPU compositing out of draw-manager off-screen drawing
Campbell Barton [Wed, 3 May 2017 12:13:57 +0000 (22:13 +1000)]
Move GPU compositing out of draw-manager off-screen drawing

Also no need to use VP_legacy_ prefix here.

3 years agoCycles: Fix OpenCL compilation failure after recent color changes
Sergey Sharybin [Wed, 3 May 2017 12:11:19 +0000 (14:11 +0200)]
Cycles: Fix OpenCL compilation failure after recent color changes

It is really confusing to have some functions available in some devices
and not on another devices.

3 years agoCleanup: move off-screen drawing to view3d_draw.c
Campbell Barton [Wed, 3 May 2017 11:59:03 +0000 (21:59 +1000)]
Cleanup: move off-screen drawing to view3d_draw.c

Since offscreen drawing now uses draw engine, this doesn't need to be
considered legacy.

Note that there are some calls into view3d_draw_legacy.c from view3d_draw.c
this is generally not accepted, so its only dont where there are checks
for new/old engine.
Functions exposed to do this use a VP_deprecated prefix.

3 years agoUpdate comment
Campbell Barton [Wed, 3 May 2017 10:13:27 +0000 (20:13 +1000)]
Update comment

3 years agoDraw Manager: Enable Pose engine as part of the weight paint mode
Dalai Felinto [Wed, 3 May 2017 10:38:40 +0000 (12:38 +0200)]
Draw Manager: Enable Pose engine as part of the weight paint mode

We still need to bring pose bone drawing for the pose engine.

Note: In the future, once we get face-widget selection, we will need to
make sure the pose engien only draws then if "weight paint mode" is not
enabled too.

3 years agoDraw Manager: Fix pose mode not working well.
Dalai Felinto [Wed, 3 May 2017 10:10:51 +0000 (12:10 +0200)]
Draw Manager: Fix pose mode not working well.

In the future this will allow us to implement things like face manipulators.

For now however, this is getting on the way of using pose mode
(mesh objects are drawn green).

NOTE: pose engine should also be the one taking care of pose bones

(and for that matter, X-Ray armature option should/could be a property
of the Pose engine even).

3 years agoCycles: Use render visibility for duplis when Render Layer option in viewport is...
Sergey Sharybin [Wed, 3 May 2017 10:05:52 +0000 (12:05 +0200)]
Cycles: Use render visibility for duplis when Render Layer option in viewport is used

Previously the logic was different for duplis and regular objects: regular objects
were using render visibility when Render Layer option is enabled which duplis were
always using viewport visibility when rendering from the viewport.

This was quite confusing because caused different results in viewport and render
when artists were expecting them to match 1:1.

3 years agoEevee: Fix Lamp Roughness.
Clément Foucault [Tue, 2 May 2017 18:33:59 +0000 (20:33 +0200)]
Eevee: Fix Lamp Roughness.

3 years agoGPUMaterial: Force old outputs to fail with EEVEE.
Clément Foucault [Tue, 2 May 2017 17:56:44 +0000 (19:56 +0200)]
GPUMaterial: Force old outputs to fail with EEVEE.

Workaround waiting for compatibility bit / or PyNodes.

3 years agoNodeTree: Add eevee default shader tree.
Clément Foucault [Tue, 2 May 2017 17:55:02 +0000 (19:55 +0200)]
NodeTree: Add eevee default shader tree.

3 years agoEevee: Add "uber" Shader Output Nodes.
Clément Foucault [Tue, 2 May 2017 17:25:25 +0000 (19:25 +0200)]
Eevee: Add "uber" Shader Output Nodes.

Include Metallic and Specular workflow.
Clearcoat and are not implemented yet.

3 years agoDraw Manager: Introduce a foreach function for all shgroups in a pass.
Clément Foucault [Tue, 2 May 2017 17:04:55 +0000 (19:04 +0200)]
Draw Manager: Introduce a foreach function for all shgroups in a pass.

3 years agoFix draw manager w/ cycles
Campbell Barton [Wed, 3 May 2017 10:09:17 +0000 (20:09 +1000)]
Fix draw manager w/ cycles

8b2640f08 introduced the error,
caused by external-engine needing depth mask to be disabled,
which happened to be the case before changing state changing logic.

3 years agoValidate collection properties at readile
Dalai Felinto [Wed, 3 May 2017 09:38:17 +0000 (11:38 +0200)]
Validate collection properties at readile

The alternative would be to do version bump + doversioning every
time a new property is added.

3 years agoMake IDP_MergeGroup recursive
Dalai Felinto [Wed, 3 May 2017 09:37:24 +0000 (11:37 +0200)]
Make IDP_MergeGroup recursive

With this we also do not need IDP_MergeGroupValues anymore.
If this causes problems in the future we can always make recursion an
option (like overwrite is).

3 years agoCycles: Simplify code in SVM image by using new utility function
Sergey Sharybin [Wed, 3 May 2017 09:22:27 +0000 (11:22 +0200)]
Cycles: Simplify code in SVM image by using new utility function

Can not measure any performance difference, so seems the code is identical
and just shorter.

3 years agoCycles: Add utility function to convert float4 color from srgb to linear
Sergey Sharybin [Wed, 3 May 2017 09:19:40 +0000 (11:19 +0200)]
Cycles: Add utility function to convert float4 color from srgb to linear

It will use SSE2 optimized version when is possible.

3 years agoFix crash loading files where outliner treestore isn't set
Campbell Barton [Wed, 3 May 2017 08:10:18 +0000 (18:10 +1000)]
Fix crash loading files where outliner treestore isn't set

3 years agoAdd BBone and Wire Armature draw types to DrawManager.
Bastien Montagne [Wed, 3 May 2017 06:34:24 +0000 (08:34 +0200)]
Add BBone and Wire Armature draw types to DrawManager.

Most of this was copying/adapting code from octahedral existing draw
code, tough part was to get BBone matrices to behave as expected, they
are using a fairly specific setup...

Addresses T51365 and T51362.

3 years agoDraw Manager: fix draw-state switching logic
Campbell Barton [Tue, 2 May 2017 22:20:11 +0000 (08:20 +1000)]
Draw Manager: fix draw-state switching logic

Changing states didn't properly reset between shading groups
causing the GL state to be wrong based on draw order.

States are now only set when changed.

3 years agoCleanup: typedef for empty list
Campbell Barton [Tue, 2 May 2017 19:20:58 +0000 (05:20 +1000)]
Cleanup: typedef for empty list

Without this the intent isn't clear.

3 years agoWorkaround external engines with OpenGL rendering
Campbell Barton [Tue, 2 May 2017 18:59:15 +0000 (04:59 +1000)]
Workaround external engines with OpenGL rendering

For now just do the OpenGL render and don't render using the engine.
This is a slightly odd-use case since it makes more sense to do a regular render.

3 years agoCycles: Remove extra clFinish from driver workaround
Mai Lavelle [Tue, 2 May 2017 17:56:05 +0000 (13:56 -0400)]
Cycles: Remove extra clFinish from driver workaround

These were causing problems with Nvidia OpenCL.

3 years agoCycles: Output split state element size
Mai Lavelle [Sat, 8 Apr 2017 05:35:32 +0000 (01:35 -0400)]
Cycles: Output split state element size

3 years agoCycles: Branched path tracing for the split kernel
Mai Lavelle [Tue, 21 Mar 2017 02:31:54 +0000 (22:31 -0400)]
Cycles: Branched path tracing for the split kernel

This implements branched path tracing for the split kernel.

General approach is to store the ray state at a branch point, trace the
branched ray as normal, then restore the state as necessary before iterating
to the next part of the path. A state machine is used to advance the indirect
loop state, which avoids the need to add any new kernels. Each iteration the
state machine recreates as much state as possible from the stored ray to keep
overall storage down.

Its kind of hard to keep all the different integration loops in sync, so this
needs lots of testing to make sure everything is working correctly. We should
probably start trying to deduplicate the integration loops more now.

Nonbranched BMW is ~2% slower, while classroom is ~2% faster, other scenes
could use more testing still.

Reviewers: sergey, nirved

Reviewed By: nirved

Subscribers: Blendify, bliblubli

Differential Revision: https://developer.blender.org/D2611

3 years agoBGE: Fix silly typo that invalidates negative scaling camera feature.
Benoit Bolsee [Tue, 2 May 2017 18:11:02 +0000 (20:11 +0200)]
BGE: Fix silly typo that invalidates negative scaling camera feature.

Negative scale on camera is a nice trick to invert render image on one
axis at no extra CPU cost. It was implemented in the Decklink branch but
I introduced a typo when porting it to master. It is now fixed.

3 years agoCleanup: consistent arg order
Campbell Barton [Tue, 2 May 2017 17:06:37 +0000 (03:06 +1000)]
Cleanup: consistent arg order

3 years agoDraw Manager: OpenGL render support
Campbell Barton [Tue, 2 May 2017 16:50:29 +0000 (02:50 +1000)]
Draw Manager: OpenGL render support

Works for clay-engine but doesn't draw objects with eevee.

3 years agoDraw Manager: split DRW_draw_view into 2 functions
Campbell Barton [Tue, 2 May 2017 14:45:10 +0000 (00:45 +1000)]
Draw Manager: split DRW_draw_view into 2 functions

Needed for offscreen render

3 years agoCleanup: use depsgraph for scene/layer access
Campbell Barton [Tue, 2 May 2017 14:05:57 +0000 (00:05 +1000)]
Cleanup: use depsgraph for scene/layer access

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 2 May 2017 13:40:23 +0000 (15:40 +0200)]
Merge branch 'master' into blender2.8

3 years agoCycles: Fix missing type declaration in OpenCL image
Sergey Sharybin [Tue, 2 May 2017 13:39:18 +0000 (15:39 +0200)]
Cycles: Fix missing type declaration in OpenCL image

Spotted by Mai in IRC, thanks!

3 years agoRevert "Depsgraph: Link from material to object shading"
Sergey Sharybin [Tue, 2 May 2017 13:31:49 +0000 (15:31 +0200)]
Revert "Depsgraph: Link from material to object shading"

The change was initially needed for Blender 2.8 branch but the actual
function was reverted in there. So no reason to keep dead unused
placeholder in the dependency graph.

This reverts commit fd69ba225540cde5e4c1fa651fb02df21ea0a143.

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 2 May 2017 13:29:00 +0000 (15:29 +0200)]
Merge branch 'master' into blender2.8

3 years agoDraw Manager: No need of glScissor for external engines
Dalai Felinto [Tue, 2 May 2017 13:26:18 +0000 (15:26 +0200)]
Draw Manager: No need of glScissor for external engines

3 years agoCycles integration with Draw Manager
Dalai Felinto [Mon, 1 May 2017 12:55:59 +0000 (14:55 +0200)]
Cycles integration with Draw Manager

We can now use object and other modes on top of Cycles.
Since we are now always on "render_to_view" (old Rendered mode), the
pause button is always visible.

3 years agoOCIO: Fix crash cause by bad IMM usable.
Clément Foucault [Mon, 1 May 2017 23:45:11 +0000 (01:45 +0200)]
OCIO: Fix crash cause by bad IMM usable.

3 years agoCycles: Fix CUDA split kernel
Sergey Sharybin [Tue, 2 May 2017 13:03:51 +0000 (15:03 +0200)]
Cycles: Fix CUDA split kernel

Global size y needs to be a multiple of 16.

3 years agoCycles: Cache split kernels in CUDA device
Sergey Sharybin [Tue, 2 May 2017 13:02:49 +0000 (15:02 +0200)]
Cycles: Cache split kernels in CUDA device

This way we don't re-load kernels for every sample in the viewport.
Additionally, we don't risk global size changed inbetween of samples.

3 years agoRNA: Remove remaining relevant scene->basact and BaseLegacy
Dalai Felinto [Tue, 2 May 2017 10:57:41 +0000 (12:57 +0200)]
RNA: Remove remaining relevant scene->basact and BaseLegacy

Note: In one case (rna_Scene_editmesh_select_mode_set) I had to resort
to the temporary solution of BKE_scene_layer_context_active.

This is fine for now, but it will be a problem once workspaces are
introduced. In this case the fix is to use a temporary value in the set
routine, and actually only set the active object in the update function
(which can take bContext).

3 years agoAdd scene argument for notifiers
Campbell Barton [Mon, 1 May 2017 23:58:01 +0000 (09:58 +1000)]
Add scene argument for notifiers

From workspaces branch

3 years agoEevee: Add support for legacy materials node. (not PBR)
Clément Foucault [Mon, 1 May 2017 16:11:04 +0000 (18:11 +0200)]
Eevee: Add support for legacy materials node. (not PBR)

3 years agoGPUMaterial: Making material node tree compatible with new drawmanager.
Clément Foucault [Mon, 1 May 2017 16:09:50 +0000 (18:09 +0200)]
GPUMaterial: Making material node tree compatible with new drawmanager.

- code_generate_fragment : Making sure that shaders uses the new uniforms.
- code_generate_vertex_new : create require attribute based on their names and not their id (see draw_cache_impl_mesh.c).
- add support for ramp textures.

3 years agoMesh Batch Cache: Add support for uv/vcol/tangent data layers.
Clément Foucault [Mon, 1 May 2017 15:58:15 +0000 (17:58 +0200)]
Mesh Batch Cache: Add support for uv/vcol/tangent data layers.

This is a bad implementation waiting for some improvement that are :
- Gawain support for multiple names. -> will remove duplication of attribute alloc
- Glsl safe name string escaping. -> will remove any risk of hash colision.

Old glsl drawing was relying on attribute being choosen by DerivedMesh at drawing time.
For this reason, we declare all possible attrib "name" for each data layer inside the batches.
In the glsl code, we declare required data by type and name.
Then Gawain only bind vbos if names correspond.
This is way cleaner as we do not need to access the CD itself when drawing.

One other problem is that the hash maybe 11 caracters long and rapidly overload gawain's attrib name buffer.

3 years agoEevee: Change MAX2 to max_ff
Clément Foucault [Thu, 27 Apr 2017 20:27:41 +0000 (22:27 +0200)]
Eevee: Change MAX2 to max_ff

3 years agoEevee: World nodetree gpumaterial compatibility.
Clément Foucault [Thu, 27 Apr 2017 20:27:09 +0000 (22:27 +0200)]
Eevee: World nodetree gpumaterial compatibility.

- Unify GPUMaterial creation (world/mesh).
- Support for multiple shader variations (not used for now).
- Convert GPUInputs to DRWUniforms to be used with the draw manager.
- Nodetree Update is not supported. The only way to refresh the shaders is to change render engine.
- Cleanup in GPUPass.
- Add new temporary Node Compatibility type. Compatibility types should be removed in the future.

3 years agoGetting rid of setlinestyle: FCurves drawing.
Bastien Montagne [Mon, 1 May 2017 15:43:20 +0000 (17:43 +0200)]
Getting rid of setlinestyle: FCurves drawing.

3 years agoGetting rid of setlinestyle: last bit in NLA.
Bastien Montagne [Mon, 1 May 2017 14:46:40 +0000 (16:46 +0200)]
Getting rid of setlinestyle: last bit in NLA.

Note that smooth-shaded outlines of muted NLA strips should also be
dashed, not sure how to do that currently (in a simple way), so kept
them solid for now.

3 years agoFix for issue when duplicating text objects
Dalai Felinto [Mon, 1 May 2017 14:46:43 +0000 (16:46 +0200)]
Fix for issue when duplicating text objects

The crash happens with Cycles and Font objects if we get Cycles working
with draw manager.

3 years agoCleanup/followup to previous commit: get rid of dashed-specific helpers.
Bastien Montagne [Mon, 1 May 2017 14:32:09 +0000 (16:32 +0200)]
Cleanup/followup to previous commit: get rid of dashed-specific helpers.

Those are no more needed.

3 years agoReworked version of dashed line shader.
Bastien Montagne [Mon, 1 May 2017 14:21:53 +0000 (16:21 +0200)]
Reworked version of dashed line shader.

Using geometry shader allows us to get rid of the 'line origin' extra
vertex attribute, which means dashed shader no longer requires fiddling
with those vertex attributes definition, and, most importantly, does not
require anymore special drawing code!

As you can see, this makes code much simpler, and much less verbose,
especially in complex cases.

In addition, changed how dashes are handled, to have two 'modes', a
simple one with single color (using default "color" uniform name), and a
more advanced one allowing more complex and multi-color patterns.

Note that since GLSL 1.2 does not support geometry shaders, a hack was
added for now (which gives solid lines, but at least does not make
Blender crash).

3 years agoWITH_CLAY_ENGINE: Should be used for CLAY only, not drawmanager
Dalai Felinto [Mon, 1 May 2017 13:37:27 +0000 (15:37 +0200)]
WITH_CLAY_ENGINE: Should be used for CLAY only, not drawmanager

3 years agoDraw Manager: Fix copy-paste harmless comment "typo"
Dalai Felinto [Mon, 1 May 2017 12:24:15 +0000 (14:24 +0200)]
Draw Manager: Fix copy-paste harmless comment "typo"

3 years agoBlender 2.8: Update arc config
Sergey Sharybin [Mon, 1 May 2017 13:20:19 +0000 (15:20 +0200)]
Blender 2.8: Update arc config

3 years agoCheck we've got GLEW version 2 when building with core profile
Sergey Sharybin [Mon, 1 May 2017 08:37:04 +0000 (10:37 +0200)]
Check we've got GLEW version 2 when building with core profile

There was a bug in older GLEW version which kept glGenVertexArrays as NULL
when 3.2 core context is requested [1].

Didn't find a way to check GLEW version from CMake, it seems the version
is not really exposed to the header.

[1] https://sourceforge.net/p/glew/bugs/124/

3 years agofix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt
lazydodo [Sun, 30 Apr 2017 16:52:38 +0000 (10:52 -0600)]
fix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt

3 years agoGetting rid of setlinestyle: sample line in Image space.
Bastien Montagne [Sat, 29 Apr 2017 18:41:57 +0000 (20:41 +0200)]
Getting rid of setlinestyle: sample line in Image space.

3 years agoGetting rid of setlinestyle: UV editor drawing.
Bastien Montagne [Sat, 29 Apr 2017 18:12:30 +0000 (20:12 +0200)]
Getting rid of setlinestyle: UV editor drawing.

3 years agoGetting rid of setlinestyle: remove gpencil's debug-only dashed line drawing.
Bastien Montagne [Sat, 29 Apr 2017 17:42:04 +0000 (19:42 +0200)]
Getting rid of setlinestyle: remove gpencil's debug-only dashed line drawing.

No need to add extra complexity of conditional dashing here for now!

3 years agoGetting rid of setlinestyle: ed_util's pos-to-mouse dashed line.
Bastien Montagne [Sat, 29 Apr 2017 17:40:32 +0000 (19:40 +0200)]
Getting rid of setlinestyle: ed_util's pos-to-mouse dashed line.

3 years agoGetting rid of setlinestyle: GPencil eraser.
Bastien Montagne [Sat, 29 Apr 2017 14:07:26 +0000 (16:07 +0200)]
Getting rid of setlinestyle: GPencil eraser.

Note the ugly hack on number of segments for outline dashed circle, to
get an OK-ish rendering of dashes...

3 years agoGetting rid of setlinestyle: add imm_draw_circle_wire_dashed() util.
Bastien Montagne [Sat, 29 Apr 2017 14:04:33 +0000 (16:04 +0200)]
Getting rid of setlinestyle: add imm_draw_circle_wire_dashed() util.

Needed a bit of twisting in generic private func behind the imm_draw_circle
helpers, but think it's fine.

Note that this demonstrate yet another downside of new dashed shader
compared to olde line style: not only does it needs more complex setup,
and can only work with PRIM_LINES type of primitives, but it also
behaves totally wrong with chained short segments!

We really need to find a better way to do this effect at some point. :(

3 years agoCleanup: comment blocks
Campbell Barton [Sat, 29 Apr 2017 17:14:57 +0000 (03:14 +1000)]
Cleanup: comment blocks

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sat, 29 Apr 2017 17:05:34 +0000 (03:05 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: comment blocks
Campbell Barton [Sat, 29 Apr 2017 16:58:36 +0000 (02:58 +1000)]
Cleanup: comment blocks

3 years agoView3D: support both orbit select & depth
Campbell Barton [Sat, 29 Apr 2017 16:38:38 +0000 (02:38 +1000)]
View3D: support both orbit select & depth

When using both preferences, use cursor depth when nothings selected.

3 years agoCurve Fitting: minor change to re-fitting method
Campbell Barton [Sat, 29 Apr 2017 14:01:16 +0000 (00:01 +1000)]
Curve Fitting: minor change to re-fitting method

Avoid calculating a new split-index when re-fitting.

While checking if a knot can be removed, the index with the highest error
can be used as a candidate to replace the knot
(in the case it can't be removed).

3 years agoGetting rid of setlinestyle: NLA (part I).
Bastien Montagne [Sat, 29 Apr 2017 11:15:48 +0000 (13:15 +0200)]
Getting rid of setlinestyle: NLA (part I).

Also restore drawing of local action markers in NLA strips...

Note: there is another usage of setlinestyle in this file, not sure how
to hanlde it for now, so will leave it for later...

3 years agoGetting rid of setlinestyle: Color ramp markers.
Bastien Montagne [Sat, 29 Apr 2017 10:57:14 +0000 (12:57 +0200)]
Getting rid of setlinestyle: Color ramp markers.

3 years agoGetting rid of setlinestyle: Text space margin line.
Bastien Montagne [Sat, 29 Apr 2017 10:43:37 +0000 (12:43 +0200)]
Getting rid of setlinestyle: Text space margin line.