3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 26 Jun 2017 23:57:40 +0000 (09:57 +1000)]
Merge branch 'master' into blender2.8

3 years agoCMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Campbell Barton [Mon, 26 Jun 2017 23:50:35 +0000 (09:50 +1000)]
CMake: Only set CMAKE_BUILD_TYPE_INIT when not set

Convenience makefile now uses CMAKE_BUILD_TYPE_INIT,
this means you can change the build type of an existing build
and it won't be overwritten when running `make`.

Useful if you want to add debug info to a release build for profiling.

3 years agoCleanup: quiet warning
Campbell Barton [Mon, 26 Jun 2017 21:37:27 +0000 (07:37 +1000)]
Cleanup: quiet warning

Passing NULL arg when nonnull attr is used.

3 years agoScene object iterator: minor optimization
Campbell Barton [Mon, 26 Jun 2017 21:27:33 +0000 (07:27 +1000)]
Scene object iterator: minor optimization

Avoid an extra hash when adding to gset

3 years agoEevee: Add Planar reflection blurring.
Clément Foucault [Mon, 26 Jun 2017 18:37:41 +0000 (20:37 +0200)]
Eevee: Add Planar reflection blurring.

This method is very cheap and inaccurate. This will fill the gap untill better model is supported.

3 years agoAdd new DRW_draw_pass_subset function
Antonio Vazquez [Mon, 26 Jun 2017 18:42:58 +0000 (20:42 +0200)]
Add new DRW_draw_pass_subset function

This function allows to draw only a selected range of shading groups.

This is required for some special situations as grease pencil strokes.

3 years agoAdd warning that 'purge all' action in Outliner does save to current .blend file.
Bastien Montagne [Mon, 26 Jun 2017 17:00:45 +0000 (19:00 +0200)]
Add warning that 'purge all' action in Outliner does save to current .blend file.

This is a very important, potentially deadly side-effect of this
operator. If something goes wrong, it can save a broken .blend file.

Ideally we could get rid of that operation anyway, once ID management if
fully renewed, but for now would rather keep it around.

Related to T51902.

3 years agoFix T51902: Severe problem with relocating linked libraries when using proxies.
Bastien Montagne [Mon, 26 Jun 2017 16:55:30 +0000 (18:55 +0200)]
Fix T51902: Severe problem with relocating linked libraries when using proxies.

Fix is a bit ugly, but cannot think of another solution for now, at
least this **should** not break anything else.

And now I go find myself a very remote, high and lonely mountain, climb
to its top, roar "I hate proxies!" a few times, and relax hearing the echos...

3 years agoFix viewport rendering with anti-aliasing - workaround
Dalai Felinto [Mon, 26 Jun 2017 16:30:21 +0000 (18:30 +0200)]
Fix viewport rendering with anti-aliasing - workaround

This commit makes the fullsample option for viewport renderings always
on: Render > OpenGL Render Options > Full Sample.

(The UI still allows users to set this, so we will need to revisit this
before 2.8 releases).

Even in computers that can handle MSAA we had issues.
The way Blender gpu_* implementation is handling anti-aliasing is buggy.
For example, in Blender 2.7x if you have depth of field in a viewport
with multi-sampling, the DoF gives us jagged edges.

Since Eevee uses framebuffers for a lot of things, this issue was
leading to very visible buggy render in some computers, and more subtle
inconsistent buggy renders in others (easy to test with the depth of
field in Eevee).

3 years agoRemove disabled code for freeing shaders on scene update
Luca Rood [Mon, 26 Jun 2017 16:16:05 +0000 (18:16 +0200)]
Remove disabled code for freeing shaders on scene update

Some code for freeing shaders on scene updates (because of previous
dependency shaders had on lamps) had been disabled, as it is no longer
required. This removes that code altogether.

3 years agoStop object shaders from being updated when changing lamp properties
Luca Rood [Mon, 26 Jun 2017 15:53:47 +0000 (17:53 +0200)]
Stop object shaders from being updated when changing lamp properties

