2 years agothe maxz and minz shaders were not being compiled pbr-viewport
Dalai Felinto [Wed, 2 Nov 2016 18:52:11 +0000 (19:52 +0100)]
the maxz and minz shaders were not being compiled

2 years agoFix left over from merge
Dalai Felinto [Tue, 1 Nov 2016 21:00:47 +0000 (22:00 +0100)]
Fix left over from merge

Linux did not mind with them, but luckily Linux is more strict

2 years agoCleanups to make the patch lean
Dalai Felinto [Fri, 21 Oct 2016 12:52:29 +0000 (12:52 +0000)]
Cleanups to make the patch lean

2 years ago'gmon.out' should have never been here
Dalai Felinto [Fri, 21 Oct 2016 12:51:27 +0000 (12:51 +0000)]
'gmon.out' should have never been here

2 years agoMerge remote-tracking branch 'origin/blender2.8' into pbr-viewport
Dalai Felinto [Fri, 21 Oct 2016 12:50:28 +0000 (12:50 +0000)]
Merge remote-tracking branch 'origin/blender2.8' into pbr-viewport

2 years agoFix build for gameengine
Dalai Felinto [Fri, 21 Oct 2016 12:50:04 +0000 (12:50 +0000)]
Fix build for gameengine

2 years agoMerge remote-tracking branch 'origin/blender2.8' into pbr-viewport
Dalai Felinto [Fri, 21 Oct 2016 12:29:08 +0000 (12:29 +0000)]
Merge remote-tracking branch 'origin/blender2.8' into pbr-viewport


2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 21 Oct 2016 12:22:50 +0000 (12:22 +0000)]
Merge remote-tracking branch 'origin/master' into blender2.8


2 years agoCycles: Fix another OpenCL logging issue
Lukas Stockner [Fri, 21 Oct 2016 00:49:00 +0000 (02:49 +0200)]
Cycles: Fix another OpenCL logging issue

Previously an error message would be printed whenever the OpenCL build produced output.
However, some frameworks seem to print extra information even if the build succeeded, so now the actual returned error is checked as well.
When --debug-cycles is activated, the build output will always be printed, otherwise it only gets printed if there was an error.

2 years agoMerge remote-tracking branch 'origin/blender2.8' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 21:30:54 +0000 (21:30 +0000)]
Merge remote-tracking branch 'origin/blender2.8' into pbr-merge


2 years agoOpenGL: draw lamp objects with new imm mode
Mike Erwin [Thu, 20 Oct 2016 20:55:40 +0000 (16:55 -0400)]
OpenGL: draw lamp objects with new imm mode

Previous commit in blender2.8 branch had some... unintended
consequences. This one should be better.

Part of T49043. Also uses new matrix API (T49450)

2 years agoMerge remote-tracking branch 'origin/master' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 19:37:36 +0000 (19:37 +0000)]
Merge remote-tracking branch 'origin/master' into pbr-merge


2 years agoOpenGL: box & circle outline functions that work with 3D position (z=0)
Mike Erwin [Thu, 20 Oct 2016 18:33:32 +0000 (14:33 -0400)]
OpenGL: box & circle outline functions that work with 3D position (z=0)

New immediate mode API is strict about attribute formats. These new functions make existing code easier to port.

Supports T49043

2 years agoGawain: closer integration of immediate mode & matrix APIs
Mike Erwin [Thu, 20 Oct 2016 18:29:59 +0000 (14:29 -0400)]
Gawain: closer integration of immediate mode & matrix APIs

- any shader program can use matrix state (not only built-in shaders)
- you can mix matrix & begin/end calls, and the bound shader will use the latest matrix state

Part of T49450 & T49043

2 years agoMerge commit 'e5c32844678e292a084d6d97eb2d4ba6affc217d' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 18:29:32 +0000 (18:29 +0000)]
Merge commit 'e5c32844678e292a084d6d97eb2d4ba6affc217d' into pbr-merge


2 years agoMerge commit '4b046c530d3e14d7737c4770b9ae07942f4c6047' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 18:23:17 +0000 (18:23 +0000)]
Merge commit '4b046c530d3e14d7737c4770b9ae07942f4c6047' into pbr-merge


