Commit Graph

37860 Commits

Author SHA1 Message Date
Sergey Sharybin
ed792b5de0 Box and Ellipse mask nodes will now output shape
even if nothing is attached to input.

They'll use black image with render resolution
as a background if nothing is attached to mask input.

Was a request from 4K ToS project.
2013-04-02 17:56:41 +00:00
Brecht Van Lommel
f7efb51054 Fix #34803: blender internal SSS rendering black/nan with negative texture colors. 2013-04-02 17:49:31 +00:00
Sergey Sharybin
c4780c233e Fix for potential missing draw-update when building without OCIO 2013-04-02 17:39:34 +00:00
Sergey Sharybin
752ad1bc37 More usage of GLSL for color managed image drawing
Uses GLSL for drawing image in Image Editor space.

This requires change in image_buffer_rect_update, so
original float buffer is being updated as well. This
is unlikely be something bad, but will keep an eye
on this change.

Also no byte buffer allocation happens there, this
is so because byte buffer used for display only
and in case of GLSL display such allocation and
partial update is just waste of time.

Also switched OpenGL render from using CPU color
space linearization to GLSL color space transform.
Makes OpenGL rendering pretty much faster (but
still slower than in 2.60).

internal changes:

- Added functions to setup GLSL shader for color
  space conversion in colormanagement.c. Currently
  conversion form a colorspace defined by a role to
  linear space is implemented. Easy to extend to
  other cases.

- Added helper functions to glutil.c which does
  smarter image buffer draw (calling all needed OCIO
  stuff, editors now could draw image buffer with a
  single function call -- all the checks are done in
  glutil.c).

- Also added helper function for buffer linearization
  from a given role to glutil.c. Everyone now able to
  linearize buffer with a single call.

  This function will do nothing is GLSL routines fails
  or not supported.

  And one last this: this function uses offscreen
  drawing, could potentially give issues on some
  cards, also will keep an eye on this.
2013-04-02 17:28:37 +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
Ton Roosendaal
726dedafbc More Histogram fixes:
Sequencer histogram was calculating still badly, now it uses a per-color
component counter to calculate the levels (instead of counter for all)
2013-04-02 17:12:21 +00:00
Brecht Van Lommel
dc685bc1c3 Fix #34711: matcap option not showing when switching from cycles material/rendered
draw mode to blender internal.
2013-04-02 16:51:23 +00:00
Brecht Van Lommel
0aada35e93 Fix #34788, #34744: GLSL error, #version line needs to be at the top of the shader
and this wasn't the case anymore after recent changes.
2013-04-02 16:37:31 +00:00
Ton Roosendaal
00a1dca612 Removed leftover debug print. 2013-04-02 13:15:12 +00:00
Antony Riakiotakis
dbfadcad61 Fix compilation on MinGW(64/32)
Also, add appropriate lib paths for recent OpenCollada for mingw32 (coming soon to an svn server near you)
2013-04-02 13:07:01 +00:00
Ton Roosendaal
5105ddae74 Missing GLEW path in CMake, fixes compile error in OS X. 2013-04-02 12:54:47 +00:00
Ton Roosendaal
58530a5aff Usability fix, for color grading.
The Scopes and Histogram (Image editor, Sequencer) were not updating on
changes in color or display settings. 

- Missing notifiers for refreshing
- Missing code to draw correct for managed byte buffers.
2013-04-02 12:41:11 +00:00
Ton Roosendaal
a78aa15cd6 Key mapping conflict for 'find node' versus 'add socket link' (noodle).
Historically, F shortcut was for 'add edge/face' in Blender.
In Node editor, F makes a noodle, ctrl+f made a noodle replace too.

To keep ALT+F work for "Unattach from frame", the solution I now propose
is to make CTRL+F for finding nodes, and SHIFT+F for 'add noodle with replace'.
2013-04-02 12:38:05 +00:00
Lukas Toenne
8abfaf880d Fix for #34756 and #34810, crashes when dropping nodes onto noodles and a related forward compatibility bug.
Added a sanity check to the ED_node_link_insert function to ensure it exits gracefully if no suitable sockets can be found. This was the problem with custom pynodes, which don't define the 'type' DNA of old sockets. The operator will have to be generalized for future nodes, but for now just not crashing seems good enough.