Object shaders no longer depend on lamp data at compile time, thus they
don't need to be invalidated when lamps change. Disabling shader
recompilation allows fast viewport updates when changing lamp settings.

Note that even though shaders for lamps are currently not being used,
`lamp_changed` is still freeing the lamp shaders, as at some point we
might want to use shaders for lamps...

3 years agoEnable optional jack in
Bastien Montagne [Mon, 26 Jun 2017 14:12:32 +0000 (16:12 +0200)]
Enable optional jack in

Based on D2578, now you can install JACK audio server and use it in
Blender build without having to specify the `--with-all` option (that
one still enables also JACK of course).

Reviewers: mont29

Maniphest Tasks: T51033

Differential Revision:

3 years agoFix T51559: Update draw cache when changing flat/smooth shading
Luca Rood [Mon, 26 Jun 2017 12:52:59 +0000 (14:52 +0200)]
Fix T51559: Update draw cache when changing flat/smooth shading

This also renames some flags/variables to be more generic for updating
purposes. The call used here was previously only used for updating
paint data, but as it was reused here, flags and variables were renamed
to accomodate more clearly to the new usages.

3 years agoNew scenes should use Eevee, not Blender Render
Dalai Felinto [Mon, 26 Jun 2017 10:47:17 +0000 (12:47 +0200)]
New scenes should use Eevee, not Blender Render

3 years agoEnable shadow catching for Eevee hair
Luca Rood [Mon, 26 Jun 2017 10:30:30 +0000 (12:30 +0200)]
Enable shadow catching for Eevee hair

Shadow catching was disabled for hair in Eevee, because of an issue in
the shadow maps. The issue has since been resolved, so this re-enables
shadow catching for hair.

3 years agoHair UV implementation for Eevee
Luca Rood [Thu, 22 Jun 2017 17:19:55 +0000 (19:19 +0200)]
Hair UV implementation for Eevee

This implements UV support for Eevee hair, enabling the usage of

3 years agoFix shaders not working in Eevee
Dalai Felinto [Mon, 26 Jun 2017 10:14:19 +0000 (12:14 +0200)]
Fix shaders not working in Eevee

Not a single node based shader was working since a recent merge from

The merge brought changes from the principle bsdf shader where
unsupported gl_ProjectionMatrix was still being used.

3 years agoUsed Py3.6 feature by accident, check version
Campbell Barton [Mon, 26 Jun 2017 09:57:48 +0000 (19:57 +1000)]
Used Py3.6 feature by accident, check version

3 years agoManipulator: Python API
Campbell Barton [Mon, 26 Jun 2017 05:57:14 +0000 (15:57 +1000)]
Manipulator: Python API

Initial support for Python/Manipulator integration
from 'custom-manipulators' branch.


- Registering custom manipulators & manipulator-groups.
- Modifying RNA properties, custom values via get/set callbacks,
  or invoking an operator.
- Drawing shape presets for Python defined manipulators (arrow, circle, face-maps)


- Only float properties supported.
- Drawing only supported via shape presets.
  (we'll likely want a way to define custom geometry or draw directly).
- When to refresh, recalculate manipulators will likely need
  integration with notifier system.

Development will be continued in the 2.8 branch

3 years agoCorrect copy-paste error manipulator
Campbell Barton [Mon, 26 Jun 2017 05:46:27 +0000 (15:46 +1000)]
Correct copy-paste error manipulator

3 years agoRename wmManipulatorPropertyType.type -> data_type
Campbell Barton [Mon, 26 Jun 2017 04:36:37 +0000 (14:36 +1000)]
Rename wmManipulatorPropertyType.type -> data_type

3 years agoManipulator: use 'void *' for callback data args
Campbell Barton [Mon, 26 Jun 2017 04:31:26 +0000 (14:31 +1000)]
Manipulator: use 'void *' for callback data args

Non-float properties should be editable too.

3 years agoBuilding without Python works again
Campbell Barton [Mon, 26 Jun 2017 03:50:11 +0000 (13:50 +1000)]
Building without Python works again

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 26 Jun 2017 03:43:56 +0000 (13:43 +1000)]
Merge branch 'master' into blender2.8

