Age | Commit message (Collapse) | Author |
|
And use manual save/restore mechanism.
The stack method is not used so much to be considered useful.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/gpu` module.
No functional changes.
|
|
|
|
|
|
|
|
The issue was that we used GL_ALWAYS for depth checking here which would
lead to the depth information from objects being messed up.
It would not represent which object was closest to the camera.
Reviewed By: Clément Foucault, Jeroen Bakker, Campbell Barton
Differential Revision: http://developer.blender.org/D7710
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
|
|
- Move gpuPush/Pop from GPU_draw.h into GPU_state.h
as this is for pushing/popping state.
- Add 'GPU_STANDALONE' define, to bypass use of user-preferences
for theme colors and pixelsize, as well as pbvh init/free functions.
Needed to get GHOST tests working again.
|
|
|
|
|
|
fix T63936 introduced in 86914e713347.
Reviewers: fclem
Reviewed By: fclem
Tags: #bf_blender
Maniphest Tasks: T63936
Differential Revision: https://developer.blender.org/D4750
|
|
If the draw uses the same id as the previous draw, there is no need to read the depth
buffer at this point, avoiding a CPU-GPU sync bubble.
Fixes T62511 Selection is significantly slower in production scenes.
With this patch glReadPixels is not the bottleneck. Regular drawing Is still very
slow so I would suggest fixing the regular drawing first before trying to
improve the selection algorithm.
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
From rBd5cb425b8745
|
|
Apparently some drivers don't allow `glReadPixel` read out pixels of texture boundaries.
Intersect `rect` to avoid such cases.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
|
|
|
|
|
|
|
|
|
|
We no longer user scissor for 3D viewport drawing, and some selection
code assumed it still. This also cleans up unnecessary scissor test
switching, we only have it temporarily enabled now.
|
|
|
|
Changed 2.8x code so this is no longer needed.
|
|
|
|
Note that setting `glDepthFunc` isn't important,
since 2.8 branch changes this value it might seem like an error
however it's harmless in this case - so better make note of this.
|
|
|
|
|
|
Would run twice, harmless at the moment but could cause issues later.
|
|
|
|
Needed for depth picking in 2.8
|
|
The original implementation (cbd78c81268f) broke depth of field.
|
|
Reference document: http://docs.gl/gl3/glPushAttrib
This patch only tackles the bits that are set by Blender with the
following exceptions:
1) Deprecated states (e.g., GL_STIPPLE) are not saved/restored
2) The exception being GL_ALPHA_TEST, which will be removed, but it may
affect drawing too much now. To be removed once we no longer set GL_ALPHA_TEST
elsewhere.
3) paint_cursor will be tackled separated, since it was abusing
glPush/PopAttrib in the first place.
4) Despite what the glPushAttrib page above may suggest, GL_DEPTH_WRITEMASK needs glGet, not glIsEnabled
5) BGE is still a problem since it relies on GL_ALL_ATTRIB_BITS which
would lead to a way more complete/lenghty solution. Since the BGE has
other (OpenGL deprecated) problems anyways, it can be handled on its own
time.
Finally, the original design for 2.8 was to implement a proper stack
system. However we need to move to core profile sooner than later. So
this is a pragmatic temporary (that may be permanent) solution.
Reviewers: merwin, campbellbarton
Differential Revision: https://developer.blender.org/D2600
|
|
glMaterial
glColorMaterial
glPixelTransfer
and glEnable/Disable for
GL_FOG, GL_LIGHTING, GL_COLOR_MATERIAL
All of these were just setting default values, so I don't expect any visible change.
Part of T49165 (general OpenGL upgrade)
|
|
|
|
|
|
Selection loop would draw the selection ignoring xray.
Now draw in a separate pass after clearing the depth buffer,
as with regular drawing.
Also disable depth sorting,
caller can sort the hit-list by depth if needed.
|
|
Intended to replace legacy GL_SELECT, without the limitations of
sample queries which can't access depth information.
This commit adds VIEW3D_SELECT_PICK_NEAREST and VIEW3D_SELECT_PICK_ALL
which access the depth buffers to detect whats under the pointer,
so initial selection is always the closest item.
The performance of this method depends a lot on the OpenGL
implementations glReadPixels.
Since reading depth can be slow, buffers are cached for object picking
so selecting re-uses depth data, performing 1 draw instead of 3
(for 24, 18, 10 px regions, picking with many items under the pointer).
Occlusion queries draw twice when picking nearest,
so worst case 6x draw calls per selection.
Even with these improvements occlusion queries is faster on AMD hardware.
Depth selection is disabled by default, toggle option under select method.
May enable by default if this works well on different hardware.
Reviewed as D2543
|