Script node crashes in #34810 were caused by uninitialized 'type' integer as well. This is now done in the set_typeinfo function for sockets (like for trees and nodes too), to avoid any potential remaining issues of this kind. Note that new files need to be loaded and saved again once to be forward compatible again.
2013-04-02 11:59:27 +00:00
Campbell Barton
37bf7dd98a draw helper lines for inset and bevel operators, the mouse distance from the selection center was used, but often it was hard to tell where this was and you'd have to guess.
adds ED_region_draw_mouse_line_cb() generic draw callback for mouse helper lines.
2013-04-02 10:48:11 +00:00
Bastien Montagne
932820499a Usual typo fixing... 2013-04-02 07:27:39 +00:00
Joshua Leung
186f0e241e Compile fix: size_t (required by BLI_string.h) was undefined 2013-04-02 03:51:42 +00:00
Brecht Van Lommel
07d027b102 Fix FFMPEG build error with older versions after planar formats commit. 2013-04-01 20:51:52 +00:00
Brecht Van Lommel
de9dffc61e Cycles: initial subsurface multiple scattering support. It's not working as
well as I would like, but it works, just add a subsurface scattering node and
you can use it like any other BSDF.

It is using fully raytraced sampling compatible with progressive rendering
and other more advanced rendering algorithms we might used in the future, and
it uses no extra memory so it's suitable for complex scenes.

Disadvantage is that it can be quite noisy and slow. Two limitations that will
be solved are that it does not work with bump mapping yet, and that the falloff
function used is a simple cubic function, it's not using the real BSSRDF
falloff function yet.

The node has a color input, along with a scattering radius for each RGB color
channel along with an overall scale factor for the radii.

There is also no GPU support yet, will test if I can get that working later.

Node Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF

Implementation notes:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/Subsurface_Scattering
2013-04-01 20:26:52 +00:00
Joerg Mueller
8588fec935 FFMPEG: adding support for ffmpeg planar formats also to writeffmpeg.c. 2013-04-01 15:31:27 +00:00
Ton Roosendaal
c35dec60b5 Node editing feature:
New operator "Find Node".
Opens search menu, and allows to find a node based on name or label.

On selecting name, menu selects/activates the node and moves the view to it.

Shortcut: ALT+F 
Menu: Node editor, "Select"
2013-04-01 15:07:22 +00:00
Sergey Sharybin
689f3aa174 Fix for recent changes in IMB_display_buffer_acquire
Do early out when ibuf has 4 channels only, allocate
4-channels display buffer.

So now we could always assume byte buffer is always
in RGBA format.
2013-04-01 12:22:52 +00:00
Sergey Sharybin
daa1e5bff2 Fix for GLSL display: NULL view_settings are allowed now
Currently no functional changes for users, but this change
is crucial for further GLSL images display.
2013-04-01 12:08:43 +00:00
Campbell Barton
5d234f0a0b code cleanup: includes 2013-04-01 11:27:47 +00:00
Campbell Barton
9328ae282c remove duplicate defines in makesrna.c 2013-04-01 10:26:16 +00:00
Campbell Barton
6d8e25dfdc code cleanup: split editmesh_tools.c, into inset, bevel (both modal operators) and moved extrude operators into their own file.
also move some selection operators from editmesh_tools.c into editmesh_select.c
2013-04-01 10:18:01 +00:00
Sergey Sharybin
e8d0e77856 Fix #34813: smooth brush used on a shape key messes up the topology - part2
This reverts rev55642 and fixes issue in a different way.

The thing here is: isolated vertices are for sure not in BVH
and updating keyblock could not only rely on idea that all
vertices are in BVH (no idea why it was noticed just now).

Solved in a way, that uses old keyblock coordinates as new
keyblock, and then refines it using coordinates from BVH.