3 years agoCollada: improved Error handling: Avoid shutdown of Blender when the Collada importer...
Gaia Clary [Sat, 24 Jun 2017 19:50:04 +0000 (21:50 +0200)]
Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 26 Jun 2017 03:37:08 +0000 (13:37 +1000)]
Merge branch 'master' into blender2.8

Note that this drops all changes from master,
useful commits will need to be cherry-picked.

Did this since most commits were relating to UV/textures
which is complicated by texface being removed in 2.8

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 26 Jun 2017 03:27:54 +0000 (13:27 +1000)]
Merge branch 'master' into blender2.8

3 years agoBuilding w/o Python works again
Campbell Barton [Mon, 26 Jun 2017 03:25:51 +0000 (13:25 +1000)]
Building w/o Python works again

3 years agoCleanup: committed by accident
Campbell Barton [Mon, 26 Jun 2017 03:21:09 +0000 (13:21 +1000)]
Cleanup: committed by accident

3 years agoManipulator: name setting function
Campbell Barton [Mon, 26 Jun 2017 03:16:25 +0000 (13:16 +1000)]
Manipulator: name setting function

Default name includes group-name,
we may want to set the name without a prefix.

3 years agoFix freestyle lineset panels being animatable
Aaron Carlisle [Mon, 26 Jun 2017 00:03:19 +0000 (20:03 -0400)]
Fix freestyle lineset panels being animatable

3 years agoUI: Fix Capitalization Inconsistency
Aaron Carlisle [Sun, 25 Jun 2017 23:55:05 +0000 (19:55 -0400)]
UI: Fix Capitalization Inconsistency

3 years agoWM: Fix crash in transform-orientation access
Campbell Barton [Sun, 25 Jun 2017 22:38:21 +0000 (08:38 +1000)]
WM: Fix crash in transform-orientation access

Need to support orientation access when context is NULL.

3 years agoManipulator: add optional properties argument
Campbell Barton [Sun, 25 Jun 2017 22:19:55 +0000 (08:19 +1000)]
Manipulator: add optional properties argument

Needed for RNA/Py API

3 years agoDocs: correct doc-strings
Campbell Barton [Sun, 25 Jun 2017 21:36:29 +0000 (07:36 +1000)]
Docs: correct doc-strings

3 years agoCollada: Exporter now only exports either 'Materials' or 'UV Textures as Materials...
Gaia Clary [Sun, 25 Jun 2017 20:06:04 +0000 (22:06 +0200)]
Collada: Exporter now only exports either 'Materials' or 'UV Textures as Materials'. This makes the user interface more streight

3 years agofix: overlooked the RET_ZERO appendix
Gaia Clary [Sun, 25 Jun 2017 15:04:47 +0000 (17:04 +0200)]
fix: overlooked the RET_ZERO appendix

3 years agofix: T51622 The exporter now exports meshes as <Triangles> when all contained polygon...
Gaia Clary [Sun, 25 Jun 2017 12:51:51 +0000 (14:51 +0200)]
fix: T51622 The exporter now exports meshes as <Triangles> when all contained polygons are tris

3 years agofix: Collada fprintf needs std::string be converted to char *
Gaia Clary [Sun, 25 Jun 2017 11:18:21 +0000 (13:18 +0200)]
fix: Collada fprintf needs std::string be converted to char *

3 years agofix: collada: removed unnecessary extra qualification
Gaia Clary [Sun, 25 Jun 2017 11:10:03 +0000 (13:10 +0200)]
fix: collada: removed unnecessary extra qualification

3 years agofix: adjusted collada declaration after changes in collada module.
Gaia Clary [Sun, 25 Jun 2017 08:50:03 +0000 (10:50 +0200)]
fix: adjusted collada declaration after changes in collada module.
@campbell Barton: Why is this declaration needed at all in stubs.c?
Further up the file collada.h is imported and that already decalres
the function and results in a duplicate declaration.

