Commit Graph

265 Commits

Author SHA1 Message Date
a7de5fc191 Code cleanup: small glsl mesh drawing code changes, getting rid of an ugly macro. 2011-08-12 18:17:28 +00:00
cbb2e58b68 fix mirror when have dup faces; prevent eekadoodle on tess recalculation 2011-08-08 17:30:19 +00:00
daea8a28ae Merge with trunk r39000 2011-08-03 18:47:20 +00:00
73dde4e26f svn merge -r38718:38804 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-07-29 02:03:53 +00:00
3b6cb504b1 minor warning fixes for clang-static-checker 2011-07-27 13:03:56 +00:00
794f3291fe svn merge -r38200:38300 https://svn.blender.org/svnroot/bf-blender/trunk/blender, source/blender/gpu/intern/gpu_buffers.c updated from trunk and re-made edits to use getTessFace* functions. 2011-07-26 03:00:55 +00:00
4b80e1aba2 Merge with trunk r38281 2011-07-10 16:18:48 +00:00
abdf420a6d == GPU Buffers ==
This patch attempts to clean up and document the GPU buffers
code. There are a few bug fixes as well.

Patch reviewed here: http://codereview.appspot.com/4631052/

Summary:

* Bugfix: make GPU_buffer_copy_normal convert from shorts to floats
  correctly, also fixed the use of cached face normal CustomData.

* Bugfix: changed the `mat_nr' field of GPUBufferMaterial from char to
  short.

* Changed color buffer setup to not alloc a temporary copy of color
  data, just passes the MCol data in directly.

* Changed the GPU buffer pool code to make clearer what operates
  specifically on the global pool.

* Lots of refactoring for GPU_drawobject_new; should operate mostly
  the same (except got rid of one unecessary allocation), just split
  into more functions and without macros now.

* Converted some #defines into enumerations.

* Made some stuff private, pulled out of header file.

* Deleted unused function GPU_buffer_pool_free_unused().

* Removed GPU_interleaved_setup and related #defines. (I think this
  was used for editmode VBOs, but those were disabled.)

* Added lots of comments.

* Added a few comments in the code signed `--nicholas' to note places
  where I am unsure about design or usage, would be good to address
  these better.

* Code formatting changed to be more consistent with the rest of
  Blender.

* Renamed some fields and variables to be more consistent with
  Blender's naming conventions.

* Renamed some fields and variables to use more descriptive names,
  e.g. renamed `redir' to `mat_orig_to_new'.

* Removed print outs with DEBUG_VBO -- don't feel too strongly about
  this one, just not used elsewhere in Blender, could be easily added
  back if others disagree though.

* Moved the PBVH drawing code down to the bottom of the file, before
  was sitting in the middle of the other VBO code
2011-07-08 19:58:02 +00:00
3de22dec26 Dynamic Paint:
Committed changes from previous weeks, biggest changes are:
* Canvas can now have multiple "surfaces" that each can have specific format, type and settings.
* Renewed UI to support this new system.
* Aside from old "image sequence" output format, Dynamic Paint can now work on vertex level as well. Currently vertex paint and displace are supported.
* Integrated vertex level painting with Point Cache.
* Added viewport preview for Point Cache surfaces.

Due to massive amount of changes, old Dynamic Paint saves are no longer supported. Also some features are temporarily missing or may not work properly.
2011-06-16 10:41:00 +00:00
73a545b0d5 =bmesh=
Removed the DerivedMesh face iterators (they sucked).
This should make subsurf faster.  Also sped up multires
a bit (not sure if it's strictly correct, need to look
at it later).
2011-06-14 03:16:08 +00:00
e40debc51b =bmesh= removed extraneous debug printf 2011-06-05 01:00:36 +00:00
62a33391c9 add missing cast 2011-06-01 23:46:48 +00:00
142d87f154 =bmesh= committing not-quite-functional edge split modifier code before replacing it with a bmesh version, taking too much time to debug right now. 2011-06-01 19:30:19 +00:00
1d8fa52883 rename BMINDEX_GET/SET to BM_GetIndex/BM_SetIndex 2011-05-13 10:49:26 +00:00
cd55aeaf6d set many vars & functions as static,
also commented invalid pin theme alpha assignment so bmesh branch builds with -Werror
2011-05-11 02:14:43 +00:00
5ba0c2c049 tag unused arguments, quiet some warnings 2011-05-09 14:32:55 +00:00
6ef77cf95a =bmesh= merge from trunk at r36529 2011-05-08 23:43:18 +00:00
d000103e80 Own TODO item: sculpting on constructive modifiers
- Constructive modifiers are enabled by default in sculpt mode.
- There's option to disable all constructive modifiers in the "Options"
  panel of toolbox in sculpt mode,