Hopefully it'll cover all cases now :)
2013-04-01 09:55:37 +00:00
Sergey Sharybin
3657f3d938 Draw checker backdrop for sequencer when in RGBA mode 2013-04-01 09:15:37 +00:00
Campbell Barton
c7e2a31bf2 correct too-big allocation in mesh beautify. 2013-04-01 07:57:33 +00:00
Sergey Sharybin
5e02acf887 Fix #34819: Background image gets pixelated when zooming in
Was a regression in glaDrawPixelsTex changes related on zoom filter.
For background image linear interpolation was used.
2013-04-01 07:50:51 +00:00
Sergej Reich
4e0e9eb994 Draw relationship lines for rigid body constraints
Makes it easier to see what's connected to what.
2013-03-31 19:52:37 +00:00
Thomas Dinges
6382ebe67d Fix for [#34821] Split Viewer node won't show the backdrop
* Regression introduced in r55451
2013-03-31 19:46:11 +00:00
Antony Riakiotakis
8d036a21d7 Changes to Stencil control:
* Add a poll function that only activates the operator when a stencil
brush is active
* Change shortcuts to RMouse - translate, Shift - RMouse Scale, Ctrl -
RMouse, rotate. MUCH faster and simpler workflow.
* Change shortcut of colour sampling to S. Sampling is important but not
as important as warranting the Right Mouse button.
* Add a notifier so that toolbar gets updated texture rotation when
rotating the stencil

Also,
* Slight rearrangement of options so that jittering is more accessible
(easily more often used than smooth stroke)
2013-03-31 16:17:18 +00:00
Antony Riakiotakis
c33d5c7133 optimize away reloading of brush texture when rotating the stencil 2013-03-31 11:20:30 +00:00
Antony Riakiotakis
514c449a54 UI cleanup:
* Using masking is determined only by the presence of the texture,
remove extraneous DNA flag (might cause issues later but in practice
brush options are not harmful)
* Overlay and angle sliders are active during stencil mapped brushes
* Only draw the overlay if there's a texture.
2013-03-31 11:04:13 +00:00
Campbell Barton
e8d532f1dd style cleanup 2013-03-31 03:28:46 +00:00
Antony Riakiotakis
1fea6220a2 Woot woot commit.
Stencil style texture mapping. Ready for field testing and user feedback.

This commit adds stencil like brushes, like those that existed on old ptex branch.
(with the exception of clip colour)
To control the position of the stencil, you use

Q: translation
Shift - Q: scaling
Ctrl - Q: rotation

There's extra work that has been done to make this work:

* Support for coloured overlay in vertex/texture painting
* Also made A button do stroke mode selection like in sculpt mode,
when mask painting is inactive.

There are some TODOs to work on during bcon3:

* Support tiled and stencil mode in 2D painting. Support alpha textures also.
* Tidy up overlay code. There's some confusion there due
to the way we use the primary brush texture sometimes for alpha, other times
for colour control.

WIP design docs will be in

http://wiki.blender.org/index.php/User:Psy-Fi/New_Brush_Tool_Design
2013-03-31 00:38:50 +00:00
Antony Riakiotakis
ae1028df73 Tidy up stroke options and make them sexy, aka the paint option
sculptification commit. We have a drop menu to select the stroke mode
now. Jitter controls appear under stroke panel under all modes (As they
should! They stroke control options). Also enable jittering for all
modes. I really fail to see why not.
2013-03-30 11:40:09 +00:00
Campbell Barton
cd6d337d41 Beautify - use a heap for the edge rotation queue rather then checking to rotate all edges until none can be rotated.
this means the best edges to rotate are done first, also speeds up execution ~20% in my tests.
2013-03-30 11:05:57 +00:00
Campbell Barton
20376f3337 code cleanup: move beauty fill calculation into its own function and some style cleanup 2013-03-30 09:57:35 +00:00
Campbell Barton
b1f4e2b4db code comments: bmesh operator doxy header descriptions. 2013-03-30 08:54:50 +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
Antony Riakiotakis
44a43afd0e Slight cleanup for 2d painting. Cache is always enabled (used one of the
bookkeeping variables from when the code was shared with texture
painting) Also texonly now is always zero, probably another leftover
from 2d/3d painting entanglement era.
2013-03-29 15:18:22 +00:00
Antony Riakiotakis
57666b3ff1 Support for brush overlay in texture paint mode. For the image editor,
the tiled overlay is still a bit off, investigating on how to better
correct this, though it may well be non trivial.
2013-03-29 14:02:28 +00:00
Campbell Barton
3f8bb2b079 remove unused GLUquadricObj in draw_manipulator_rotate() 2013-03-29 11:44:52 +00:00
Campbell Barton
c4e2de11ad fix/workaround [#34346] Blender total crashes when File/User preferences twice and go to System tab 2013-03-29 07:14:18 +00:00
Campbell Barton
1777a69818 misc minor edits.
- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
2013-03-29 06:25:22 +00:00
Campbell Barton
ab41583bc2 style cleanup 2013-03-29 06:21:28 +00:00
Campbell Barton
c826174056 minor improvement to edge-angle-drawing, when transforming verts draw the angle of the opposite edge since this is the angle thats being changed. 2013-03-29 04:38:10 +00:00
Campbell Barton
4506f73055 add edge-angle drawing in editmode for manifold edges. 2013-03-29 04:01:52 +00:00