3 years agoCollada: Fix: Geometry exporter did not create all polylist when meshes are only...
Gaia Clary [Sat, 24 Jun 2017 21:33:34 +0000 (23:33 +0200)]
Collada: Fix: Geometry exporter did not create all polylist when meshes are only partially textured

3 years agocollada: export UV Textures as materials. Note: the reimport of the exported collada...
Gaia Clary [Sat, 24 Jun 2017 20:16:32 +0000 (22:16 +0200)]
collada: export UV Textures as materials. Note: the reimport of the exported collada files will have materials assigned instead of UV Face Textures! This is expected behavior

3 years agocollada: change image export: export either UV Textures or Materials. This
Gaia Clary [Sat, 24 Jun 2017 20:09:08 +0000 (22:09 +0200)]
collada: change image export: export either UV Textures or Materials. This
avoids wrong texture data when multiple objects are exported. Note: This
commit might possiblyt not work fully. The full feature is added with the
next commit)

3 years agoCollada: improved Error handling: Avoid shutdown of Blender when the Collada importer...
Gaia Clary [Sat, 24 Jun 2017 19:50:04 +0000 (21:50 +0200)]
Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data

3 years agoCollada: added new functions for improved material exporter (not used yet)
Gaia Clary [Sat, 24 Jun 2017 19:36:03 +0000 (21:36 +0200)]
Collada: added new functions for improved material exporter (not used yet)

3 years agoFix T50856: crash when minimizing window on AMD / Windows.
Brecht Van Lommel [Sat, 24 Jun 2017 14:44:48 +0000 (16:44 +0200)]
Fix T50856: crash when minimizing window on AMD / Windows.

3 years agoFix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing.
Brecht Van Lommel [Sat, 24 Jun 2017 16:02:30 +0000 (18:02 +0200)]
Fix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing.

3 years agoRevert "Fix py-api doc building"
Campbell Barton [Sat, 24 Jun 2017 06:56:00 +0000 (16:56 +1000)]
Revert "Fix py-api doc building"

This reverts commit 838a4622cf7a01f302b4decfd74c4b8a17d7b509.

Also add missing 'lightprobe'

3 years agoFix py-api doc building
Campbell Barton [Sat, 24 Jun 2017 06:11:24 +0000 (16:11 +1000)]
Fix py-api doc building

3 years agoEevee: Fix linking error.
Clément Foucault [Sat, 24 Jun 2017 03:25:33 +0000 (05:25 +0200)]
Eevee: Fix linking error.

3 years agoEevee: Planar reflection: Fix normal deformation for background pixels.
Clément Foucault [Sat, 24 Jun 2017 03:24:59 +0000 (05:24 +0200)]
Eevee: Planar reflection: Fix normal deformation for background pixels.

Now it matches world cubemap perfectly.

3 years agoEevee: Fix opengl error cause by bad texture configuration.
Clément Foucault [Fri, 23 Jun 2017 23:46:07 +0000 (01:46 +0200)]
Eevee: Fix opengl error cause by bad texture configuration.

This is fragile and the whole Texture/Framebuffer should be extended to be more flexible.

3 years agoEevee: Use smaller texture for placeholders.
Clément Foucault [Fri, 23 Jun 2017 23:44:43 +0000 (01:44 +0200)]
Eevee: Use smaller texture for placeholders.

3 years agoEevee: Planar Reflection: Add contact hardening normal distortion.
Clément Foucault [Fri, 23 Jun 2017 23:08:26 +0000 (01:08 +0200)]
Eevee: Planar Reflection: Add contact hardening normal distortion.

Save radial distance to camera in alpha channel of the planar probe.
Use this distance to modulate distortion intensity when shading the surface.

3 years agoEevee: Add AO support in planar reflection.
Clément Foucault [Fri, 23 Jun 2017 19:08:53 +0000 (21:08 +0200)]
Eevee: Add AO support in planar reflection.