2 years agoOpenGL: dirty bit for GPU matrix API
Mike Erwin [Thu, 20 Oct 2016 18:17:54 +0000 (14:17 -0400)]
OpenGL: dirty bit for GPU matrix API

Have matrices changed since the most recent bind?

Part of T49450

2 years agoMerge commit '4b046c530d3e14d7737c4770b9ae07942f4c6047^' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 18:16:24 +0000 (18:16 +0000)]
Merge commit '4b046c530d3e14d7737c4770b9ae07942f4c6047^' into pbr-merge

2 years agoMerge commit '2b240b0430787814316f3b3166453c6d85b017f3' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 17:44:51 +0000 (17:44 +0000)]
Merge commit '2b240b0430787814316f3b3166453c6d85b017f3' into pbr-merge


2 years agoAlembic: only export custom data (UVs, VCols) once, on the first frame.
Kévin Dietrich [Thu, 20 Oct 2016 17:43:22 +0000 (19:43 +0200)]
Alembic: only export custom data (UVs, VCols) once, on the first frame.

This would cause Alembic to throw an exception and fail exporting
animations because it was trying to recreate and overwrite the
attributes for each frame.

2 years agoMerge commit '7830ec54186e8b05a366775e02c6457eb83814a3' into pbr-merge
Dalai Felinto [Thu, 20 Oct 2016 17:26:16 +0000 (17:26 +0000)]
Merge commit '7830ec54186e8b05a366775e02c6457eb83814a3' into pbr-merge


2 years agoMerge commit '9269574089a742130f02c0a1184a19d94f0e665d' into pbr-online
Dalai Felinto [Thu, 20 Oct 2016 16:03:44 +0000 (16:03 +0000)]
Merge commit '9269574089a742130f02c0a1184a19d94f0e665d' into pbr-online

Merge conflicts fixes include fix on ob->reflectionplane for write and
read, and a few manual fixes to account for the ID remap changes


2 years agoFix T49797: Exception from scene update handler might leak external engine descriptors
Sergey Sharybin [Thu, 20 Oct 2016 11:32:52 +0000 (13:32 +0200)]
Fix T49797: Exception from scene update handler might leak external engine descriptors

This was causing memory leaks in Cycles.

Some more detailed information in the comment in the code.

Seems to be safe and nice enough for 2.78a.

2 years agoimmediate mode: outliner background
Dalai Felinto [Thu, 20 Oct 2016 01:43:46 +0000 (01:43 +0000)]
immediate mode: outliner background

