blender.git
3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 22 May 2017 20:49:02 +0000 (22:49 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/blenloader/intern/versioning_270.c

3 years agoGawain: replace switch with lookup table
Mike Erwin [Mon, 22 May 2017 20:43:33 +0000 (16:43 -0400)]
Gawain: replace switch with lookup table

This function is not performance critical, but I prefer the branch-free code and no hack needed to appease gcc.

Follow-up to recent 23035cf46fb4dd6a0bf7e688b0f15128030c77d1 and f637145450010d14660fcb029d41560a138eae14.

3 years agoAdd PovRay syntax hilghting.
Bastien Montagne [Mon, 22 May 2017 19:53:32 +0000 (21:53 +0200)]
Add PovRay syntax hilghting.

Since we already have a rather advanced PovRay exporter, makes sense to
also nicely display generated 'code'.

Patch by Maurice Raybaud (@mauriceraybaud), thanks!
Cleanup (mostly styling) by @mont29.

3 years agoFix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
Sergey Sharybin [Mon, 22 May 2017 15:12:13 +0000 (17:12 +0200)]
Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha

Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.

3 years agoFix T51318: Non-update of preview when switching from world to lamp panel.
Bastien Montagne [Mon, 22 May 2017 15:11:55 +0000 (17:11 +0200)]
Fix T51318: Non-update of preview when switching from world to lamp panel.

Lamp preview panel is in DATA buttons context...

3 years agoEnhance vgroup handling when merging meshes.
Bastien Montagne [Mon, 22 May 2017 14:17:37 +0000 (16:17 +0200)]
Enhance vgroup handling when merging meshes.

We were looping over all vgroups in destination mesh and making string
comparison, for every vgroup of every vertex of merged mesh! Crazy!

Now we simply create a temp mapping of vgroup indices, seriously
simplifies things (and gives significant speedup when merging huge meshes
with lots of vgroups, here with quick stupid test went from 120ms in
vgroup merging to less than 5ms, 25 times quicker!).

3 years agoFix T51520: Broken vertex weights after two mesh joining.
Bastien Montagne [Mon, 22 May 2017 14:15:03 +0000 (16:15 +0200)]
Fix T51520: Broken vertex weights after two mesh joining.

Root of the issue here was that two stupid modifiers could create named
vgroup CD layers (vgroup editing ones... shame on me :") ).

Fix that, and added some versionning code to also fix 'corrupted' blend
files created by those so far.

3 years agoFix wrong comment in BLI_findstringindex (returns 0-based index!).
Bastien Montagne [Mon, 22 May 2017 14:13:33 +0000 (16:13 +0200)]
Fix wrong comment in BLI_findstringindex (returns 0-based index!).

3 years agoImplement UBOs for particles
Luca Rood [Mon, 22 May 2017 10:14:37 +0000 (12:14 +0200)]
Implement UBOs for particles

This fixes the issue where all particles were drawn with the colors and
size of the last psys to be drawn.

3 years agoMinor cleanup of previous hair commits
Luca Rood [Mon, 22 May 2017 14:34:10 +0000 (16:34 +0200)]
Minor cleanup of previous hair commits

3 years agoFix T51577: ColorBalance strip modifier misses some color input
Sergey Sharybin [Mon, 22 May 2017 12:56:08 +0000 (14:56 +0200)]
Fix T51577: ColorBalance strip modifier misses some color input

Was a mistake in recent VSE interface change.

3 years agoFix T51169: Push/pull fails w/ local lock axis
Campbell Barton [Mon, 22 May 2017 11:10:18 +0000 (21:10 +1000)]
Fix T51169: Push/pull fails w/ local lock axis

3 years agoFix T51568: CUDA error in viewport render after fix for for OpenCL
Sergey Sharybin [Mon, 22 May 2017 10:25:04 +0000 (12:25 +0200)]
Fix T51568: CUDA error in viewport render after fix for for OpenCL

Seems re-loading module invalidates memory pointers by the looks of it,
which gives an error on the next kernel call.

Not sure how to move memory pointer from one CUDA module to another one,
so for now simply disabling kernel re-load for CUDA devices. Not ideal,
but better than failing render.

Feature-selective option for CUDA is not an official feature anyway.

3 years agoFix T51578: Blender 2.8 crash when select Dopesheet->Grease Pencil
Dalai Felinto [Mon, 22 May 2017 10:25:40 +0000 (12:25 +0200)]
Fix T51578: Blender 2.8 crash when select Dopesheet->Grease Pencil

3 years agoFix T51336: Crash on broken file opening.
Bastien Montagne [Mon, 22 May 2017 10:06:38 +0000 (12:06 +0200)]
Fix T51336: Crash on broken file opening.

`screen_findedge()` is not expected to return NULL in that case, but
checking against that does not hurt (we do it in all its other call
cases anyway), better than crashing.

3 years agoFix/workaround GCC bug about -Wno-implicit-fallthrough
Sergey Sharybin [Mon, 22 May 2017 09:08:10 +0000 (11:08 +0200)]
Fix/workaround GCC bug about -Wno-implicit-fallthrough

For some reason GCC-6 successfully compiles test program with
-Wno-implicit-fallthrough passed via command line. It just
silently ignores the unknown arguments which are starting with
-Wno-.

The issue is, if some other waning happens in the code, then
GCC will complain about unknown -Wno- argument which is not
supported by current GCC version.

This makes some misleading warning prints about unknown
command line argument when any other warning happens in code
from extern/.

3 years agoRevert assert, Eevee uses uniforms that might not exist
Campbell Barton [Mon, 22 May 2017 07:57:34 +0000 (17:57 +1000)]
Revert assert, Eevee uses uniforms that might not exist

3 years agoCleanup: move custom-data layers into a struct
Campbell Barton [Mon, 22 May 2017 07:21:22 +0000 (17:21 +1000)]
Cleanup: move custom-data layers into a struct

Changed because the values co-exist with active layers
(Mesh.mloopuv, Mesh.mloopcol).

3 years agoCleanup: line length
Campbell Barton [Mon, 22 May 2017 06:23:25 +0000 (16:23 +1000)]
Cleanup: line length

3 years agoCleanup: minor edits
Campbell Barton [Mon, 22 May 2017 06:20:54 +0000 (16:20 +1000)]
Cleanup: minor edits

3 years agoFix compilation on gcc
Antony Riakiotakis [Mon, 22 May 2017 00:33:31 +0000 (03:33 +0300)]
Fix compilation on gcc

3 years agoGawain: remove GLenum from IndexType API
Mike Erwin [Sun, 21 May 2017 22:25:30 +0000 (18:25 -0400)]
Gawain: remove GLenum from IndexType API

Goal is to make most of the API independent of OpenGL, Vulkan, any other backend.

Able to remove default case from ElementList_size because IndexType only covers index types. Not that and *everything else* like GLenum.

3 years agoGawain: use integer math to convert int16 to int10
Mike Erwin [Sun, 21 May 2017 22:07:23 +0000 (18:07 -0400)]
Gawain: use integer math to convert int16 to int10

@fclem does this work for you?

3 years agoGawain: cleanup code formatting
Mike Erwin [Sun, 21 May 2017 21:53:16 +0000 (17:53 -0400)]
Gawain: cleanup code formatting

3 years agoGawain: drop support for APPLE_flush_buffer_range
Mike Erwin [Sun, 21 May 2017 21:06:42 +0000 (17:06 -0400)]
Gawain: drop support for APPLE_flush_buffer_range

Modern GL's glMapBufferRange works the same on all platforms.

Part of T49012

3 years agoGawain: drop support for APPLE_vertex_array_object
Mike Erwin [Sun, 21 May 2017 20:48:54 +0000 (16:48 -0400)]
Gawain: drop support for APPLE_vertex_array_object

Recent versions of OpenGL support VAOs natively.

Part of T49012

3 years agoGawain: promote 10_10_10 to first-class vertex format
Mike Erwin [Sun, 21 May 2017 19:59:34 +0000 (15:59 -0400)]
Gawain: promote 10_10_10 to first-class vertex format

This format is part of OpenGL 3.3, and one of the reasons for choosing 3.3 over 3.2.

Instead of checking #if USE_10_10_10 just use it wherever needed.

3 years ago[msvc] Use debug nunmpy archive for debug builds
lazydodo [Sun, 21 May 2017 15:31:55 +0000 (09:31 -0600)]
[msvc] Use debug nunmpy archive for debug builds

3 years agoCycles Denoising: Skip feature pass writing for volume-only shaders
Lukas Stockner [Sun, 21 May 2017 03:40:13 +0000 (05:40 +0200)]
Cycles Denoising: Skip feature pass writing for volume-only shaders

Volume shaders without anything connected to the surface output are treated
as if they had a transparent BSDF as the surface shader in Cycles, so the
denoiser should skip feature pass writing for them just as it does with an
actual transparent BSDF.

3 years agoCycles Denoising: Skip confidence interval test for outlier central pixels
Lukas Stockner [Sun, 21 May 2017 03:26:13 +0000 (05:26 +0200)]
Cycles Denoising: Skip confidence interval test for outlier central pixels

If the central pixel is an outlier, the denoiser is supposed to predict its
value from the surrounding pixels. However, in some cases the confidence
interval test would reject every single surrounding pixel, which leaves the
model fitting with no data to work with.

3 years agoEevee: Initial implementation of exponential shadowmaps
Clément Foucault [Sat, 20 May 2017 14:47:33 +0000 (16:47 +0200)]
Eevee: Initial implementation of exponential shadowmaps

Also fixes the rendering of depth.

3 years agoEevee: Move cube shadows to octahedron shadowmaps.
Clément Foucault [Sat, 20 May 2017 11:16:14 +0000 (13:16 +0200)]
Eevee: Move cube shadows to octahedron shadowmaps.

We render linear distance to the light in a R32 texture and store it into an octahedron projection inside a 2D texture array.

This render the sampling function much more simpler and without edge artifacts.

3 years agoGPUTexture: Enabling R32 format for linear depth encoding.
Clément Foucault [Sat, 20 May 2017 11:11:21 +0000 (13:11 +0200)]
GPUTexture: Enabling R32 format for linear depth encoding.

3 years agoEevee: optimize vertex shader for probe and shadows.
Clément Foucault [Fri, 19 May 2017 10:00:20 +0000 (12:00 +0200)]
Eevee: optimize vertex shader for probe and shadows.

3 years agoCleanup: warnings
Campbell Barton [Sat, 20 May 2017 23:39:31 +0000 (09:39 +1000)]
Cleanup: warnings

3 years agoDwM: assert when uniforms aren't found
Campbell Barton [Sat, 20 May 2017 13:54:58 +0000 (23:54 +1000)]
DwM: assert when uniforms aren't found

More useful when this error shows up early

3 years agoDwM: Object mode empty-image support
Campbell Barton [Sat, 20 May 2017 12:57:47 +0000 (22:57 +1000)]
DwM: Object mode empty-image support

3 years agoCycles: Cleanup, style and unused arguments
Sergey Sharybin [Sat, 20 May 2017 12:21:27 +0000 (05:21 -0700)]
Cycles: Cleanup, style and unused arguments

- Some arguments were inapproriatry tagged as unused
  using (void)foo semantic.

  Only use such semantic in tricky casses, when something
  needs to be ignored in release builds or something is
  dependent on tricky ifndef policy.

  For rest of the cases just use void foo(int /bar*/)
  semantic, which ensures variable is not used. Solves
  confusion and code running out of sync with later
  development.

- Used proper unused semantic to some arguments.

- Added braces to make code easier to follow, tricky
  indentation with ifdef, uh.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sat, 20 May 2017 04:19:05 +0000 (14:19 +1000)]
Merge branch 'master' into blender2.8

3 years agoCMake: Use GCC7's -Wimplicit-fallthrough=5
Campbell Barton [Sat, 20 May 2017 04:01:03 +0000 (14:01 +1000)]
CMake: Use GCC7's -Wimplicit-fallthrough=5

Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.

3 years agoCycles Denoising: Prevent overfitting when using a very low radius
Lukas Stockner [Fri, 19 May 2017 21:08:23 +0000 (23:08 +0200)]
Cycles Denoising: Prevent overfitting when using a very low radius

For example, when using a radius of 1, only 9 pixels (due to weighting maybe
even less) will be used, but the transform code may still decide to use a
5-dimensional (or even higher) fit.
This causes severe overfitting and therefore weird pixel values.

To avoid this, this commit limits the amount of dimensions to a third of the
pixel number. For a radius of 3 or more, this doesn't change anything, but
for 1 and 2 it can prevent fireflies and/or negative values being produced.

3 years agoFix T51560: Black pixels on a denoising render
Lukas Stockner [Fri, 19 May 2017 21:04:13 +0000 (23:04 +0200)]
Fix T51560: Black pixels on a denoising render

Once again, numerical instabilities causing the Cholesky decomposition to fail.

However, further increasing the diagonal correction just because of a few
pixels in very specific scenes and settings seems unjustified.
Therefore, this commit simply falls back to the basic NLM-filtered pixel
if the more advanced model fails.

3 years agoCycles: Reload kernels from Session when requested features change
Mai Lavelle [Thu, 18 May 2017 02:14:12 +0000 (22:14 -0400)]
Cycles: Reload kernels from Session when requested features change

This fixes T49496.

3 years agoClay/Eevee: fix more crash when entering edit mode
Mike Erwin [Fri, 19 May 2017 20:12:13 +0000 (16:12 -0400)]
Clay/Eevee: fix more crash when entering edit mode

Shader stages need to agree about interpolation qualifiers. Apparently implicit smooth (the default) and explicit smooth are considered different by some GLSL compilers. Found by @letterrip on Linux + Intel.

Follow-up to 941e739d703542af1637c6a37953adac5f6b36bb

3 years agoOpenGL: cleanup material shader GLSL
Mike Erwin [Fri, 19 May 2017 18:20:08 +0000 (14:20 -0400)]
OpenGL: cleanup material shader GLSL

prefer vector math over scalar
prefer * over /
shorten vec3(x, x, x) to vec3(x)
use clamp, max, etc. instead of custom logic
declare loop vars as part of for loop
spacing

3 years agoOpenGL: cleanup edit overlay shaders
Mike Erwin [Fri, 19 May 2017 18:13:43 +0000 (14:13 -0400)]
OpenGL: cleanup edit overlay shaders

Mostly simple fixes to spacing & comments.

3 years agoClay/Eevee: fix crash when entering edit mode
Mike Erwin [Fri, 19 May 2017 16:54:26 +0000 (12:54 -0400)]
Clay/Eevee: fix crash when entering edit mode

vertexColor output was not being written --> shader failed to link --> assert hit while setting that shader's uniforms.

Vertex attribs are smooth by default, so I shortened the declaration.

@fclem or @dfelinto: is color = 0 ok here?

3 years agoFix T51524: Instantiated Hair Object which has dupligroup children and hidden orig...
Bastien Montagne [Fri, 19 May 2017 17:33:52 +0000 (19:33 +0200)]
Fix T51524: Instantiated Hair Object which has dupligroup children and hidden orig objects of group crash at render.

Note that this is speculative fix, actually precisely understanding what
happens in this code is... not easy.

3 years agoMove particle drawing to object mode
Luca Rood [Fri, 19 May 2017 16:32:40 +0000 (18:32 +0200)]
Move particle drawing to object mode

3 years agoOpenGL: remove BIT_OPERATIONS check from GLSL
Mike Erwin [Fri, 19 May 2017 16:35:49 +0000 (12:35 -0400)]
OpenGL: remove BIT_OPERATIONS check from GLSL

Since the upgrade we can use bitwise operations without checking. No more lame fallbacks!

3 years agoFix issue with alpha layering for AA dot drawing
Luca Rood [Fri, 19 May 2017 16:01:24 +0000 (18:01 +0200)]
Fix issue with alpha layering for AA dot drawing

3 years agoImplement particle drawing with draw manager
Luca Rood [Fri, 19 May 2017 15:13:48 +0000 (17:13 +0200)]
Implement particle drawing with draw manager

This still has a couple of issues:
* Instancing is not working when multiple particle systems use the same
primitive. Only the last particle system to be drawn with a particular
primitive shows up.

* Because of colors being passed as uniforms with static variables, the
color of the collection of the last object to be evauluated is used for
all particles being displayed.

Also, note that while this is being drawn in the clay engine, this might
be moved to the object mode later intead.

Part of T51378

3 years agoChange particle draw_size default and limits
Luca Rood [Fri, 19 May 2017 15:19:20 +0000 (17:19 +0200)]
Change particle draw_size default and limits

Particle draw size can now no longer be less than 1px, and the default
value has been changed to 4.

3 years agofix typo in interlace shader
Mike Erwin [Fri, 19 May 2017 15:08:49 +0000 (11:08 -0400)]
fix typo in interlace shader

introduced by recent 8adec78ca574f09242aa4588ad04f498f1e074aa

3 years agoOpenGL: convert old texture2D calls in built-in shaders
Mike Erwin [Fri, 19 May 2017 15:02:32 +0000 (11:02 -0400)]
OpenGL: convert old texture2D calls in built-in shaders

3 years agoOpenGL: clean up smoke & fire shaders
Mike Erwin [Fri, 19 May 2017 14:43:32 +0000 (10:43 -0400)]
OpenGL: clean up smoke & fire shaders

TODO: swap gl_Vertex for vec3 pos, update smoke setup code

3 years agoOpenGL: convert old texture2D calls in FX shaders
Mike Erwin [Fri, 19 May 2017 14:41:42 +0000 (10:41 -0400)]
OpenGL: convert old texture2D calls in FX shaders

And one texture1D call.

3 years agoOpenGL: convert old texture2D calls in material GLSL
Mike Erwin [Fri, 19 May 2017 14:23:07 +0000 (10:23 -0400)]
OpenGL: convert old texture2D calls in material GLSL

Modern GLSL simplifies texture sampling functions. Info about 1D, 2D, 3D, Cube, etc. comes from the sampler type.

3 years agoCycles: Fix compilation error after recent changes
Sergey Sharybin [Fri, 19 May 2017 14:48:42 +0000 (16:48 +0200)]
Cycles: Fix compilation error after recent changes

Spotted by Steffen Dünner, thanks@

3 years agoRemove redundant workaround for removing collections in outliner
Julian Eisel [Fri, 19 May 2017 13:47:47 +0000 (15:47 +0200)]
Remove redundant workaround for removing collections in outliner

Collections are now identified by their pointer.
Also had to correct TSE_IS_REAL_ID to fix undefined behavior on undo.

3 years agoFix crash when changing Clay "Edge Strength"
Dalai Felinto [Fri, 19 May 2017 13:49:21 +0000 (15:49 +0200)]
Fix crash when changing Clay "Edge Strength"

This was introduced by a removed line in
rB0eb32ab22809d9c0c41bfff5082f58b1a7aa9965

If we want to change the value to a differen default, it should be done
in a separated commit.

3 years agoFix crash opening really old files with compositor
Sergey Sharybin [Fri, 19 May 2017 13:41:26 +0000 (15:41 +0200)]
Fix crash opening really old files with compositor

There was lack of certain sockets do-versaions: namely the ones
which were added in blender versions after the one used to save
the file.

3 years agoFix crash when adding Torus in edit mode
Dalai Felinto [Fri, 19 May 2017 13:33:50 +0000 (15:33 +0200)]
Fix crash when adding Torus in edit mode

3 years agoFix assert on framebuffer binding
Dalai Felinto [Fri, 19 May 2017 12:39:27 +0000 (14:39 +0200)]
Fix assert on framebuffer binding

3 years agoCleanup: add braces for multi-line blocks
Campbell Barton [Fri, 19 May 2017 12:18:54 +0000 (22:18 +1000)]
Cleanup: add braces for multi-line blocks

3 years agoRemove unused functions after WITH_LEGACY_OPENGL cleanup
Dalai Felinto [Fri, 19 May 2017 10:17:02 +0000 (12:17 +0200)]
Remove unused functions after WITH_LEGACY_OPENGL cleanup

3 years agoRemove reference to WITH_LEGACY_OPENGL
Dalai Felinto [Fri, 19 May 2017 12:15:49 +0000 (14:15 +0200)]
Remove reference to WITH_LEGACY_OPENGL

We only keep this as a way to get GPU_stubs to run, in case we want to do a
throughout cleanup in the codebase and want code using legacy calls to
fail to build.

3 years agoRemove reference to SUPPORT_LEGACY_MATRIX
Dalai Felinto [Fri, 19 May 2017 10:04:56 +0000 (12:04 +0200)]
Remove reference to SUPPORT_LEGACY_MATRIX

Since the change to core profile this is no longer supported.

3 years agoRemove reference to WITH_GL_PROFILE_CORE
Dalai Felinto [Fri, 19 May 2017 09:47:55 +0000 (11:47 +0200)]
Remove reference to WITH_GL_PROFILE_CORE

There is no more point of keep those around. ES20 may need special case
when/if we dabble with it again. Meanwhile no point on polluting the
code with this.

(ghost still has reference for the PROFILE, but that's reasonable)

3 years agoCorrect core profile way of getting color depth
Dalai Felinto [Fri, 19 May 2017 12:10:10 +0000 (14:10 +0200)]
Correct core profile way of getting color depth

3 years agoCycles: Cleanup, always use parenthesis
Sergey Sharybin [Fri, 19 May 2017 10:57:51 +0000 (12:57 +0200)]
Cycles: Cleanup, always use parenthesis

Easier to read/follow, and more robust for the further changes.

3 years agoCycles: Cleanup, indentation in preprocessor
Sergey Sharybin [Fri, 19 May 2017 10:54:46 +0000 (12:54 +0200)]
Cycles: Cleanup, indentation in preprocessor

3 years agoCycles: Cleanup, variable names
Sergey Sharybin [Fri, 19 May 2017 10:52:12 +0000 (12:52 +0200)]
Cycles: Cleanup, variable names

Don't use camel case for variable names. Leave that for the structures.

3 years agoCycles: Cleanup, useless new lines
Sergey Sharybin [Fri, 19 May 2017 10:45:22 +0000 (12:45 +0200)]
Cycles: Cleanup, useless new lines

3 years agoCycles: Cleanup, braces after function definition
Sergey Sharybin [Fri, 19 May 2017 10:43:26 +0000 (12:43 +0200)]
Cycles: Cleanup, braces after function definition

I wouldn't mind switching fully to Google style, but i am against of
mixing two different styles in same project. So just stick to brace
at the new line after function definition.

3 years ago\0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr
Sergey Sharybin [Fri, 19 May 2017 10:33:28 +0000 (12:33 +0200)]
\0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr

There were following issues with ccl_restrict_ptr:

- We already had ccl_restrict for all platforms.

- It was secretly adding `const` qualifier to the declaration,
  which is quite weird since non-const pointer can also be
  declared as restricted.

- We never in Blender are using foo_ptr or FooPtr type definitions,
  so not sure why we should introduce such a thing here.

- It is absolutely wrong from semantic point of view to put pointer
  into the restrict macro -- const is a part of type, not part of
  hint for compiler that some pointer is never aliased.

3 years agoFix T51537: Light passes are summed twice for split kernel since denoise commit
Sergey Sharybin [Fri, 19 May 2017 10:14:03 +0000 (12:14 +0200)]
Fix T51537: Light passes are summed twice for split kernel since denoise commit

Denoise commit introduced kernel_write_result() which saves light passes, so
no need to call both kernel_write_result() and kernel_write_light_passes() from
the split kernel.

Weirdly enough. kernel_write_result() does not take care about debug passes.

3 years agoFix T51556: Sequencer - White Balance Modifier - Masking is not honored
Sergey Sharybin [Fri, 19 May 2017 09:29:18 +0000 (11:29 +0200)]
Fix T51556: Sequencer - White Balance Modifier - Masking is not honored

3 years agoFix/workaround T51070: Cannot scale procedural texture in compositor
Sergey Sharybin [Fri, 19 May 2017 08:56:26 +0000 (10:56 +0200)]
Fix/workaround T51070: Cannot scale procedural texture in compositor

The issue is coming from some weird semi-finished canvas feature, which
was remapping coordinate without applying any differential on the sampling
ellipse (in fact, there is no ellipse, sampling think is always a single
pixel).

The whole thing is just weak in the compositor, for now just bring behavior
back to how it was prior to optimization (multithreading) commit.

3 years agoCompositor: Remove unused funciton
Sergey Sharybin [Fri, 19 May 2017 08:55:26 +0000 (10:55 +0200)]
Compositor: Remove unused funciton

3 years agoCleanup: removing dummy legacy dashed line shader.
Bastien Montagne [Fri, 19 May 2017 07:42:30 +0000 (09:42 +0200)]
Cleanup: removing dummy legacy dashed line shader.

Dashed requires geom shader, which was not available with older OpenGL,
now that we are on 3.3 we do not need that dummy workaround anymore.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Fri, 19 May 2017 07:36:14 +0000 (09:36 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/blenloader/intern/versioning_270.c
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/editors/mask/mask_draw.c

3 years agoFix empty-image draw size
Campbell Barton [Fri, 19 May 2017 06:41:23 +0000 (16:41 +1000)]
Fix empty-image draw size

Was out of sync with 2.7x.

3 years agoFix T51553: Cycles Volume Emission turns black when strength is 0 or color is black
Lukas Stockner [Fri, 19 May 2017 02:59:35 +0000 (04:59 +0200)]
Fix T51553: Cycles Volume Emission turns black when strength is 0 or color is black

The problem was that Cycles implicitly uses a transparent surface shader when only
volume nodes are used, but since the black emission shader gets optimized away,
it was no longer detected and therefore no transparent surface was used.

Therefore, the shader now stores whether volume nodes were connected before
optimizing.

3 years agoFix T51506: Wrong shadow catcher color when using selective denoising
Lukas Stockner [Fri, 19 May 2017 01:47:09 +0000 (03:47 +0200)]
Fix T51506: Wrong shadow catcher color when using selective denoising

3 years agoCycles: Fix random noise pattern seen with multiscatter bsdf and split kernel
Mai Lavelle [Fri, 19 May 2017 01:14:31 +0000 (21:14 -0400)]
Cycles: Fix random noise pattern seen with multiscatter bsdf and split kernel

Differentials were unset if roughness was low giving undefined behavior.

3 years agoFix T51555: Cycles tile count is incorrect when denoising is enabled
Lukas Stockner [Fri, 19 May 2017 01:27:38 +0000 (03:27 +0200)]
Fix T51555: Cycles tile count is incorrect when denoising is enabled

Now rendered and denoised tiles are counted and displayed separately.

3 years agoRemove use_display_lists option
Campbell Barton [Fri, 19 May 2017 00:07:02 +0000 (10:07 +1000)]
Remove use_display_lists option

3 years agoFix T51502: Cycles denoising not using correctly aligned width for NLM on CUDA
Lukas Stockner [Fri, 19 May 2017 00:02:36 +0000 (02:02 +0200)]
Fix T51502: Cycles denoising not using correctly aligned width for NLM on CUDA

3 years agoOpenGL: call glProgramUniform only if version >= 4.1
Mike Erwin [Thu, 18 May 2017 22:30:09 +0000 (18:30 -0400)]
OpenGL: call glProgramUniform only if version >= 4.1

Otherwise crash! Called from OpenSubdiv setup code. Might start using this in more places...

3 years agoOpenSubdiv: insert TODO notes for OpenGL
Mike Erwin [Thu, 18 May 2017 21:45:31 +0000 (17:45 -0400)]
OpenSubdiv: insert TODO notes for OpenGL

3 years agoOpenGL: remove EXT_geometry_shader4 from OpenSubdiv
Mike Erwin [Thu, 18 May 2017 21:32:39 +0000 (17:32 -0400)]
OpenGL: remove EXT_geometry_shader4 from OpenSubdiv

Old extension was made obsolete by GL 3.2.
Input/output layout is part of GLSL.

3 years agoOpenSubdiv: remove legacy support & display queries
Mike Erwin [Thu, 18 May 2017 21:28:04 +0000 (17:28 -0400)]
OpenSubdiv: remove legacy support & display queries

OSD display needs more work, since it uses some legacy OpenGL light and material functions.

3 years agoremove GPU_legacy_support query
Mike Erwin [Thu, 18 May 2017 20:58:33 +0000 (16:58 -0400)]
remove GPU_legacy_support query

In the move to OpenGL 3.3 core profile, we drop support for compatibility profile and older versions.

OpenSubdiv was the only user; I'll update OSD next.

3 years agoOpenGL: remove -noglsl option & GPU_extensions_disable
Mike Erwin [Thu, 18 May 2017 20:21:49 +0000 (16:21 -0400)]
OpenGL: remove -noglsl option & GPU_extensions_disable

Also removed a leftover reference to the old basic-shader-glsl option.

3 years agoGPU: cleanup GLSL version and standard extensions
Mike Erwin [Thu, 18 May 2017 19:47:32 +0000 (15:47 -0400)]
GPU: cleanup GLSL version and standard extensions

Now we always use GLSL 3.3, AKA #version 330. Most of the extensions we used are built into OpenGL 3.3 so we don't need them anymore.

Cleaned up comments related to GLSL version.

Part of T49012

3 years agoremove GPU_geometry_shader_support, instanced_drawing_support queries
Mike Erwin [Thu, 18 May 2017 19:25:03 +0000 (15:25 -0400)]
remove GPU_geometry_shader_support, instanced_drawing_support queries

These are always supported now
- instancing as of GL 3.1
- geometry shaders as of GL 3.2

The change to rna_scene.c could use some cleanup, since we don't really need a runtime query function.

3 years agoremove GPU_display_list_support query
Mike Erwin [Thu, 18 May 2017 19:17:47 +0000 (15:17 -0400)]
remove GPU_display_list_support query

Display lists are not part of modern OpenGL.

Only BGE used this, and I forced those uses to false. Commented out old BGE logic for reference.

3 years agoCycles Denoising: Add more robust outlier heuristic to avoid artifacts
Lukas Stockner [Thu, 18 May 2017 01:03:18 +0000 (03:03 +0200)]
Cycles Denoising: Add more robust outlier heuristic to avoid artifacts

Extremely bright pixels in the rendered image cause the denoising algorithm
to produce extremely noticable artifacts. Therefore, a heuristic is needed
to exclude these pixels from the filtering process.

The new approach calculates the 75% percentile of the 5x5 neighborhood of
each pixel and flags the pixel if it is more than twice as bright.

During the reconstruction process, flagged pixels are skipped. Therefore,
they don't cause any problems for neighboring pixels, and the outlier pixels
themselves are replaced by a prediction of their actual value based on their
feature pass values and the neighboring pixels.

Therefore, the denoiser now also works as a smarter despeckling filter that
uses a more accurate prediction of the pixel instead of a simple average.
This can be used even if denoising isn't wanted by setting the denoising
radius to 1.

3 years agoCycles Denoising: Fix wrong order of denoising feature passes
Lukas Stockner [Thu, 18 May 2017 16:31:28 +0000 (18:31 +0200)]
Cycles Denoising: Fix wrong order of denoising feature passes