- Use one column in options panel to make strings easier to read
- No modifiers would still be applied on multires
2011-05-04 13:15:42 +00:00
b9076b87d2 pass colors to glColor as vectors where possible. 2011-05-04 12:00:11 +00:00
6e35c08356 comment regarding bug [#27175] UV faces show incorrect image in object mode (VBO's) 2011-04-27 05:12:07 +00:00
ee2ddfc58a remove normalize call in derived mesh GetNormal, its not done anywhere else. 2011-04-27 04:57:57 +00:00
8fdebf24f4 harmless changes to quiet clang static check warnings.
- made EXPANDED_AGRP take bAnimContext as an argument.
- remove unneeded NULL check drawFacesColored functions.
- comment some vars which are set but not used.
2011-04-24 10:51:45 +00:00
ef14d310a0 Sculpting on shapekeys
======================

All this work with sculpting on armatured/deformed mesh allowed to
implement sculpting on non-locked keys very easy -- just use the same
approach of propagating offsets from deformed PBVH to "sculpting layer".

- If key is locked, then old logic would be used.
- If there's multires modifier enabled, sculpting would happen on multires.
2011-04-23 09:07:46 +00:00
133a1c2699 =bmesh= fixed edge split modifier, and a bug in knifetool reported by letterrip. also brought back beautify-fill. 2011-04-22 23:37:58 +00:00
798e0b02c0 =bmesh= modifiers can now be applied with shapekeys 2011-04-15 05:20:18 +00:00
c98148a963 =bmesh= merge from trunk at r36153 2011-04-15 01:19:13 +00:00
7d43a48993 =bmesh=
Multires interpolation is considerably better
now, though it still has a problem with occasionally
producing little random tangent spikes.  Still, it's
far better then it was.

Also fixed a bug in dissolve faces.
2011-03-29 05:48:18 +00:00
ac1cb5ee05 - quiet new warnings with gcc 4.6
- use BLI math funcs for normal float/short conversion.
- correct some un-intentional float/double promotions.
2011-03-28 02:34:55 +00:00
fc050837b0 =bmesh= fixed edge creasing for subsurf 2011-03-27 03:29:27 +00:00
63e40dbe0e Fix #26582, #26586, #26613: recent normal calculation changes didn't take
into account that some tools use normals for things other than display. Now
we properly initialize vertex normals at flat faces too.

Also fixed a normal refresh issue, and deduplicated CDDM/mesh normal
calculation code.
2011-03-26 08:28:24 +00:00
d88bb9115f =bmesh=
Coded a new modifier, "Precision UV Interpolation", 
that triangulates, subdivides, then uses brecht's mean
value interpolation to interpolate face data.

Textures on ngon faces get interpolated a bit nicer, in 
other words (though concave cases, e.g. 'N', don't work very well).
2011-03-25 00:32:38 +00:00
549b5e1222 Fix/change in normal computation, now the viewport uses the same angle
weighted normals as the render engine, and the render engine will copy
normals from the mesh rather than always recalculating them.

Subsurf/multires still use regular vertex normals, but they are expected
to be sufficiently high resolution to not need this.

This means that normal maps displayed in the viewport actually match the
render engine exactly and don't have artifacts due to this discrepancy.
It of course also avoids unexpected surprises where your render normals
look different than your viewport normals.

Subversion bumped to 4 for version patch to recalculate normals.

Patch by Morten Mikkelsen, with some small changes.
2011-03-20 13:35:35 +00:00
7ccc17b98c =bmesh= fixed bunches of modifier stack bugs 2011-03-19 21:33:33 +00:00
a147a91899 =bmesh=
Fixed view selected code.  Made MDisps->disps use the
special allocation library I wrote as a
temporary fix to MDeformGroup->dw problems.

Why was the vgroup solution reused?  It's really slow,
and its hard to tie in something like mempool or memarena.
The hackish allocator I wrote really needs to go, eventually,
or be folded into guardedalloc.

Also fixed a customdata bug with modifiers.
2011-03-03 07:10:42 +00:00
Nathan Letwory
0ff06e21cd doxygen: blender/blenkernel tagged. 2011-02-27 20:40:57 +00:00
065a7f4e2f =bmesh=
Mirror modifier no longer uses bmesh, but is now
100% CDDM.  This is faster; the sluggishness was
driving me crazy.  Still need to deal with UVs,
but that shouldn't be hard.
2011-02-27 07:49:36 +00:00
f01261d040 merge with/from trunk at r35190 2011-02-27 06:19:40 +00:00
c128a8c12a =bmesh= fix bug with uvlayers 2011-02-23 08:12:27 +00:00
1c0cf60377 =bmesh=
Fixed join meshes, and an annoying modifier bug (making modifiers
not work in editmode).  Also fixed a tesselation bug.

Also got edge slide to work right, yay!  Dunno why I couldn't get
it working right before; took me twenty minutes to fix.
2011-02-23 00:01:50 +00:00
8b4eab10f1 pre-merge commit 2011-02-15 01:16:32 +00:00
20553d4064 This commit will switch blender to use tangent space generated within
the two files mikktspace.h and mikktspace.c. These are standalone files
which can be redistributed into any other application and regenerate the
same tangent spaces. The implementation is independent of the ordering
of faces and the vertex ordering of faces.
2011-02-14 18:18:46 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
bd023c443b remove mat_nr from MVert struct, saves 4 bytes per vertex.
used to be used for halo's
2011-02-07 13:02:44 +00:00
329e2d8037 Todo issue: sculpting on deformed mesh
Used a crazyspace approach (like in edit mode), but only modifiers with
deformMatricies are allowed atm (currently shapekeys and armature modifiers only).
All the rest modifiers had an warning message that they aren't applied because
of sculpt mode. Deformation of multires is also unsupported.

With all this restictions users will always see the actual "layer" (or maybe
mesh state would be more correct word) they are sculpting on.

Internal changes:
- All modifiers could have deformMatricies callback (the same as deformMatriciesEM but
  for non-edit mode usage)
- Added function to build crazyspace for sculpting (sculpt_get_deform_matrices), but it
  could be generalized for usage in other painting modes (particle edit mode, i.e)

Todo:
- Implement crazyspace correction to support all kinds of deformation modifiers
- Maybe deformation of multires isn't so difficult?
- And maybe we could avoid extra bad-level-stub for ED_sculpt_modifiers_changed
  without code duplicating?
2011-01-31 20:02:51 +00:00
eac31a2ece remove unused vars & avoid some clang warnings. 2011-01-14 21:06:28 +00:00
d3d5fe42bf fixed a case with occlusion where uninitialized variable could be used.
also removed unused vars.

can_pbvh_draw() had a NULL check which is never needed (callers check for this), a NULL ob would have crashed the function anyway.
2011-01-08 10:23:36 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
64c3ea272e Todo item: linked curve objects behaves incorrect with modifiers
Use object's displists for storing deformed tesselated curve. Was unable to
totally get rid of curve's displist because of how texture space is calculating.
2011-01-05 10:40:38 +00:00
31eadb358d Fix for IRC reported bug from lmg:
VBO enabled, GLSL shading and bevel modifier leads to crash when entering edit mode

Bevel modifier doe not support remapping still, so added check about original index
in cdDM_drawFacesTex_common. Now it works like VBO-less drawing for that special case.
2010-12-26 13:01:02 +00:00