Commit Graph

399 Commits

Author SHA1 Message Date
41cd2d8e84 Fix #33040: baking selected to active could miss at pixels at the edge of faces
when there was a tiny mismatch between low and high poly models, maybe because
of float precision when editing the mesh. Added a small epsilon now to avoid this.
2012-11-02 13:36:26 +00:00
694aef1933 Fix #32981: Render baking redraw 2012-10-28 12:08:36 +00:00
9fc95bd7ee use min/max inline functions where MIN2/MAX2 were doing type conversion. 2012-10-27 11:18:54 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
63f042250f Bugfix #30378
Full Sample Antialiasing render gave fireflies with halos - especially on edges of polygons.
Reason was FSA exception case in code, using uninitialized color array.

Probably these fireflies were hunting us already for many many years.
2012-10-22 14:49:37 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
9f8070d047 code cleanup:
- define array sizes for functions that take vectors.
- quiet some -Wshadow warnings.
- some copy/paste error in readfile.c made it set the same particle recalc flag twice.
2012-10-20 08:02:18 +00:00
427a90d336 Color Management: texture baking should be correct when color management is disabled 2012-10-16 15:20:18 +00:00
51fe26b78d Fix #32891: Bake to Texture didn't use color management flag properly 2012-10-16 15:07:01 +00:00
76e2706b30 Fixed missing display buffer and mipmaps invalidation in cases only
few of selected objects failed to bake.
2012-10-14 06:59:01 +00:00
e8872a8ea2 style cleanup: if(); 2012-10-07 09:48:59 +00:00
6cd32435a2 Fix #32598: clamp blender internal alpha channel to 0..1, and RGB to 0..inf,
to avoid compositing issues. The values can go out of bounds due to sharp
pixel filters.

In Cycles the alpha channel is already clamped, and there are no pixel filters
that could cause negative RGB values.
2012-09-20 00:39:27 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
a73dd3476e Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.

This introduces two configurable color spaces:

- Input color space for images and movie clips. This space is used to convert
  images/movies from color space in which file is saved to Blender's linear
  space (for float images, byte images are not internally converted, only input
  space is stored for such images and used later).

  This setting could be found in image/clip data block settings.

- Display color space which defines space in which particular display is working.

  This settings could be found in scene's Color Management panel.

When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.

This conversions are:

- View, which defines tone curve applying before display transformation.
  These are different ways to view the image on the same display device.
  For example it could be used to emulate film view on sRGB display.

- Exposure affects on image exposure before tone map is applied.

- Gamma is post-display gamma correction, could be used to match particular
  display gamma.

- RGB curves are user-defined curves which are applying before display
  transformation, could be used for different purposes.

All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.

This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).

Some technical notes:

- Image buffer's float buffer is now always in linear space, even if it was
  created from 16bit byte images.

- Space of byte buffer is stored in image buffer's rect_colorspace property.

- Profile of image buffer was removed since it's not longer meaningful.

- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
  to support other spaces, but it's quite large project which isn't so
  much important.

- Legacy Color Management option disabled is emulated by using None display.
  It could have some regressions, but there's no clear way to avoid them.

- If OpenColorIO is disabled on build time, it should make blender behaving
  in the same way as previous release with color management enabled.

More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management

--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
c92ab5c3ef code cleanup: use rect size macros 2012-08-21 20:34:05 +00:00
c41e1e434a code cleanup: replace MIN2/MAX2 with minf/maxf 2012-07-29 16:59:51 +00:00
cfb7aee017 style cleanup 2012-07-07 22:51:57 +00:00
74c9c24d27 style cleanyp 2012-06-23 23:22:19 +00:00
de6af75d4d code cleanup: use array size and const for vector args 2012-05-26 16:04:31 +00:00
da710b3e14 style cleanup: brace placement/newlines 2012-05-24 16:35:45 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
f0fc8c22bb Fix #27120: Bake to image used for rendering glitch (bake feedback loop)
Detect feedback loop and do not bake to images detected in this loop and show
nice warning message in such cases.

