Commit Graph

58 Commits

Author SHA1 Message Date
Aaron Carlisle 9f044cb422 Remove MinGW support
The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.


Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648
2017-05-27 15:34:55 -04:00
Sergey Sharybin 35d490b3f1 OCIO: Implement exposure/gamma for fallback implementation
Quite handy for debugging.

Unfortunately, this doesn't support viewport tweaks yet since those
require GLSL for colorspace conversion. Maybe this will be implemented
as well one day in the future..
2016-12-02 16:57:00 +01:00
Sergey Sharybin 2f6f75613f OCIO: Cleanup style
Was a ground work for some more improvements here, but got dragged
to some other studio maintenance job here.

The plan would be to enable exposure/gamma control for fallback mode
which will definitely be really handy for development and might be
handy for cases when OCIO config can not be read.
2016-11-30 12:54:14 +01:00
Campbell Barton 7424ded9c7 Cleanup: glsl style 2016-05-26 18:53:09 +10:00
Sergey Sharybin c1095c7a9f Revert "Fix T47869: OpenColorIO Error with unicode path to config file under Windows"
White the config itself could be loaded this way, lookup tables can not. Additionally,
that's not really clear how to solve the issue with search path which is multi-byte
only in the API.

Reverting for further investigation.

This reverts commit ab4307aa08.
2016-03-23 19:28:16 +01:00
Sergey Sharybin ab4307aa08 Fix T47869: OpenColorIO Error with unicode path to config file under Windows 2016-03-23 15:09:36 +01:00
Sergey Sharybin 5f613f7b5d OCIO: Disable the warnings related on C4251
Those warnings are trigerred by stl classes in OCIO's public interface.

To quote MSDN: "C4251 can be ignored if you are deriving from a type in
the Standard C++ Library"

This is the only instance where those warnings hunts us, so for now we
can keep it all local in intern/opencolorio but this might be changed
in the future.
2016-02-20 14:06:11 +05:00
Sergey Sharybin 5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Mike Erwin ef5fff4adc OpenGL: when checking GL version, assume >= 2.1
Mostly glBlendFunc related.
2015-11-24 02:34:54 -05:00
Sergey Sharybin dfc672f8bb SCons: Fix for really nasty bug with polluting configuration environment
The issue was caused by the following construction:

  def = env['SOMETHING']
  defs.append('SOMETHING_MORE')

Since first assignment was actually referencing environment option it was totally
polluted hawing weird and wonderful side effects on all other areas of Blender.
2015-08-04 18:06:28 +02:00
Sergey Sharybin 3f4219a694 OpenColorIO: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
Antony Riakiotakis 3c21885ec4 Change coefficients to 4 digit precision only.
Need to match convention and sum up to 1.0 (previous set had a minor
10^(-10) overflow) Thanks to Campbell for taking notice.
2015-03-23 12:18:42 +01:00
Antony Riakiotakis 42aac45d7f Part 1 of D1082 by Troy Sobotka, add API in OCIO for luminance
calculation.
2015-03-17 14:15:05 +01:00
Antony Riakiotakis e1ef451996 Fix OpenGL error on cycles rendered viewport.
We queried the wrong value when looking for the bound 2D texture. This
is not totally robust because currently bound texture may not be a 2D
one, but this should work for now.
2014-10-08 12:19:06 +02:00
Jason Wilkins 8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
Sergey Sharybin 56b7d55833 Report to the console when custom ocio config is used 2014-05-23 13:48:35 +02:00
Brecht Van Lommel cccd06ea44 Fix T37810: GLSL dither shader not working on OS X.
The GLSL function textureSize() is not supported here, only when we start using
OpenGL core profile will this work. For now check the supported GLSL version and
use a somewhat slower replacement.
2013-12-14 16:01:48 +01:00
Sergey Sharybin 5a91df3271 Implement GPU-side dither
Summary:
Uses some magic pseudo-random which is actually a
texture coordinate hashing function.

TODOs:
- Dither noise is the same for all the frames.
- It's different from Floyd's dither we've been
  using before.
- Currently CPU and GPU dithering used different
  implementation. Ideally we need to use the same
  dither in CPU.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D58
2013-12-13 12:36:45 +06:00
Sergey Sharybin 46f8dba4c7 Extend system-info with information about OIIO, OCIO and OSL
Summary:
Version of those libraries might be useful to know.

- OIIO and OCIO is exposed via bpy.app.oiio and bpy.app.ocio.
  There're "supported", "version" and "version_string" defined
  in those modules.

- OSL is available as _cycles.osl_version and _cycles.osl_version_string.

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: dingto

Differential Revision: http://developer.blender.org/D79
2013-12-08 15:03:17 +06:00
Dalai Felinto 180de82e41 ocio build fix for Windows
report by email and patch by Benoit Bolsee

