Age | Commit message (Collapse) | Author |
|
|
|
- FTOCHAR -> unit_float_to_uchar_clamp
- F3TOCHAR3 -> unit_float_to_uchar_clamp_v3 (swap args)
- F4TOCHAR4 -> unit_float_to_uchar_clamp_v4 (swap args)
- FTOUSHORT -> unit_float_to_ushort_clamp
- USHORTTOUCHAR -> unit_ushort_to_uchar
|
|
|
|
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
(hint this isn't a simple getter).
See P611 to apply instead of manually resolving conflicts.
|
|
|
|
|
|
Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.
Studio request by Julien Kaspar
|
|
Those fine-tuning bits will be extended soon, so makes sense to start using
some more verbose flag names when calling functions.
|
|
GSOC 2017 by Darshan Kadu, see: D2859.
This is a partial merge of some of the features from
the soc-2017-vertex_paint branch.
- Alpha painting & drawing.
- 10 new color blending modes.
- Support for vertex select in vertex paint mode.
|
|
|
|
Use GPU_pbvh prefix.
|
|
Also replace macro with for loop.
|
|
This was mostly followed already.
|
|
|
|
Since moving to MLoopTri this is no longer needed.
|
|
Also add utility functions: GPU_basic_shader_bind_enable/disable
so we don't have to get the previous state every time and manipulate it
|
|
The purpose of the patch is to replace deprecated glShadeModel.
To decrease glShadeModel calls I've set GL_SMOOTH by default
Reviewers: merwin, brecht
Reviewed By: brecht
Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D1958
|
|
|
|
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*!
|
|
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
|
|
The title says it all actually.
Added special custom data type, because we don't know in advance
whether we're referencing UV or Color layer. Also made it so vertex
attributes are normalized.
TODO: Border render in viewport ignores the normalization of the
attribute array for some reason, will be looked into still.
Reviewers: mont29, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D2022
|
|
Wireframe drawing doesn’t use the following GL state, so don’t update
these:
- ShadeModel
- NormalPointer
- ColorPointer
Normal & color data are still uploaded as part of the interleaved VBO,
but those attributes are disabled for wireframe.
|
|
|
|
Only used for color for now, but we need this for any kind of buffer
updates actually.
This should get rid of some allocation/deallocation, making
vertex painting a bit faster.
|
|
|
|
Differential Revision: https://developer.blender.org/D1645
|
|
scan, thanks...errr.
|
|
|
|
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.
|
|
Was almost certainly being compiled out anyway, but now we don’t have
to read it!
|
|
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.
|
|
simple stuff!
- remove ARB suffix from core functions & enums
- remove checks for core features (VBOs, generic attribs)
- keep checks for non-core features (draw elements base vertex)
|
|
noticing
|
|
|
|
culling was on)
|
|
Use OpenGL 3.2 extension ARB_draw_elements_base_vertex, which allows us
to add offset in index buffer indices automatically. This should reduce
the number of draw calls significantly.
We may have some errors on the Mac with VBO setting off.
OSX OpenGL extensions don't play well with vertex arrays.
Will test that more later.
We might also use a full element buffer here, like we do when hiding
some quads, but this approach keeps the memory savings intended
originally.
|
|
Was overdrawing the buffer, in case of fast drawing just use one
draw call. Should also make performance quite smoother.
Note:
Just discovered we are doing one draw call - per grid - in multires
apparently to keep reusing the same element buffer.
This is horribly, dreadfully slow and will check about fixing it later.
|
|
Wasn't working correctly since using MLoopTri,
this is improved over 2.75 which only handled tris & quads.
|
|
It's not actually used during drawing though.
|
|
Separate and reuse some shared code.
Also avoid counting for information we already know,
such as total loop triangles etc.
|
|
mode.
Issue from looptri merge.
|
|
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 :)
|
|
I suspect code here can be cleaned up but for now try this.
Alternatively we can check for errors around buffer allocation
but this needs bigger changes.
|
|
properly.
This should fix failure to use vertex arrays in OSX with high
polycounts.
Note this will not suffice as a fix when we move to VBOs exclusively
(GL 3+), we'll have to think of some way to separate huge meshes to many
VBOs.
|
|
|
|
don't support VBOs.
Exposed by initialization error in GLEW, which should be fixed
seperately.
|
|
subdivision.
Classic integet overflow/size_t substitution case. Machines are getting
powerful enough to easily expose these kinds of error now.
|
|
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!
|
|
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.
|
|
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.
|