Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-06-02Fix T47637: Multiple multires objects in Sculpt mode make blender crash.Bastien Montagne
That was a nice and funny hunt, albeit rather time consumming! To summarize, so far code was using a static global gpu_buffer for pbvh vbo drawing of 'grid' types (multires mostly?). There were two issues here: 1) Global gpu buffer was assigned to GPU_PBVH_Buffers->index_buf, but then nearly no check was done when freeing that buffer, to ensure we were not freeing the global one (not totally sure this one was actually causing any issue, but was bad and unsafe anyway). Was solved by adding a flag to GPU_PBVH_Buffers to indicate when we are using some 'common' buffer here, which freeing is handled separately. 2) Main issue: if several multires objects in sculpt mode with different grid size were present simultaneously, the global gpu buffer had to be resized for each object draw (i.e., freed and re-allocated), but then the pbvh nodes from other objects storing freed reference to that global buffer had no way to know that it had been freed, which was causing the segfault & crash. Was solved by getting rid of that global buffer, and instead allocating one 'grid_commmon_gpu_buffer' per pbvh. Told ya baby, globals are *PURE EVIL*!
2016-05-31Properly handle vertex color color space for Cycles GLSLSergey Sharybin
A bit tricky, need to pass additional information about what the attribute is and how to deal with it. BI path stays unchanged, just to make things simplier for now. Fixes T48555: Cycles GLSL- Incorrect Vertex Color results from Attribute node
2015-11-26cleanup: C99 and vertex array commentsMike Erwin
GPU_buffer no longer has a fallback to client vertex arrays, so remove comments about it. Changed a few internal structs/function interfaces to use bool where appropriate. Use for-loop scope and flexible declaration placement. PBVH does the same thing but needs ~150 fewer lines to do it! The change to BLI_ghashIterator_init is admittedly hackish but makes GHASH_ITER_INDEX nicer to use.
2015-11-22Remove vertex array support from GPUBuffers. Remove USER_DISABLE_VBO. AllAntony Riakiotakis
GPUBuffer rendering is now done using vertex buffers. Vertex arrays are completely removed from GL 3.2 core profile, so we'll have to do this change at some point anyway. This commit, though big, is not modifying blender in any way. Use should be exactly as if the vetex buffer option is constantly on.
2015-07-25Convert CCGSubsurf VBO system to also sort hidden and visible faces.Antony Riakiotakis
It's not actually used during drawing though.
2015-07-25GPU Buffers:Antony Riakiotakis
This commit begins implementation of the idea about hidden face separation outlined in http://code.blender.org/2015/06/optimizing-blenders-real-time-mesh- We split hidden and visible faces to different parts of the triangle buffer. Mapped drawing will now skip iterating through hidden polys. Of course the final target, when all derived mesh types use VBO sorting, is to skip checking for hide flag per face completely. All faces will be pre-sorted anyway and we'll be able to draw them with one draw call.
2015-07-25GPU buffer materials:Antony Riakiotakis
Separate and reuse some shared code. Also avoid counting for information we already know, such as total loop triangles etc.
2015-07-23Subsurf: Optimize edge drawing, now it uses VBOs.Antony Riakiotakis
Also the refactor exposed an error where we requested too much memory from the video memory in general for all mesh types. Now we are back to normal :)
2015-07-20Use abstraction to unbind buffers, should avoid crashes in systems thatAntony Riakiotakis
don't support VBOs. Exposed by initialization error in GLEW, which should be fixed seperately.
2015-07-17Fix no longer being possible to display a suzanne with 8 levels ofAntony Riakiotakis
subdivision. Classic integet overflow/size_t substitution case. Machines are getting powerful enough to easily expose these kinds of error now.
2015-07-16Add tessellation data to DerivedMesh (LoopTri)Campbell Barton
This stores loop indices into the loop array giving easier acess to data such as vertex-colors and UV's, removing the need to store an MFace duplicate of custom-data. This doesn't yet move all internal code from MFace to LoopTri just yet. Only applies to: - opengl drawing - sculpting (pbvh) - vertex/weight paint Thanks to @psy-fi for review, fixes and improvements to drawing!
2015-07-16Sculpt draw code:Antony Riakiotakis
Remove legacy code completely, now dyntopo, multires et al even work on GL 1.1 for really hardcore users :p Real purpose here though is to be able to have fast multires drawing even with VBO off, since it requires using indices for vertex buffers. Also made own code elf puke an eaten normal update function which made multires not update normals in solid mode...sorry.
2015-07-15 VBO offscreen selection drawing, cdderivedmeshAntony Riakiotakis
Get rid of legacy drawing, it's only used for selection, in which case we can prepare a temporary color buffer and draw at once. Code is not complete here because we still redundantly set the draw color in the draw function and don't ommit hidden faces automatically. Still it works 100% without immediate mode now.
2015-07-15DerivedMesh: minor changes to callback useCampbell Barton
- use void instead of float for array arg (cast in the switch statement) - remove unused args - use const for poly-mapping and user_data args
2015-07-14Display optimizations part 1.Antony Riakiotakis
This patch changes the way we draw meshes by introducing indexed drawing. This makes it possible to easily upload and rearrange faces ad lib according to any criteria. Currently we use material sorting but textured sorting and hiding will be added to optimize textured drawing and skip per face testing. It also adds support for vertex buffers for subsurf modifiers (Except from GLSL drawing), making drawing of subsurf much faster without need for bogus modifiers. Tests show that we gain approximately 20-25% performance by that for solid mode drawing with up to 50% gains for material drawing. Textured drawing should also have a small performance gain, but more substantial optimizations are possible there. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D1406
2015-07-10Cleanup: use const for gpu bufferCampbell Barton
2015-06-16Optimize drawing of outlines as wellAntony Riakiotakis
2015-06-16Drawing speedup:Antony Riakiotakis
We really don't need to iterate all edges of the mesh every frame to search for loose edges, this calculation can be cached when filling the edge index buffer.
2015-03-28Cleanup: redundant struct declarationsCampbell Barton
2015-03-23cleanup: use spaces for alignmentMike Erwin
while studying GPU lib
2014-11-28Cleanup GPU: get rid of some extremely legacy draw code.Antony Riakiotakis
Basically this commit gets rid of most of the derived mesh immediate mode drawing (cases such as subsurf excluded). Even when VBO is turned off in user preferences, we still use vertex arrays, which are very similar to VBOs but memory is client side. Vertex arrays are OpenGL 1.1 so compatibility is not an issue here. Reviewers: campbellbarton, sergey, jwilkins Differential Revision: https://developer.blender.org/D919
2014-08-27Cleanup: remove _DEBUG define usageCampbell Barton
2014-07-21GSOC 2013 paintAntony Riakiotakis
Yep, at last it's here! There are a few minor issues remaining but development can go on in master after discussion at blender institute. For full list of features see: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting Thanks to Sergey and Campbell for the extensive review and to the countless artists that have given their input and reported issues during development.
2014-05-05Attempt to solve T39950,Antony Riakiotakis
Avoid filling up buffers when total buffer triangles are zero. Better still would be to tag a node as hidden when doing recreation of the PBVH tree by checking for any visible elements. Original bug report probably has to do with OpenGL doing something funky but hidden nodes should be tagged as hidden to completely avoid iterating for painting. This is to be done in a later commit. Also some naming cleanup for consistency, GPU_build_pbvh_mesh_buffers to GPU_build_mesh_pbvh_buffers.
2014-05-01Add PBVH debug display, where we can see the PBVH node bounding boxes.Antony Riakiotakis
To enable enter debug value 14. Leaf nodes are green while container nodes are red.
2014-04-17Code cleanup: use boolsCampbell Barton
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-04-09Code cleanup: ifdef unused linklist for GPU drawobject'sCampbell Barton
2014-04-08Dyntopo: replace GHash with GSet, saves some memoryCampbell Barton
2014-04-03Fix T39517,Antony Riakiotakis
Issue here is that "show diffuse" option does not respect its intended purpose which is to be used only for masking. There are a couple of caveats here: Dyntopo and multires -always- have mask data enabled, and thus as soon as one goes to dyntopo mode or adds a multires modifier he would get the default grey color instead. Matcaps would break when nodes asked for a diffuse material color (this was broken before too). Solved by adding global material state for when matcaps are enabled. Also matcaps don't always played well with VBOs off. Added a few more missing updates for mask operators to notify show_diffuse property as changed. This was also needed on rebuilding dyntopo pbvh. Also make zero mask color duller again after artist feedback.
2014-04-02Fix T39520, show diffuse not working in dyntopo.Antony Riakiotakis
Was marked as a todo in the code. This does not yet take care of correct display for multi material meshes, since it would need correct separation of faces during pbvh creation. Instead we just take material of first face in node and assume that the rest faces have the same. This will create some funky effects if one attempts to sculpt in this way. Note: This does not yet address T39517
2014-04-01Code cleanup: use bool instead of intSergey Sharybin
2014-04-01Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT defineCampbell Barton
2014-01-03Code clean-up change naming of gpu buffers used by pbvh to betterAntony Riakiotakis
reflect that. Previous name GPU_Buffers was very similar to GPU_Buffer, renamed to GPU_PBVH_Buffers
2013-08-26replace hashes with sets where possible.Campbell Barton
2013-08-09OpenGL VBO's: free VBO pool before redraw, otherwise this just holds onto memoryBrecht Van Lommel
after objects are deleted until another big object is added. There's no good reason to do this, or to think that our pool is somehow much faster than using the OpenGL API to allocate and free buffers.
2012-12-30Use GPU_Buffers to draw wireframe when in dynamic-topology sculpt modeNicholas Bishop
This adds an override to the CDDM edge drawing function that switches to GPU_Buffers drawing for PBVHes of type PBVH_BMESH. Within the GPU_Buffers code, glPolygonMode() is used to draw lines instead of faces.
2012-12-30Add GPU_buffers support for drawing dynamic topology nodesNicholas Bishop
The GPU interface for PBVH drawing gets a new pair of build/update buffers functions for drawing BMFaces and BMVerts. TODO: the diffuse color is hardcoded to 0.8 gray rather than using material color. TODO: only VBO drawing is implemented, no immediate mode.
2012-10-30Fix for own r51737.Bastien Montagne
Refactoring of draw code showed another problem: The MCol we want to draw may change without dm rebuild (e.g. when enabling solid textured option)! Also, choosing which MCol layer to use in GPU code is stupid, different draw modes use different layers/order of precedence! Solved this by adding a new colType parameter to GPU_color_setup, and removing any 'color choosing' code from gpu_buffers.c.
2012-10-29Complete fix for [#33002] Wrong vertex color.Bastien Montagne
Appart from the color glitch, there was several problems with vpaint: * "fast_update" mode was never on, because of wrong testing code; * drawing refresh during stroke in "fast_update" (i.e. no dm rebuild) mode was broken in VBO mode, because updated (tess data) mcol wasn't moved to colors GPUBuffer. Solved the later point by adding a new DM_DIRTY_MCOL_UPDATE_DRAW flag to DerivedMesh dirty var, which is set each time vpaint stroke directly update me->mcol, and forces GPU_color_setup() to refresh the gpu's colors buffer. Also got rid of the uggly GPU_color3_upload(), which basically did the same thing, but with an additional intermediate buffer !
2012-10-22Fix #32522: Object's diffuse color not showing in Sculpt ModeSergey Sharybin
Added option to display object's diffuse color multiplied by sculpting mask. This option could be found in Options panel of toolshelf when in sculpting mode. Thanks to Nicholas and Brecht for reviewing the patch!
2012-09-30Revert changes made to support diffuse color when sculptingSergey Sharybin
This changes are not stable enough and trying fix it could backfire in some other regressions which isn't wanted so much close to the release. This means objects will have gray color as diffuse which becomes darker in masked areas for 2.64. Proper fix is aimed for 2.65. This commit reverts 50827 and 50898.
2012-09-23Fix #32522: Object's diffuse color not showing in Sculpt ModeSergey Sharybin
It was missing since sculpting mask implementation. Now object's color would be multiplied by sculpt mask value. For VBOs it's done by storing final color in VertexBufferFormat and mimic behavior of setMaterial callback for getting current diffuse color. For non-VBOs diffuse color is getting from current OpenGL context.
2012-09-04fix for building on msvc2008 (also style cleanup)Campbell Barton
2012-05-11Add mask-drawing support to GPU_Buffers.Nicholas Bishop
This is the last commit of the sculpt masking merge. Documentation: http://wiki.blender.org/index.php/User:Nicholasbishop/PaintMasks Thanks to Brecht for reviewing! * For VBO, add color to the VertexBufferFormat structure as three unsigned bytes. Since mask elements are scalar the three color components are identical to eachother, but the fixed-function OpenGL pipeline requires colors to be either three or four components. * For the same reason, multires VBO drawing now copies into the VertexBufferFormat format as well. * Regression: material colors will not show up correctly now, masks colors are overriding. Not sure how to fix this nicely (would be much easier to fix if drawing with vertex shaders.) * Also, masks will only draw PBVH drawing, so only 'solid' drawing will work correctly with masks.
2012-05-11Replace hardcoded DMGridData structure with CCGElem/CCGKey.Nicholas Bishop
* Changes to DerivedMesh interface: DMGridData has been removed, getGridData() now returns an array of CCGElem pointers. Also added getGridKey() to initialize a CCGKey (implemented only by CCGDerivedMesh.) * PBVH: added BLI_pbvh_get_grid_key(). * A lot of code is affected, but mainly is just replacing DMGridData.co, DMGridData.no, and sizeof(DMGridData) with the CCG_*_elem functions, removing the reliance on grid elements of exactly six floats.
2012-03-14Skip hidden elements in PBVH iterator, raycast, and drawing.Nicholas Bishop
2012-03-11style cleanup, also remove unused externs.Campbell Barton
2012-03-09style cleanup: comment blocksCampbell Barton
2012-03-07Code cleanup: use typedefs for DerivedMesh drawing callbacks.Nicholas Bishop
There are still fairly bewildering set of callbacks being tossed around, but it's at least a little less verbose now.
2012-03-06Draw individual face's material and shading correctly in the PBVH.Nicholas Bishop
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).