"It is a basic compilation bug (variable defined in a c file and declared
in the c++ file: name decoration will change the name in the c++ file
and the linker will not find it)"
2013-10-10 14:24:52 +00:00
Sergey Sharybin 0a862cb61a Fix compilation error of OCIO with MSVC 2013-10-09 20:45:29 +00:00
Sergey Sharybin 6e1fe4ddd9 Implementation of curve mapping in GLSL
The title says it all, now having curve mapping
enabled in color management settings wouldn't
force fallback from GLSL to CPU based color space
conversion.
2013-10-09 15:57:32 +00:00
Sergey Sharybin 49bc310671 Move guarded objetc allocation to a guardedalloc header
Also made libmv-capi use guarded objetc allocation.
Run into some suspecious cases when it was not so
clear whether memory is being freed or not.

Now we'll know for sure whether there're leaks or not :)

Having this macros in a guardedalloc header helps
using them in other areas (for now it's OCIO and libmv,
but in the future it'll be more places).
2013-10-09 08:46:02 +00:00
Sergey Sharybin cf8cddf07a Film response curves implemented as a looks
This commit implement's OCIO's Looks idea which
is about applying some color correction on the
buffer before it get's affected by a display
transform.

This is mainly used to modify images in an
artistics way.

Currently we've got looks generated from film
response curves for all sorts of cameras.

Patch by both of me and Brecht.
2013-09-09 09:48:26 +00:00
Sergey Sharybin ba95dc859d Remove unused constant. 2013-09-07 19:44:01 +00:00
Sergey Sharybin f00349293f Code cleanup: us commented out arg names rather than leaving them if unused 2013-09-07 19:41:46 +00:00
Brecht Van Lommel 60ff60dcdc RenderEngine API: add viewport draw utility functions to bind a GLSL fragment
shader for converting colors from linear to display space, based on the scene
color management settings.

if engine.support_display_space_shader(scene): # test graphics card support
	engine.bind_display_space_shader(scene)
	# draw pixels ..
	engine.unbind_display_space_shader()
2013-08-30 23:49:35 +00:00
Campbell Barton 47c23750e8 style cleanup: indent/whitespace 2013-08-19 01:48:44 +00:00
Sergey Sharybin b1b5274549 Tweak allocation vars for XYZ space for more accurate GPU transform
Also extend 3DLUT edge size to 64 (1 meg of memory) to increase
transform accuracy as well.
2013-04-29 10:53:10 +00:00
Ton Roosendaal 753fe9f0b9 Keeping my commit count high!
Previous GLSL code had error, the if() statement had to be negated.
2013-04-28 11:05:49 +00:00
Ton Roosendaal eae651db3a GLSL display of float buffers with alpha:
Previous version worked, now a version with simplifying this GLSL code.
2013-04-28 11:03:01 +00:00
Ton Roosendaal e355abebee This glsl shader works for OCIO with alpha. OSX iMac with ATI.
There's no logical reason I can find... but I commit it because many others have
the same error, so we can check.
2013-04-28 10:46:18 +00:00
Sergey Sharybin 69b0b0a624 Fix for fix in alpha de-premul
We do not need to premul shader result, opengl
is already configured for straight alpha.
2013-04-27 17:50:11 +00:00
Sergey Sharybin 6a04ff11af Premultiplication in OCIO shader went wrong,
it used to apply alpha on source color after
conversion, not on result.
2013-04-27 17:08:37 +00:00
Sergey Sharybin d376a1b740 Apparently better not to use values like 1.0f in GLSL code
Fix from debug session of self and Ton, was affecting OSX
builds, making GLSL display transform not working on this
platform.
2013-04-27 16:43:15 +00:00
Sergey Sharybin 514e322895 Print error log to the console if OCIO shader compilation failed 2013-04-27 16:34:56 +00:00
Sergey Sharybin e579400d92 Fixed typo in OCIO GLSL module, was using address to a pointer.. 2013-04-05 11:10:59 +00:00
Sergey Sharybin a53a106065 Fix #34872: Every images are displayed as black in UV/image editor
Issue was caused by some mesa drivers does not support GL_RGBA16F.

Now added check around glTexImage2D to verify whether requested
internal format is actually supported. If not blender will fall
back to non-GLSL image display.
2013-04-05 11:01:35 +00:00
Sergey Sharybin 9c49e71216 Bunch of fixes for GLSL display transform
- GLSL shader wasn't aware of alpha predivide option,
  always assuming alpha is straight. Gave wrong results
  when displaying transparent float buffers.

- GLSL display wasn't aware of float buffers with number
  of channels different from 4, crashing when trying to
  display image with different number of channels.

  This required a bit larger changes, namely now it's
  possible to pass format (GL_RGB, GL_RGBAm GL_LUMINANCE)
  to glaDrawPixelsTex, This also implied adding format to
  glaDrawPixelsAuto and modifying all places where this
  functions are called.

  Now GLSL will handle both 3 and 4 channels buffers,
  single channel images are handled by CPU.

- Replaced hack for render result displaying with a bit
  different hack.

  Namely CPU conversion will happen only during render,
  once render is done GLSL would be used for displaying
  render result on a screen.

  This is so because of the way renderer updates parts
  of the image -- it happens without respect to active
  render layer in image user. This is harmless because
  only display buffer is modifying, but this is tricky
  because we don't have original buffer opened during
  rendering.

  One more related fix here was about when rendering
  multiple layers, wrong image would be displaying when
  rendering is done. Added a signal to invalidate
  display buffer once rendering is done (only happens
  when using multiple layers). This solves issue with
  wrong buffer stuck on the display when using regular
  CPU display space transform and if GLSL is available
  it'll make image displayed with a GLSL shader.

- As an additional change, byte buffers now also uses
  GLSL display transform.

  So now only dutehr and RGB curves are stoppers for
  using GLSL for all kind of display transforms.
2013-04-03 15:59:54 +00:00
Sergey Sharybin f871d9a82f Fixes for recent GLSL display space conversions
- Building without OCIO will give correct results again
- If GLSL failed to compile, fallback to glaDrawPixelsAuto
  will happen.
2013-04-02 17:28:29 +00:00
Antony Riakiotakis d067ba9cbc Fix build for MinGW without opencollada (updated libs coming soon), MinGW64 now builds with opencollada 2013-04-02 02:05:03 +00:00
Sergey Sharybin 03c337f61c Epic fail in original GLSL display transform commit
Apparently C== allowed to have implementations of
OCIOImpl::setupGLSLDraw, OCIOImpl::finishGLSLDraw and
OCIOImpl::freeGLState in two different files.

STUPID!
2013-04-01 13:41:45 +00:00
Thomas Dinges 96c2647676 Compile fix for recent OCIO commit, missing GLEW include. 2013-03-29 16:17:22 +00:00
Sergey Sharybin 2dff7c01ad Implement GPU-side display transform for clip editor
Implemented using GLSL API from OpenColorIO library and
some general functions were added to it's c-api:

- OCIO_setupGLSLDraw prepares OpenGL context for GPU-based
  transformation for a giver processor.

  This function compiles and links shader, sets  up it's
  argument. After this transformation would be applied
  on an image displaying as a 2D texture.

  So, glaDrawPixelsTex called after OCIO_setupGLSLDraw will
  do a proper color space transform.

- OCIO_finishGLSLDraw restores OpenGL context after all
  color-managed display is over.

- OCIO_freeOGLState frees allocated state structure used
  for cacheing some GLSL-related stuff.

There're some utility functions in IMB_colormanagent which
are basically proxies to lower level OCIO functions but
which could be used from any place in blender.

Chacheing of movie clip frame on GPU is also removed now,
and either glaDrawPixelsTex or glaDrawPixelsAuto are used
for display now. This is so no code duplication happens
now and no large textures are lurking around in GPU memory.

Known issues:
- Texture buffer and GLSL are no longer checking for
  video card capabilities, possibly could lead to some
  artifacts on crappy drivers/cards.

- Only float buffers are displaying using GLSL, byte
  buffers will still use fallback display method.

  This is to be addressed later.

- If RGB curves are used as a part of display transform,
  GLSL display will also be disabled. This is also thing
  to be solved later.

Additional changes:

- glaDrawPixelsTexScaled will now use RGBA16F as an
  internal format of storing textures when it's used
  to draw float buffer. This is needed so LUT are
  applied without precision loss.
2013-03-29 16:02:27 +00:00
Campbell Barton 6a51379bf7 tweaks to clang so blender can build with -Werror 2013-03-14 07:25:54 +00:00
Sergey Sharybin f5317b5f0c Style cleanup in OCIO area
Also fixed typo in function name.
2013-01-08 20:55:07 +00:00
Bastien Montagne ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Sergey Sharybin eb75e43685 Solved descriptors leak in OCIO module on windows
Seems was simply caused by wrong destructor used in processorRelease
2012-11-22 12:48:09 +00:00
Campbell Barton 536d9fec80 code cleanup:
- move object_iterators.c --> view3d_iterators. (ED_object.h had to include ED_view3d.h which isn't so nice)
- move projection functions from view3d_view.c --> view3d_project.c (view3d_view was becoming a mishmash of utility functions and operators).
- some some cmake includes as system-includes.
2012-10-17 04:13:03 +00:00
Sergey Sharybin 4c3620c69d Fixed compilation error on widows
Was caused by mixing up own C-API typedefs with OCIO's
2012-10-05 10:05:26 +00:00