Technically this enables the use of MinmaxZ pyramid inside the probe captures.
Also Disable AO for cubemap probes because it shows big discontinuities at cubeface limits.

3 years agoEevee: Planar Reflection: Fix precision issue near cliplane.
Clément Foucault [Fri, 23 Jun 2017 17:19:19 +0000 (19:19 +0200)]
Eevee: Planar Reflection: Fix precision issue near cliplane.

The problem was that the depth prepass was using the clip plane but not the shading pass.

During the clipping stage, the triangle is converted to a quad clipped to the given clip plane.
But this introduce subtle changes in the depth when this new geometry is rasterized. Since the shading pass was using an EQUAL depth test, the depth values from the shading pass were not always equal to the depth prepass.

Enabling clipping in the shading vertex shader has a too small impact to require a dedicated shader.

3 years agoEevee: Planar reflection: Fix bad texture binding.
Clément Foucault [Fri, 23 Jun 2017 17:02:40 +0000 (19:02 +0200)]
Eevee: Planar reflection: Fix bad texture binding.

3 years agoSilence warnings (tsc, tsc)
Dalai Felinto [Fri, 23 Jun 2017 14:45:14 +0000 (16:45 +0200)]
Silence warnings (tsc, tsc)

3 years agoGPUMaterial: Avoid freeing GLSL shaders when changing scene properties.
Clément Foucault [Fri, 23 Jun 2017 14:41:44 +0000 (16:41 +0200)]
GPUMaterial: Avoid freeing GLSL shaders when changing scene properties.

This was causing major slowdown when changing Colormanagment settings or post processing.

3 years agoRevert "Temporarily disable material preview (T51796 workaround)"
Luca Rood [Fri, 23 Jun 2017 09:55:04 +0000 (11:55 +0200)]
Revert "Temporarily disable material preview (T51796 workaround)"

This reverts commit 0d9611718d89636d0d407555252b3a6a1d7ef2f9.

The preview issues have been solved by CoW commit

3 years agoFix Eevee "No output node" issue
Luca Rood [Fri, 23 Jun 2017 08:49:09 +0000 (10:49 +0200)]
Fix Eevee "No output node" issue

This fixes an issue introduced by the new output node system, where "No
output node" was displayed in the material panel even when an output
node was present.

3 years agoGrease Pencil: Fix hardcoded DKEY for continous drawing
Dalai Felinto [Fri, 23 Jun 2017 08:32:03 +0000 (10:32 +0200)]
Grease Pencil: Fix hardcoded DKEY for continous drawing

3 years agoFix T51845
raa [Fri, 23 Jun 2017 08:04:58 +0000 (11:04 +0300)]
Fix T51845

3 years agoManipulator: partial depth support
Campbell Barton [Fri, 23 Jun 2017 07:20:25 +0000 (17:20 +1000)]
Manipulator: partial depth support

Use the depth flag added for this purpose.
Although this only works for regular currently, not selection.

3 years agoManipulator: disable GL state changes drawing geometry
Campbell Barton [Fri, 23 Jun 2017 06:47:49 +0000 (16:47 +1000)]
Manipulator: disable GL state changes drawing geometry

If there is case this is needed, we can enable and restore state
for now it seems OK to disable.

3 years agoManipulator: flip scale flag usage
Campbell Barton [Fri, 23 Jun 2017 05:50:55 +0000 (15:50 +1000)]
Manipulator: flip scale flag usage

Naming was confusing, while technically correct -
the result is no scaling (manipulator ignores zoom-level).

Also remove 3D from name since this can be supported for 2D views too.

3 years agoManipulator: rename struct members
Campbell Barton [Fri, 23 Jun 2017 04:48:37 +0000 (14:48 +1000)]
Manipulator: rename struct members

- matrix -> matrix_basis
- user_scale -> scale_basis
- scale -> scale_final

Match RNA names being added to custom-manipulator branch.

3 years agoEevee: Put pack AO parameters.
Clément Foucault [Fri, 23 Jun 2017 02:12:46 +0000 (04:12 +0200)]
Eevee: Put pack AO parameters.

