Commit Graph

94 Commits

Author SHA1 Message Date
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
3c1b5b5632 stule cleanup: edits for files which were recently cleaned up. 2012-04-02 22:26:00 +00:00
0740e9e464 fix [#30643] Crasher on entering edit mode with VBOs enabled 2012-03-30 06:11:59 +00:00
81d8f17843 style cleanup: pep8, indentation 2012-03-24 07:36:32 +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
9751653410 Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this layer is now also used for various preview tasks in Object mode.
“Cleanup” commit, no functional changes.
2012-03-22 08:41:50 +00:00
52418868eb Fix for size of VBO index type when drawing multires in sculpt mode.
The VBO index type can be either ushort or uint depending on the grid
size. The comparison was checking how many quads are in the array, but
this was incorrect; the size of the index elements should depend on
the maximum value they reference, i.e. the maximum coord/normal
element.
2012-03-16 23:21:40 +00:00
815beed922 Fix for multires VBO drawing in sculpt mode.
Forgot to use return value of function creating the index buffer.
2012-03-16 04:11:35 +00:00
4d3f11c66f Fix some errors in partial visibility drawing.
Also changed show-in-border key to SHIFT+H as suggested by Daniel
Salazar.
2012-03-14 07:37:47 +00:00
68b8f3b0a8 Skip hidden elements in PBVH iterator, raycast, and drawing. 2012-03-14 06:32:25 +00:00
0641f1723b Optimize index buffers for multires drawing in sculpt mode.
All multires grids have exactly the same ordering, so rather than
allocate a new index buffer for each PBVH node, just allocate one that
can be reused for every grid.

This requires more draw calls (one per grid rather than one per PBVH
node), but less graphics memory.
2012-03-09 09:30:03 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
71e5edeb6a Code cleanup: use typedefs for DerivedMesh drawing callbacks.
There are still fairly bewildering set of callbacks being tossed
around, but it's at least a little less verbose now.
2012-03-07 04:41:14 +00:00
c7ffe7f621 Draw individual face's material and shading correctly in the PBVH.
Previously, the shading and material was set once per PBVHNode when
drawing. This is still the case, but PBVHNodes are now built to
contain only one material and shading mode.

This is done with an extra partitioning step; once the number of
primitives in the node falls below the PBVH leaf limit, it's
primitives are checked for matching materials. If more than one
material or shading mode is present in the node, it is split and
partitioned (partitioned by material rather than 3D location.)

Given a sufficiently 'annoying' input, like a dense mesh with
thousands of materials randomly scattered across it, this could
greatly increase PBVH build time (since nodes might end up containing
a single primitive), but in general this shouldn't come up.

In order to support materials for grids, the CCGDM is building another
grid array (of DMFaceMat structs). This could be used to replace
CCGDM.faceFlag for some small memory savings (TODO).
2012-03-06 02:40:08 +00:00
e2003f9a6c Code cleanup: remove unused drawFacesColored from DerivedMesh.
This function pointer isn't called anymore, so removing it and the
cddm/ccgdm/gpu code associated with it.
2012-03-05 21:27:28 +00:00
87ddcab933 Bugfix: avoid reading from an OpenGL buffer mapped write-only.
When set to solid-shading, GPU_update_grid_buffers was calling
normal_quad_v3 to output into a mapped buffer, but normal_quad_v3
reads as well as writes.

This fix actually makes a huge performance difference with my drivers
(Gallium/Radeon).
2012-02-28 05:00:28 +00:00
3dd449ae4f Bugfix: don't read from a write-only VBO when updating grid buffers. 2012-02-23 10:35:23 +00:00
5e12c7feca Code cleanup: de-duplicate code in GPU_build_grid_buffers() with a macro. 2012-02-22 23:30:56 +00:00
fd87bf3ef6 Code cleanup: don't use GHash for GPU_build_mesh_buffers().
At the point where GPU_build_mesh_buffers is called, the
face_vert_indices map has already been built; it contains the same
data in an easier-to-access format.
2012-02-22 22:48:34 +00:00
88a2be1846 Another fix for non-VBO flat-shading in sculpt mode, this time for non-multires meshes.
As with multires, this change calculates face normals rather than
using vertex normals when the node is flat-shaded.

Flat-shading with VBO on non-multires meshes is still wrong, but
fixing that would require larger changes to our vertex buffers.
2012-02-21 04:24:30 +00:00
a6dc47b0ca Remove call to GPU_update_mesh_buffers from GPU_build_mesh_buffers.
Building the mesh buffers already gets the PBVH_UpdateDrawBuffers flag
set, so this was double-updating the vertex buffer.
2012-02-21 04:16:27 +00:00
d31e1533a3 Fix normals for flat-shaded non-VBO sculpt drawing.
Example here, original on left, fixed normals on right:
http://www.pasteall.org/pic/show.php?id=26925
2012-02-20 21:25:24 +00:00
c0eec8f379 svn merge ^/trunk/blender -r43062:43085 2012-01-03 02:16:52 +00:00
0eb8a384c9 Remove some silly variable copies that stuck around from a previous refactor. 2012-01-02 19:01:16 +00:00
8ccf5026e0 more changes from bmesh into trunk (mesh mpoly strict member) 2011-12-28 14:21:51 +00:00
bc9b593909 More DM func renames, fixing some build breaks, renaming more stuff, also seems like it might be fixing the recent CDDM_copy corruption/leak bug 2011-11-30 18:03:56 +00:00
faa022563d svn merge ^/trunk/blender -r42245:42261 2011-11-29 18:18:56 +00:00
f62ad8f69b remove header text:
"The Blender Foundation also sells licenses for use in proprietary software under the Blender Licens"

also remove NaN references from files that have been added since blender went opensource.
2011-11-29 10:54:47 +00:00
2d71eab5aa fix [#29256] Import images as planes add on doesn't work correctly in bmesh 2011-11-24 22:40:43 +00:00
e59ab6486f svn merge -r41751:41779 ^/trunk/blender 2011-11-15 02:05:32 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
b0a21add8a replace bmesh specific macros with math functions, also some pedantic formatting edits. 2011-11-07 09:02:10 +00:00
e936c78251 svn merge ^/trunk/blender -r41503:41575 2011-11-06 10:38:44 +00:00
a71e2c498c GPU Buffers
Small type cleanup, use `GPU_Buffers *' rather than `void *'. Should
be no functional changes.
2011-11-05 03:29:37 +00:00
15e6d6cd75 svn merge ^/trunk/blender -r41226:41227 . 2011-10-24 12:43:08 +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
4a157de23d svn merge ^/trunk/blender -r40587:40643 2011-09-28 07:34:48 +00:00
018fa1540e whitespace edits, make formatting for functions consustent at least within the file. 2011-09-28 05:53:40 +00:00
effea8c29b svn merge ^/trunk/blender -r40511:40587 2011-09-27 03:12:31 +00:00
274b9c8fb8 whitespace cleanup 2011-09-25 12:31:21 +00:00
1ff373ef5b svn merge -r40166:40279 ^/trunk/blender 2011-09-17 04:59:14 +00:00
2222f536f8 use replace 0 with NULL for pointers, set some functions static
also fixed own errors in recent static check commit.
2011-09-16 08:20:21 +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
6199276053 svn merge -r37800:37900 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-07-25 14:54:29 +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
cf90b9497f VBO:
Fix for bug found by psy-fi.

* gpu_buffers.c was using GL_ARB_vertex_buffer_object to check for VBO
  support, should be using GLEW_ARB_vertex_buffer_object.
2011-06-28 00:40:39 +00:00
c98148a963 =bmesh= merge from trunk at r36153 2011-04-15 01:19:13 +00:00
Nathan Letwory
93b144548d doxygen: blender/gpu tagged. 2011-02-27 20:25:53 +00:00
f01261d040 merge with/from trunk at r35190 2011-02-27 06:19:40 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00