I tried using immRecti instead, but it didn't work. The current approach
should be more efficient anyways (since GL_TRIANGLE_FAN wouldn't work

2 years agoimmediate mode: ed_util.c
Dalai Felinto [Wed, 19 Oct 2016 23:59:22 +0000 (23:59 +0000)]
immediate mode: ed_util.c

note: I switched one of the glVertex2iv into glVertex2fv to use the same attrib_id

2 years agoPython API: add full_path parameter for bpy.ops.ui.copy_data_path_button.
christian brinkmann [Wed, 19 Oct 2016 22:27:14 +0000 (00:27 +0200)]
Python API: add full_path parameter for bpy.ops.ui.copy_data_path_button.

Also use the operator as part of the UI keymap now, to deduplicate code and let
users configure a custom shortcut.

Reviewed By: brecht

Differential Revision:

2 years agoFix T49793 : Fix enabling SSE2 globally for msvc.
lazydodo [Wed, 19 Oct 2016 16:06:45 +0000 (10:06 -0600)]
Fix T49793 : Fix enabling SSE2 globally for msvc.

When feeding msvc both /arch:sse2 and /arch:sse it's not smart enough to pick the best option, just goes with the last option

2 years agoFix T49775: Appending data with internal dependency cycles prevents correct clearing...
Bastien Montagne [Wed, 19 Oct 2016 12:29:43 +0000 (14:29 +0200)]
Fix T49775: Appending data with internal dependency cycles prevents correct clearing of linked data-blocks.

This is not a simple fix, but imho still needs to be backported to 2.78a...

2 years agoOpenGL: draw empties with new imm mode
Mike Erwin [Wed, 19 Oct 2016 08:01:15 +0000 (04:01 -0400)]
OpenGL: draw empties with new imm mode

Part of T49043

2 years agoOpenGL: draw cameras using new matrix API
Mike Erwin [Wed, 19 Oct 2016 00:57:36 +0000 (20:57 -0400)]
OpenGL: draw cameras using new matrix API

Also removed some extra push/pops.
Ref T49450

2 years agoOpenGL: draw cameras with new immediate mode
Mike Erwin [Wed, 19 Oct 2016 00:27:24 +0000 (20:27 -0400)]
OpenGL: draw cameras with new immediate mode

Mostly the same as before. Except:
- avoid drawing same lines multiple times
- helper functions take "bool filled" argument instead of GLenum
- drawcamera_volume draws its own near & far planes

2 years agoGawain: yet another way to set uniform color
Mike Erwin [Wed, 19 Oct 2016 00:22:22 +0000 (20:22 -0400)]
Gawain: yet another way to set uniform color

2 years agofix narrow text entry fields
Mike Erwin [Tue, 18 Oct 2016 21:34:29 +0000 (17:34 -0400)]
fix narrow text entry fields

widget_draw_text was calculating wrong display length when field is too narrow to show entire input string. Gawain assert caught this 11 function calls away!

Thanks to @ianwill for reporting.

2 years agoskip drawing of gpencil strokes with overall thickness <= zero
Mike Erwin [Tue, 18 Oct 2016 17:12:40 +0000 (13:12 -0400)]
skip drawing of gpencil strokes with overall thickness <= zero

Fixes an assert in drawing code.

Might need further work to support variable-thickness strokes (from pressure-sensitive stylus). This all is due for geometry shader overhaul anyway.

2 years agodraw gpencil dots smooth
Mike Erwin [Tue, 18 Oct 2016 17:07:35 +0000 (13:07 -0400)]
draw gpencil dots smooth

Some strokes are just single dots. Draw these smooth / antialiased.

2 years agoOpenGL: new built-in shader for smooth round 3D points
Mike Erwin [Tue, 18 Oct 2016 17:03:30 +0000 (13:03 -0400)]
OpenGL: new built-in shader for smooth round 3D points

2 years ago[msvc] Minor cleanup in blenkernel.
lazydodo [Tue, 18 Oct 2016 15:25:14 +0000 (09:25 -0600)]
[msvc] Minor cleanup in blenkernel.

this patch resolves the following warnings;

Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 764
Warning C4098 'attach_stabilization_baseline_data': 'void' function returning a value blenkernel\intern\tracking_stabilize.c 139
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\cachefile.c 148
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\paint.c 413
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\editderivedmesh.c 591
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\library_remap.c 709
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 754
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 758
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 759
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 763
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 764
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 765
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 769
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 770
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\DerivedMesh.c 3458

It's mostly things where the signature in the .h and the actual implementation in the .c do not match.  And a bunch functions who do not match the TaskRunFunction declaration cause they leave out the __restrict keyword.

Reviewers: brecht, juicyfruit, sergey

Reviewed By: sergey

Subscribers: Blendify

Differential Revision:

2 years ago[windows] Create A Blender Desktop Shortcut in the msi installer , fixes T49522
lazydodo [Tue, 18 Oct 2016 15:21:58 +0000 (09:21 -0600)]
[windows] Create A Blender Desktop Shortcut in the msi installer , fixes T49522

2 years agoFix: Append 'Object proxy' hack checking for local/linked usages before those flags...
Bastien Montagne [Tue, 18 Oct 2016 12:15:59 +0000 (14:15 +0200)]
Fix: Append 'Object proxy' hack checking for local/linked usages before those flags were set!

Dummy mistake, to be backported to 2.78a.

2 years agoClarified warning in EnumProperty
Sybren A. Stüvel [Tue, 18 Oct 2016 09:24:33 +0000 (11:24 +0200)]
Clarified warning in EnumProperty

Blender doesn't necessarily crash when Python doesn't keep references to
the returned strings. As a result, someone that implements this incorrectly
could be lulled into a false sense of correctness by Blender not crashing.

2 years agoOpenGL: tweak image shaders & code that uses them
Mike Erwin [Tue, 18 Oct 2016 04:08:34 +0000 (00:08 -0400)]
OpenGL: tweak image shaders & code that uses them

- rename image shaders to describe exactly what they do
- rename inputs to match other built-in shaders
- set & use active texture unit
- no need to enable/disable textures with GLSL
- pull vertex format setup out of loops

2 years agominor cleanup & deprecation
Mike Erwin [Tue, 18 Oct 2016 03:48:12 +0000 (23:48 -0400)]
minor cleanup & deprecation

2 years agoOpenGL: draw image empties with new API
Mike Erwin [Tue, 18 Oct 2016 00:33:59 +0000 (20:33 -0400)]
OpenGL: draw image empties with new API

This extensive rewrite caches the image texture in VRAM. Can handle images up to OpenGL limits (8K or 16K).

Part of T49043 & T49450

2 years agoFixup for doversion (rB8d573aa0 and rBa7e74791)
Dalai Felinto [Mon, 17 Oct 2016 19:43:35 +0000 (19:43 +0000)]
Fixup for doversion (rB8d573aa0 and rBa7e74791)

2 years agoFix for gpu_shader_2D_texture_2D_frag.glsl
Dalai Felinto [Mon, 17 Oct 2016 19:23:01 +0000 (19:23 +0000)]
Fix for gpu_shader_2D_texture_2D_frag.glsl

Report and patch by Willian Padovani Germano (ianwill)

2 years agoProper fix for crash when joining areas that doesn't break manipulators
Julian Eisel [Mon, 17 Oct 2016 17:25:56 +0000 (19:25 +0200)]
Proper fix for crash when joining areas that doesn't break manipulators

Turns out CTX_wm_region returns mostly NULL in wm_manipulatormaps_handled_modal_update. Now propertly unsetting area/region data of handlers when deleting area/region.

2 years agoFix T49722: Appending Bug (Groups).
Bastien Montagne [Mon, 17 Oct 2016 12:49:35 +0000 (14:49 +0200)]
Fix T49722: Appending Bug (Groups).

One day we'll have to reconsider why some many 'real' ID usages are not
refcounting... :(

To be backported to 2.78a.

2 years agoUV Editor: Add filter option to control what is visible when Draw Other Objects is...
Sergey Sharybin [Mon, 17 Oct 2016 12:28:16 +0000 (14:28 +0200)]
UV Editor: Add filter option to control what is visible when Draw Other Objects is enabled

Previously the editor will always try to only show UV faces with the same exact active
image or image texture, which is quite difficult to control on a production shaders, where
each material can have multiple objects assigned.

The idea of this commit is to bring option which allows to easily control what to display
when "Draw Other Objects" is enabled, so currently we can have old behavior ("Same Image")
or tell editor to show everything ("All"). In the future we can extend it with such filters
as "Same Material" and things like that.

Hopefully this will help @eyecandy's workflow of texturing.

2 years agoFix T49738: Hair Add Brush doesn't work
Sergey Sharybin [Mon, 17 Oct 2016 10:37:50 +0000 (12:37 +0200)]
Fix T49738: Hair Add Brush doesn't work

the issue was caused by wrong default value for brush particle count
which was clamped on display from 0 to 1. This is technically a regression
but how to port this to 2.78a?

2 years agoFix T49630: Cycles: Swapped shader and bake kernels
Lukas Stockner [Mon, 17 Oct 2016 10:28:01 +0000 (12:28 +0200)]
Fix T49630: Cycles: Swapped shader and bake kernels

The problem here was, as the title says, that the two kernels were swapped.
Since shader evaluation is only used for building the samling map when World MIS is enabled, rendering without it would still work fine, although baking also was broken.

2 years agoCycles: Improve OpenCL kernel compilation logging
Lukas Stockner [Mon, 17 Oct 2016 09:48:24 +0000 (11:48 +0200)]
Cycles: Improve OpenCL kernel compilation logging

The previous refactor changed the code to use a separate logging mechanism to support multithreaded compilation.
However, since that's not supported by any frameworks yes, it just resulted in bad logging behaviour.
So, this commit changes the logging to go diectly to stdout/stderr once again by default.

2 years agoOpenGL: disable checks for NPOT texture support
Mike Erwin [Mon, 17 Oct 2016 06:36:51 +0000 (02:36 -0400)]
OpenGL: disable checks for NPOT texture support

Non-power-of-two textures are always allowed. Keeping the disabled checks in the code in case we support OpenGL ES in the future. Even then it should be a compile-time check, not at run-time.

2 years agoGawain: tweak tracking of unassigned attributes (no API change)
Mike Erwin [Mon, 17 Oct 2016 03:50:18 +0000 (23:50 -0400)]
Gawain: tweak tracking of unassigned attributes (no API change)

Hoping for a small performance win.

2 years agoOpenGL: draw object centers nicer
Mike Erwin [Sun, 16 Oct 2016 22:49:48 +0000 (18:49 -0400)]
OpenGL: draw object centers nicer

Shaders + new immediate mode = very nice dots.

Part of T49043

2 years agoOpenGL: new built-in shader for smooth round 3D points w/ outline
Mike Erwin [Sun, 16 Oct 2016 22:43:24 +0000 (18:43 -0400)]
OpenGL: new built-in shader for smooth round 3D points w/ outline

2 years agoOpenGL: new immUniformThemeColorShadeAlpha function
Mike Erwin [Sun, 16 Oct 2016 21:04:17 +0000 (17:04 -0400)]
OpenGL: new immUniformThemeColorShadeAlpha function

Plus some naming cleanup.

Supports T49043

2 years agoGawain: new immUniform4fv function
Mike Erwin [Sun, 16 Oct 2016 20:59:57 +0000 (16:59 -0400)]
Gawain: new immUniform4fv function

2 years agofix IS_VIEWPORT_LEGACY macro
Mike Erwin [Sun, 16 Oct 2016 20:56:36 +0000 (16:56 -0400)]

2 years agoFix outliner items sometimes not opening
Julian Eisel [Sun, 16 Oct 2016 19:41:10 +0000 (21:41 +0200)]
Fix outliner items sometimes not opening

Own mistake in 9a9a663f40d55. Guessed there is a case where we have to rebuild the tree but everything seemed fine... It didn't work in display modes like "Data-Blocks".

2 years agoFix T49746: crash loading user preferences with missing operators.
Brecht Van Lommel [Sun, 16 Oct 2016 19:19:52 +0000 (21:19 +0200)]
Fix T49746: crash loading user preferences with missing operators.

2 years agoMore fixes for keyframe theme options
Julian Eisel [Sun, 16 Oct 2016 18:30:51 +0000 (20:30 +0200)]
More fixes for keyframe theme options

Couple of issues here:
* Missing initialization for 3D view keyframe options for "Reset to Default Theme"
* Alpha values not reset correctly on "Reset to Default Theme"
* Alpha values of timeline keyframe options not reset correctly for old files
Also corrected old version patches even though they're overridden later, to avoid more issues in case people copy this code.

Corrections to d7af7a1e04c243 and 8d573aa0ecb61

2 years agoMore fixes for keyframe theme options
Julian Eisel [Sun, 16 Oct 2016 18:30:51 +0000 (20:30 +0200)]
More fixes for keyframe theme options

Couple of issues here:
* Missing initialization for 3D view keyframe options for "Reset to Default Theme"
* Alpha values not reset correctly on "Reset to Default Theme"
* Alpha values of timeline keyframe options not reset correctly for old files
Also corrected old version patches even though they're overridden later, to avoid more issues in case people copy this code.

Corrections to d7af7a1e04c243 and 8d573aa0ecb61

2 years agoFix crash when joining areas (caused by manipulators)
Julian Eisel [Sun, 16 Oct 2016 17:28:12 +0000 (19:28 +0200)]
Fix crash when joining areas (caused by manipulators)

Manipulator code tried to access the removed region from handler->op_region. Use context region now.

2 years agoCleanup: Quiet warnings, use RAD2DEG macro
Julian Eisel [Sun, 16 Oct 2016 15:28:12 +0000 (17:28 +0200)]
Cleanup: Quiet warnings, use RAD2DEG macro

2 years agoFix assert in the wrong place, should be moved earlier to do anything.
Chase Willden [Sun, 16 Oct 2016 13:50:53 +0000 (15:50 +0200)]
Fix assert in the wrong place, should be moved earlier to do anything.

Reviewed By: brecht

Differential Revision:

2 years agoMerge branch 'master' into blender2.8
Julian Eisel [Sun, 16 Oct 2016 13:33:00 +0000 (15:33 +0200)]
Merge branch 'master' into blender2.8


2 years agoCleanup: Unused parameters in Outliner
Julian Eisel [Sun, 16 Oct 2016 13:19:18 +0000 (15:19 +0200)]
Cleanup: Unused parameters in Outliner

These were only passed to own recursion calls.

2 years agoFix missing outliner redraw when adding VSE strip
Julian Eisel [Sun, 16 Oct 2016 12:39:06 +0000 (14:39 +0200)]
Fix missing outliner redraw when adding VSE strip

Needed for outliner "Sequence" display mode.

2 years agoOutliner: Rework element selection behavior
Julian Eisel [Sun, 16 Oct 2016 00:53:11 +0000 (02:53 +0200)]
Outliner: Rework element selection behavior

* LMB now replaces selection instead of adding to it. Shift+LMB adds to selection (or removes if already selected). This is usual selection behavior Blender.
* Outliner selection isn't completely separate from object/sequencer-strip/render-layer/... selection anymore, when selecting an outliner item we now always try to select (and activate) the object it belongs to. Previously you had to click the name or icon of an item to select the object (or whatever) and on empty space within the row to set outliner selection.
* Collapsed items may show click-able icons for their children (nothing new). Clicking on such an icon will also select the hidden item it represents now, you'll notice after opening the parent. This valid from a technical POV, I'm not sure if this is wanted from user POV though. Changing would be easy, feedback welcome!
* Code cleanup.

Part of T37430.

2 years agoOutliner: Avoid rebuilding tree when mouse-hover highlight changes
Julian Eisel [Sat, 15 Oct 2016 17:44:37 +0000 (19:44 +0200)]
Outliner: Avoid rebuilding tree when mouse-hover highlight changes

2 years agoOpenGL: add GLSL #version 330, drop 140 and 150
Mike Erwin [Sun, 16 Oct 2016 07:18:17 +0000 (03:18 -0400)]
OpenGL: add GLSL #version 330, drop 140 and 150

GL 3.3 is the new minimum. Compatibility profile for now, core profile eventually. During development, GL 3.0 (on Mesa) and 2.1 (on Mac) will still work.

Part of T49012

2 years agoBLF/OpenGL: more text drawing optimization
Mike Erwin [Sun, 16 Oct 2016 06:08:16 +0000 (02:08 -0400)]
BLF/OpenGL: more text drawing optimization

Make color values compact. Set color once per primitive. Use new immSkipAttrib to avoid useless color copies.

All of this should make text drawing less CPU hungry.

2 years agoGawain: new immSkipAttrib function
Mike Erwin [Sun, 16 Oct 2016 05:58:26 +0000 (01:58 -0400)]
Gawain: new immSkipAttrib function

Now you can explicitly skip a vertex attribute -- you don't give it a value and it won't get a copy of the previous vert's value. Useful for flat interpolated per-primitive values.

This is an advanced feature. Expect garbage in the empty spaces, and copies of garbage if you rely on the attrib copy behavior after skipping.

2 years agoBLF/OpenGL: accurate vertex count for drawing
Mike Erwin [Sun, 16 Oct 2016 00:04:25 +0000 (20:04 -0400)]
BLF/OpenGL: accurate vertex count for drawing

We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.

2 years agoBLF: make blurry text an optional (disabled) feature
Mike Erwin [Sat, 15 Oct 2016 23:40:41 +0000 (19:40 -0400)]
BLF: make blurry text an optional (disabled) feature

While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!

2 years agoOpenGL: remove some unused legacy matrix calls
Mike Erwin [Sat, 15 Oct 2016 23:08:19 +0000 (19:08 -0400)]
OpenGL: remove some unused legacy matrix calls

Part of T49450

2 years agoOpenGL: bump Windows to GL 3.3 compat profile
Mike Erwin [Sat, 15 Oct 2016 18:41:03 +0000 (14:41 -0400)]
OpenGL: bump Windows to GL 3.3 compat profile

Part of T49012

2 years agoGawain: improve immediate mode performance
Mike Erwin [Sat, 15 Oct 2016 00:50:17 +0000 (20:50 -0400)]
Gawain: improve immediate mode performance

This was already fast on Apple, but @Severin and @dfelinto noticed slowdowns in user prefs, which is text heavy.

The problem was immBeginAtMost not being smart about VBO write flushing. immBeginAtMost can use all of its allocated range or only a subrange. The previous code was forcing back-to-back draw calls and buffer writes to serialize. This commit lets OpenGL know that our VBO writes never overlap, so there's no need to wait.

Should be much faster now!

2 years agoFix unitialized variable use
Julian Eisel [Sat, 15 Oct 2016 16:57:32 +0000 (18:57 +0200)]
Fix unitialized variable use

Own mistake in ae8e8454700.
Patch by @efi0ng, thanks!

2 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sat, 15 Oct 2016 08:05:03 +0000 (10:05 +0200)]
Merge branch 'master' into blender2.8

2 years agoOpenGL: draw node sockets more efficiently
Mike Erwin [Sat, 15 Oct 2016 06:49:00 +0000 (02:49 -0400)]
OpenGL: draw node sockets more efficiently

1 or 2 draw calls per node instead of 1 per socket (inputs + outputs).
Rearranged draw order so we set uniforms less frequently.
Some style & dead code cleanup.

Part of T49043

2 years agoOpenGL: new built-in point shader, clean up other shader names
Mike Erwin [Sat, 15 Oct 2016 06:30:59 +0000 (02:30 -0400)]
OpenGL: new built-in point shader, clean up other shader names

Smooth round point with outline (uniform color) and fill (varying color).

Updated shader naming scheme: a shader that doesn't deal with color does not have to say "no color". Vertex shaders do not have to say "uniform color" since their frag counterpart actually has the uniform. Each name should describe what that shader *does*, not what it *doesn't do*.

2 years agoblender 2.8: OpenGL: node_circle_draw use now immediate mode
Mike Erwin [Sat, 15 Oct 2016 03:45:55 +0000 (23:45 -0400)]
blender 2.8: OpenGL: node_circle_draw use now immediate mode

I use your new point shader to draw the node's soket

Reviewers: Severin, merwin

Maniphest Tasks: T49043

Differential Revision:

2 years agoOpenGL: bump Linux to GL 3.3 compat profile
Mike Erwin [Sat, 15 Oct 2016 03:42:45 +0000 (23:42 -0400)]
OpenGL: bump Linux to GL 3.3 compat profile

fall back to 3.0 if needed (during development)

Part of T49012

2 years agofix pointer type warning
Mike Erwin [Sat, 15 Oct 2016 02:40:55 +0000 (22:40 -0400)]
fix pointer type warning

thanks, gcc

2 years agoOutliner: Fix missing indentation for search-match highlight
Julian Eisel [Sat, 15 Oct 2016 00:07:48 +0000 (02:07 +0200)]
Outliner: Fix missing indentation for search-match highlight

Own mistake in ae8e84547005.

2 years agoBLF: early exit when drawing empty strings
Mike Erwin [Fri, 14 Oct 2016 23:59:59 +0000 (19:59 -0400)]
BLF: early exit when drawing empty strings

Avoids all kinds of setup & preparations to draw nothing.

2 years agoBLF: fix crash on text input fields
Mike Erwin [Fri, 14 Oct 2016 23:56:50 +0000 (19:56 -0400)]
BLF: fix crash on text input fields

Some strings have known length, others are NULL terminated (len = INT_MAX in this case).

Now font drawing knows to treat INT_MAX special.

2 years agoOutliner: Draw highlights over entire row
Julian Eisel [Fri, 14 Oct 2016 23:38:44 +0000 (01:38 +0200)]
Outliner: Draw highlights over entire row

Previously, highlights (mouse hover, selection, search-match) didn't affect background of restriction icons, now the entire line gets highlighted.

2 years agoOutliner: Element mouse hover feedback
Julian Eisel [Fri, 14 Oct 2016 22:40:33 +0000 (00:40 +0200)]
Outliner: Element mouse hover feedback

Some little UI polish to get familiar with outliner code (but also because it's a useful feature). Committing to blender2.8 branch but can also port to master (2.7) if wanted.

This basically causes the mouse hovered element to be highlighted. Contrast of the highlight should be fine, even with a non-default theme. Also did some minor cleanup.

2 years agoCycles: use near clipping distance in panorama camera.
Scott Wu [Fri, 14 Oct 2016 22:11:42 +0000 (00:11 +0200)]
Cycles: use near clipping distance in panorama camera.

Reviewed By: sergey, brecht, dfelinto

Differential Revision:

2 years agoviewport: draw non-mesh objects for a starter
Dalai Felinto [Fri, 14 Oct 2016 05:17:06 +0000 (05:17 +0000)]
viewport: draw non-mesh objects for a starter

This starts to decouple non-mesh objects and the legacy draw pipeline.
It shows how we can mix e.g., Cycles and lamps and empties.

2 years agoviewport: move border drawing code to new file
Dalai Felinto [Fri, 14 Oct 2016 01:38:04 +0000 (01:38 +0000)]
viewport: move border drawing code to new file

2 years agoimmediate mode: convert render border code and move to new drawing
Dalai Felinto [Fri, 14 Oct 2016 01:24:27 +0000 (01:24 +0000)]
immediate mode: convert render border code and move to new drawing

2 years agoImmediate mode: use new util functions, and border draw functions
Dalai Felinto [Thu, 13 Oct 2016 23:28:11 +0000 (23:28 +0000)]
Immediate mode: use new util functions, and border draw functions

Part of T49043

Reviewers: merwin

2 years agoImmediate mode: new util functions (imm_cpack and imm_draw_line_box)
Dalai Felinto [Thu, 13 Oct 2016 23:26:55 +0000 (23:26 +0000)]
Immediate mode: new util functions (imm_cpack and imm_draw_line_box)

2 years agoOpenGL: draw text with fewer draw calls
Mike Erwin [Fri, 14 Oct 2016 18:40:53 +0000 (14:40 -0400)]
OpenGL: draw text with fewer draw calls

Was one draw call per glyph,  now one per line.

Still room for improvement here.

2 years agoGPencil: Avoid assert error if the immEnd is called with only one point for lines
Antonioya [Fri, 14 Oct 2016 17:24:27 +0000 (19:24 +0200)]
GPencil: Avoid assert error if the immEnd is called with only one point for lines

This function will be replace by geometry shader, but we need this fix until the shader will be ready. The problem is similar to T49614.

2 years agoPrevent crash after OpenGL rendering animation to images.
Sybren A. Stüvel [Fri, 14 Oct 2016 16:45:49 +0000 (18:45 +0200)]
Prevent crash after OpenGL rendering animation to images.

2 years agoFix T49614: Grease Pencil GPF error if stroke thickness change too much between strok...
Antonioya [Fri, 14 Oct 2016 16:35:01 +0000 (18:35 +0200)]
Fix T49614: Grease Pencil GPF error if stroke thickness change too much between stroke points

The problem was the function tried to draw a line with one point only. This fix will be replaced by new geometry shaders, but we need while this change is not ready.