3 years agoManipulator: add tweak-snap (not used yet)
Campbell Barton [Fri, 23 Jun 2017 01:13:46 +0000 (11:13 +1000)]
Manipulator: add tweak-snap (not used yet)

3 years agoEevee: Attempt to optimize GTAO shader.
Clément Foucault [Fri, 23 Jun 2017 00:52:15 +0000 (02:52 +0200)]
Eevee: Attempt to optimize GTAO shader.

Unroll horizon search loop. Use fast version of acos.
On nvidia linux, unrolling the 2nd loop is giving very high compilation time.

3 years agoEevee: Fix OpenGl errors.
Clément Foucault [Thu, 22 Jun 2017 23:33:28 +0000 (01:33 +0200)]
Eevee: Fix OpenGl errors.

Also assert if texture does not exists in draw manager. Keeping it sane.

3 years agoManipulator: fix broken hover option
Campbell Barton [Thu, 22 Jun 2017 23:18:53 +0000 (09:18 +1000)]
Manipulator: fix broken hover option

Hover flag caused manipulators not to update
(Camera DOF works again).

3 years agoDrawManager: Add support for writting to depth without depth testing.
Clément Foucault [Thu, 22 Jun 2017 16:53:36 +0000 (18:53 +0200)]
DrawManager: Add support for writting to depth without depth testing.

Disabling depth test will prevent from writting to depth buffer.
Add DRW_STATE_DEPTH_ALWAYS to always pass the depth test and write to depth.

3 years agoEevee: Fix max range of lightprobes
Dalai Felinto [Thu, 22 Jun 2017 16:35:08 +0000 (18:35 +0200)]
Eevee: Fix max range of lightprobes

3 years agoEevee: Interface and units
Dalai Felinto [Thu, 22 Jun 2017 15:37:28 +0000 (17:37 +0200)]
Eevee: Interface and units

We should use PROP_DISTANCE whenever appropriate.
Also rename "Data Draw Size" > "Size" in the UI for the lightprobes.

3 years agoLight Probes: interface changes, and renames
Dalai Felinto [Thu, 22 Jun 2017 15:20:39 +0000 (17:20 +0200)]
Light Probes: interface changes, and renames

Although we are calling all of them light probes, there are a lot of
differences between them. This commit does the following:

* Prevent user from changing the probe type once added

* Unify "sphere" and "cube" probes into reflection cubemap
(as before you can switch between them from the probe UI)

To be done
* Don't show add probe menus unless we are on Eevee

* Light probes panels should not be visible in Clay. Light probe objects
should not be visible in Clay viewport (nor on Cycles).

* We need icons for the different light probes, and for lightprobes as a
whole (we are using RADIO for now).

3 years agoIndicate to users when manual conversion of Eevee materials is needed
Dalai Felinto [Thu, 22 Jun 2017 08:32:50 +0000 (10:32 +0200)]
Indicate to users when manual conversion of Eevee materials is needed

We now shows a report error when user opens a file that need fixing.
It's fine(ish) to not do doversion. It's not fine to not communicate that.

3 years agoManipulator: target property definitions
Campbell Barton [Thu, 22 Jun 2017 08:29:45 +0000 (18:29 +1000)]
Manipulator: target property definitions

Changes from custom-manipulator branch.

- use property type definitions.
- add property free callback.
- move properties into the wmManipulator struct (over alloc).
- use array length from property types instead of arg passing.

3 years agoFix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.
Bastien Montagne [Thu, 22 Jun 2017 08:26:27 +0000 (10:26 +0200)]
Fix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.

Reorder keyingsets registration order, since it also afects order of I
menu options, better show most used ones first, pure alphabetical order
is not great here... Will likely break some muscle memory though. :|

Based on D2720 by Carlo Andreacchio (@candreacchio), thanks.

3 years agoFix T51863: CompositorNodeSwitchView have the wrong rna API
Dalai Felinto [Thu, 22 Jun 2017 08:25:05 +0000 (10:25 +0200)]
Fix T51863: CompositorNodeSwitchView have the wrong rna API

