Commit Graph

250 Commits

Author SHA1 Message Date
abee8a8717 Fix #37109: missing cycles texture display in edit mode.
My previous fix for uninitialized texture coordinates was not working well,
and in fact there was a bigger issue with GLSL drawing and missing attributes
with immediate draw mode. Now it will explicitly pass zero rather than having
it use whatever value was set last.
2013-10-17 14:04:10 +00:00
ecf2eeef23 style cleanup 2013-10-16 04:08:20 +00:00
f7a3881175 3D view: textured draw mode now has a Shadeless option in the Shading panel,
to draw textures without shading. For Cycles this was not possible yet, and
for Blender Internal you had to move away all lights which was also not ideal.

(Caminandes feature request)
2013-10-15 15:56:00 +00:00
95812e1cfc Fix cycles textured draw mode problem with objects that have an image texture
but not UV coordinates, it would show a different color with the object selected
and deselected.
2013-10-14 19:37:12 +00:00
04ea8c0ee8 remove the pointer from BLI_bitmap's typedef,
hides that an arg passed is really an array which may be modified by other functions.
2013-07-22 23:20:48 +00:00
3daa153d74 code cleanup: use boolean for derived mesh face test function 2013-07-19 10:40:52 +00:00
3c4c2478b6 fix for own regression, face index ranges still need checking in some places. 2013-07-14 23:41:33 +00:00
6321f11f03 tweak to commit r57891, dont draw hidden faces/edges in editmode. 2013-07-01 01:25:21 +00:00
c729c5ab4b fix [#35911] Show weights not working with a weight edit modifier in edit mode 2013-07-01 00:42:44 +00:00
56f5951ed3 Fix #34837 Texture Painting using Face Selection Mask fails to show
texture if more than 1 texture is used

The problem here is that no flushing is done when the texface image
changes between rendered triangles. Added a compare function and
slightly modified the draw_tface_mapped__set_draw callback to compliant
with the new user data.
2013-06-26 10:14:30 +00:00
972c01ac0c remove NULL checks for return values from EDBM_***_at_index calls. 2013-06-20 07:00:57 +00:00
71d53203fa Code cleanup: fix confusing line of code with useless ||. 2013-05-14 10:20:58 +00:00
8576a275dc BGE: Fix for [#35320] "Crash When Adding Property without Setting Material" reported by Leon Cheung.
Adding an extra NULL check to draw_mesh_text() to avoid accessing a NULL material array.
2013-05-13 05:37:45 +00:00
cf96fdfc65 Optimize face-select drawing (weight/vertex paint mode face selection)
with bmesh theres no need for edge-hash lookups, replace EdgeHash with BLI_bitmap.
2013-05-12 08:42:24 +00:00
3430068654 Fix #34970: in glsl mode the vertex paint face mask is not visible
Added face selection code to GLSL draw. We do this for Cycles
already, shall behave expected now.

Checked by Ton, thanks!
2013-04-18 10:39:53 +00:00
6da961775f code cleanup: rename BKE_tessmesh -> BKE_editmesh, rename EditDerivedBMesh.tc -> em. ('tc' is odd name which isn't used elsewhere). 2013-04-13 20:31:52 +00:00
8655be437d code cleanup: use bool where values are true/false, for view3d and related functions. 2013-03-20 23:14:18 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
b0c6f87e2d Fix #34290: backface culling option in 3d view was not interacting well with the
option in the material in texture draw mode, now it always overrides the material.
2013-02-18 15:08:23 +00:00
bfb319925d dont draw stippled lines without z-depth in vertex paint mode. (only weight paint). 2013-02-13 05:48:08 +00:00
61bb1a3b50 Matcap fix:
Setting Cycles as render engine skipped matcap drawing.
Logic for checking drawing types needed a shuffle.
2013-01-22 12:36:06 +00:00
7aa9401a08 Fix #33741,#33856: multi texture drawing problem with VBO's after a recent bugfix. 2013-01-15 10:47:44 +00:00
9611202f28 Fix #33753: Not selected surface objects don't update in view if shading is changed
In fact surfaces should be displaying the same way in textures and solid shading,
but they used to change a way they're displaying by draw_textured_end not resetting
light model properly, leaving two-sided shading for all further objects draw.
2013-01-05 08:24:22 +00:00
e4f65749f9 remove vertex selection check for weight paint mode so you can paint through the mesh.
also made the wire draw without depth masking when the depth check is off, similar to mesh editmode drawing, nice hint about whats going on.
2013-01-01 11:47:47 +00:00
cb70c5ba0f fix for bug where weight paint would draw hidden faces but not draw then with the backbuffer (depth selection). 2012-12-23 08:20:44 +00:00
1d9271cdd7 Fix #33599: VBO textured draw mode did not update correctly when an image filepath
was changed to an invalid one. Also fixed Object Color not being displayed correctly
with VBO's.

The way it has to clear the VBO buffers here is quite poor though and slow, we
really need textures and materials in the depsgraph to do this quicker.
2012-12-18 12:42:13 +00:00
9784f3d466 Fix #33292: cycles material draw mode selection not working on some cards, now
skip glsl for picking as was already done for other GLSL drawing.
2012-11-26 08:00:15 +00:00
5c6f6301b0 Image thread safe improvements
This commit makes BKE_image_acquire_ibuf referencing result, which means once
some area requested for image buffer, it'll be guaranteed this buffer wouldn't
be freed by image signal.

To de-reference buffer BKE_image_release_ibuf should now always be used.

To make referencing working correct we can not rely on result of
image_get_ibuf_threadsafe called outside from thread lock. This is so because
we need to guarantee getting image buffer from list of loaded buffers and it's
referencing happens atomic. Without lock here it is possible that between call
of image_get_ibuf_threadsafe and referencing the buffer IMA_SIGNAL_FREE would
be called. Image signal handling too is blocking now to prevent such a
situation.

Threads are locking by spinlock, which are faster than mutexes. There were some
slowdown reports in the past about render slowdown when using OSX on Xeon CPU.
It shouldn't happen with spin locks, but more tests on different hardware would
be really welcome. So far can not see speed regressions on own computers.

This commit also removes BKE_image_get_ibuf, because it was not so intuitive
when get_ibuf and acquire_ibuf should be used.

Thanks to Ton and Brecht for discussion/review :)
2012-11-15 15:59:58 +00:00
b32bf2c462 code cleanup: use min_/max_ math functions, add minmax_v2_v2v2. 2012-10-25 22:47:54 +00:00
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
1d7bf727ff Fix #32695: Can't disable color management for 3D view
Made it so viewport will disable color management if display device set to None.

This solves couple of regressions, mainly related on old BGE files and made
None display behave exactly as old color management disabled.
2012-10-01 11:14:02 +00:00
946c9580b5 fix buffer overrun when 5+ sided faces were used for text drawing. 2012-09-19 02:06:27 +00:00
d3737de8c2 fix for a strange linking error where set_property() in source/blender/blenkernel/intern/property.c would get mixed up with an X11 function of the same name. it crashed blender loading on my system.
Give functions in property.c more unique names.
2012-09-18 04:35:30 +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
77ed2d8ca9 code cleanup: remove paranoid NULL checks (these cases would crash earlier of the vars were in fact NULL) 2012-09-15 06:29:32 +00:00
e75f5c8208 quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
2012-09-15 01:52:28 +00:00
a4b71f4e01 fix for various redundant checks and possibly fix some crashes in rare situations. 2012-09-05 01:42:52 +00:00
a71b160184 fix for building on msvc2008 (also style cleanup) 2012-09-04 01:23:50 +00:00
b25ca62f20 Fix #32404: GLSL normal maps using float images were incorrectly getting
color managed.
2012-08-30 17:42:04 +00:00
8b941a80c9 patch [#32325] textured solid backface culling option
from Fredrik Hansson (fredrikh)
2012-08-14 18:01:58 +00:00
152675db1a Fix #31988: VBOs Textured solid : no update of material in 3Dview
Issue was caused by VBOs using CD_TEXTURE_MCOL for faces colors. This
layer was creating on mesh display (from draw_tface_mapped__set_draw)
in cases there's no such a layer.

If material settings are changing, this layer wasn't updated and old
colors were used.

Fixed by performing an update of this layer in cases it's already
exists. This would give some % of slowdown, but don't think it'll
be dramatically bad.

Would be nice to find a nice way to update such a layer in cases
material is actually changes only, or get completely rid of it/
2012-07-12 16:08:22 +00:00
c86d31cc55 Fix #32050: UV map and game engine property cause crash 2012-07-12 09:56:18 +00:00
0361909ab4 style cleanup 2012-07-08 20:36:00 +00:00
bc961c90a2 fix for armature specular material color overriding the wire color when instanced in a dupli 2012-06-07 09:04: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
caba2601ea fix for fix, own fix for [#31368] didnt work right, now move shadeless & wire paint drawing into draw_mesh_paint(). 2012-05-10 06:32:24 +00:00
80a766cbd0 style cleanup: view3d 2012-05-08 15:55:29 +00:00
299ff91ea1 code cleanup: BKE_scene api naming.
also stop numpy from being found in /usr/include with cmake.
2012-05-05 14:33:36 +00:00