It's a way which wouldn't overcomplicate code trying to duplicate images and so
without real benefit.
2012-01-20 07:43:46 +00:00
a87c5eb52c use color conversions functions in more places.
also add rgba_float_to_uchar, rgba_uchar_to_float
2012-01-19 10:04:51 +00:00
4786541285 add utility functions linearrgb_to_srgb_uchar4,
linearrgb_to_srgb_uchar3, was being done inline.
2012-01-19 08:22:23 +00:00
de4befb075 Code refactoring: split render result related functions into separate file. 2012-01-05 17:50:09 +00:00
53b8c63904 Superficial changes for bmesh bevel to sync with bmesh branch, also noticed length comparison can be done without sqrt for baking. 2011-11-28 03:01:06 +00:00
30fd1ab523 replace ImBuf.depth with ImBuf.planes to match ImageFormatData.planes & to avoid confusion with ImageFormatData.depth 2011-11-21 20:47:19 +00:00
96d73bfdcf replace VECCOPY with copy_v3_v3, same for 2d copy, also added vec copy functions for int & char. 2011-11-07 01:38:32 +00:00
85540d5aa7 more macro --> BLI math lib, mainly replace VECCOPY in render and blenkernel. 2011-11-06 16:38:21 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
cb6255fdf8 edits to internal renderer - no functional changes.
- move some larger vars into a nested scope.
- replace memset with zero initializer.
- rempace VECCOPY macros with copy_v3v3
- change function args to give the float array length.
2011-09-24 14:34:24 +00:00
84d06f252e tag & comment unused vars with /* UNUSED */ 2011-09-20 08:48:48 +00:00
6791052832 tidy up
- quiet some warnings
- set some functions static
- replace materialbyname with generic BLI_findstring call
2011-09-20 04:38:59 +00:00
41fa456506 replace macros with math lib functions 2011-09-16 06:56:50 +00:00
599cd56f53 minor edits / cleanup - no functional changes.
- use 'const float *' and array size in some function declarations.
- replace macros for BLI_math functions INPF, VECCOPY, VECADD etc.
- remove unused VertRen.clip struct member.
- remove static squared_dist() from 2 files, replace with BLI_math function len_squared_v3v3().
- use vertex arrays for drawing clipping background in the 3D viewport.
2011-09-11 02:50:01 +00:00
f8ec017900 floats were being promoted to doubles in quite a few cases (using gcc's -Wdouble-promotion), went over render module and use float constants, gives small but consistent speedup - approx 3%. 2011-08-20 17:39:13 +00:00
a10245a1fa fix [#28151] export OBJ don't save the extension
also correct some typos
2011-08-03 05:32:07 +00:00
b154b59938 New dilation function from Morten Mikkelsen (aka sparky).
This commit fixes very noticeable seams caused by margins
calculated incorrectly. This commit changes way margin is
calculated in and makes textures really seamless.

Also margin limited to 32 isn't good now -- artists are baking
really large textures nowadays so margin is now limited to 64px.

Thank you, Morten!
2011-07-24 10:26:22 +00:00
a83c3c0b14 The material index did not work when FSAA was turned on.
The information was written in the temp exr files, but was not read back.
After checking I saw that the pass was not merged back in the rendercore.

After adding this it worked. tested with all FSAA settings.
2011-07-06 16:08:24 +00:00
830fe8af84 Updated the indent, sorry! 2011-07-04 19:22:37 +00:00
c4491f558b Current situation
A mesh can consist out of multiple material. Take a character with clothing's. the skin can be a different material as the different clothing's. During compositing it is a common use-case to only do a part of the composit on only a specific material. Currently this can not be done.

In blender movies this feature is known to be implemented, but until now it never got integrated into trunk.
Proposal

With material index the Blender internal renderer will be capable of creating a buffer containing the material indexes of the first pixel-hit. This will be implemented in the same manner as the object index.

In the compositor the ID Mask node can be used to extract the information out of the Render pass.
Impact
User interface

On the properties-space the next changes will be done

    Scene⇒Render layer⇒Passes⇒Material index will be added
    Material⇒Options⇒Pass index will be added

DNA

    Material struct will get an new field called “index”. this will be a short-type.
    Material struct the field pad will be removed.
    A new Render-layer pass will be added (bit 1«18)

RNA

    Material RNA is updated (based on “pass index” from object)
    Render layer RNA is updated (based on IndexOB)

Blender internal renderer

The Blender internal renderer will process the render pass as a copy of the Object index.
Blender compositor

The render layer input will get a new output socket called “IndexMA”
Usage

An example on how to use material index can be found at:

https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/compositing/composite_materialindex.blend

This is also example of a commit message longer than the commit itself :)
2011-07-04 18:14:41 +00:00
692e0ebc13 fix for incorrect bake api usage. but not a bug. 2011-06-20 15:20:33 +00:00
11014defdb since render branch isnt planned to be merged now, enable strict warning flags for cmake and tag unused vars. 2011-06-20 15:17:02 +00:00