Although the original report was about the docs, the real issue was in
the API.

My original commit started from a copy-paste from the Switch
Node. However I don't use custom1 for thew Switch View node.

The docs is slightly incomplete since it would be nice to mention the
views here. Or maybe even expose them via Python. But honestly they are
generated depending on the scene multi-view settings.

3 years agoEevee: Ambient Occlusion: Enable Multibounce approximation and Change influence factor.
Clément Foucault [Thu, 22 Jun 2017 01:50:50 +0000 (03:50 +0200)]
Eevee: Ambient Occlusion: Enable Multibounce approximation and Change influence factor.

Making the influence a power for easy tuning. Works like a contrast knob.

3 years agoEevee: Ambient Occlusion: Initial implementation.
Clément Foucault [Thu, 22 Jun 2017 01:10:39 +0000 (03:10 +0200)]
Eevee: Ambient Occlusion: Initial implementation.

Implement GTAO (Ground Truth Ambient Occlusion) which is a special case of Horizon Based Ambient Occlusion that is more physically accurate.
Also add a bent normal option to sample indirect irradiance (diffuse lighting) with the least occluded direction.

3 years agoEevee: Improve material variation managment.
Clément Foucault [Thu, 22 Jun 2017 00:41:17 +0000 (02:41 +0200)]
Eevee: Improve material variation managment.

- Unify variations between default shaders and material shader.
- Only create default shader passes if needed.

Downside is that we have a big array of passes and shading grp in the vedata ... And it will double in size each time a new variation flag is added.

3 years agoEevee: Ambient Occlusion: Add UI properties.
Clément Foucault [Thu, 22 Jun 2017 00:30:20 +0000 (02:30 +0200)]
Eevee: Ambient Occlusion: Add UI properties.

3 years agoEevee: Minmax Depth Pyramid.
Clément Foucault [Thu, 22 Jun 2017 00:28:49 +0000 (02:28 +0200)]
Eevee: Minmax Depth Pyramid.

This commit introduce the computation of a depth pyramid containing min and max depth values of the original depth buffer.
This is useful for Clustered Light Culling but also for raytracing on the depth buffer (SSR).
It's also usefull to have to fetch higher mips in order to improve texture cache usage.

As of now, 1st mip (highest res) is half the resolution of the depth buffer, but everything is already done to be able to make a fullres copy of the depth buffer in the 1st mip instead of downsampling.
Also, the texture used is RG_32F which is a too much but enough to cover the 24bits of the depth buffer. Reducing the texture size would make things quite faster.

3 years agoGPUFramebuffer: Add recursive downsampling function.
Clément Foucault [Thu, 22 Jun 2017 00:01:58 +0000 (02:01 +0200)]
GPUFramebuffer: Add recursive downsampling function.

This special case function enables rendering to a miplevel while using the miplevels above as texture input.
This is needed for some algorithm (i.e. creating a min-max depth pyramid texture).

3 years agoGPUTexture: Support for nearest sampling with mipmaps.
Clément Foucault [Wed, 21 Jun 2017 23:53:51 +0000 (01:53 +0200)]
GPUTexture: Support for nearest sampling with mipmaps.

3 years agoCycles: Fix excessive sampling weight of glossy Principled BSDF components
Lukas Stockner [Wed, 21 Jun 2017 00:57:58 +0000 (02:57 +0200)]
Cycles: Fix excessive sampling weight of glossy Principled BSDF components

If there was any specularity in the Principled BSDF, it would get a sampling
weight of one regardless of its actual impact.

This commit makes Cycles estimate the contribution of the component and adjust
the weighting accordingly, which greatly improves the noise characteristics of
the Principled BSDF in many cases.

Note that this commit might slightly change the brightness of areas when using
MultiGGX and high roughnesses, but the new brightness is more accurate and
closer to the result of Branched Path Tracing. See T51836 for details.

Differential Revision:

3 years agoFix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures
Lukas Stockner [Wed, 21 Jun 2017 00:51:34 +0000 (02:51 +0200)]
Fix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures

The PDF of the MultiGGX sampling is approximated by the singlescattering GGX
term as well as a scaled diffuse term that makes up for the energy in the
multiscattering component that's missed by GGX.

However, there were two problems with the glossy terms: The diffuse term missed
a normalization factor, and the singlescattering term was not properly scaled
down based on the albedo estimate.

The glass term was completely wrong and has been rewritten. It uses the fresnel
factor to weight reflection vs. refraction and uses the glossy MultiGGX model
for reflection.
For refraction, the correct singlescattering term is now used, and a new
albedo approximation is used that was derived by evaluating GGX albedo for
roughnesses from 0 to 1 and IORs from 1 to 3 and fitting numerical
approximations to it. The resulting model has a mean relative error of 9e-5,
but could probably be simplified without losing noticable accuracy in the
final render.

The improved PDFs help with glossy highlights (due to better light sampling vs.
closure sampling MIS) and fix the situation described in T51836 where mixing
MultiGGX with other closures (as it happens in e.g. the Principled
BSDF) causes incorrect darkening.

3 years agoFix T51862: principled shader GLSL artifacts in ortho mode.
Brecht Van Lommel [Wed, 21 Jun 2017 19:31:08 +0000 (21:31 +0200)]
Fix T51862: principled shader GLSL artifacts in ortho mode.

3 years agoFix T51849: change Cycles clearcoat gloss to roughness.
Brecht Van Lommel [Wed, 21 Jun 2017 17:24:57 +0000 (19:24 +0200)]
Fix T51849: change Cycles clearcoat gloss to roughness.

This is compatible with UE4 and more consistent with specular and transmission
roughness, even if it deviates from the original Disney BRDF.

3 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Wed, 21 Jun 2017 13:14:42 +0000 (15:14 +0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

3 years agoFix typo in builtbot config
Dalai Felinto [Wed, 21 Jun 2017 12:05:23 +0000 (14:05 +0200)]
Fix typo in builtbot config

3 years agoFix blenderplayer (tm)
Dalai Felinto [Wed, 21 Jun 2017 10:25:07 +0000 (12:25 +0200)]
Fix blenderplayer (tm)

3 years agoFix T51856: `BKE_mesh_new_from_object()` would often generate default 'Mesh' named...
Bastien Montagne [Wed, 21 Jun 2017 08:30:38 +0000 (10:30 +0200)]
Fix T51856: `BKE_mesh_new_from_object()` would often generate default 'Mesh' named datablock.

This is annoying especially for exporters who do use mesh name, since it
broke any relation with actual Mesh naming in original Blend file.

Unfortunately, we cannot avoid the extra .xxx digits. ;)

3 years agoManipulator: edit_properties -> target_properties
Campbell Barton [Wed, 21 Jun 2017 07:06:24 +0000 (17:06 +1000)]
Manipulator: edit_properties -> target_properties

Naming was too confusing between properties of a manipulator
and properties it edits.

3 years agoManipulator: Move types into their own directory
Campbell Barton [Wed, 21 Jun 2017 06:21:19 +0000 (16:21 +1000)]
Manipulator: Move types into their own directory

3 years agoManipulators: move settings to ID properties
Campbell Barton [Wed, 21 Jun 2017 03:54:46 +0000 (13:54 +1000)]
Manipulators: move settings to ID properties

This makes manipulator access closer to operators,
and allows Python access.

This adds RNA for manipulators, but not Python registration yet.

- Split draw style into 2x settings:
  `draw_style` (enum) & `draw_options` (enum-flag)
- Rename -> properties_edit,
  Use for ID-properties.
  Note that this area of the API will need further work since
  manipulators now have 2 kinds of properties & API's to access them.

3 years agoPyAPI: add intern strings
Campbell Barton [Wed, 21 Jun 2017 02:43:19 +0000 (12:43 +1000)]
PyAPI: add intern strings

Avoid string conversion on each use.