Age | Commit message (Collapse) | Author |
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
|
|
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
|
|
The struct name is descriptive,
this isn't going to be confused with other variables.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
Needed to fix T61196, supporting clipped back-buffer in the 3D view
which is done outside the draw module.
It was also inconvenient having DRW_shader_* versions of GPU_shader_*
API calls.
- Clipping distances are now supported as a shader configuration
for builtin shaders.
- Add shader config argument when accessing builtin shaders.
- Move GPU_shader_create_from_arrays() from DRW to GPU.
|
|
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.
|
|
Only for workbench solid/wire modes.
|
|
|
|
This is in order to make the API more multithread friendly inside the
draw manager.
GPU_shader_get_uniform will only serve to query the shader interface and
not do any GL call, making it threadsafe.
For now it only print a warning if the uniform was not queried before.
|
|
This removes code duplication and put an end to the old "create at request"
batch creation.
Also it uses the same vbo as the uv layer used for shading. Reducing VRAM
usage.
Also fixes the modified uv display in uv edit mode.
|
|
This is now done in shader so that the batches are shared across ImageUV
areas.
|
|
|
|
This is to separate id drawing from standard color drawing.
|
|
|
|
|
|
Reviewers: fclem
Differential Revision: https://developer.blender.org/D3767
|
|
NOTE: This commit only concern edit UVs and not the "shadow" mesh displayed
when texture painting. This will be address in a future commit.
We now cache the uv mesh in the mesh batch cache and only reupload data on
changes.
Update could be more granular (and a bit faster) but it's not our main
concern ATM.
This should fix problem caused by the IMM api used to draw large meshes.
This makes performance skyrocket compared to previous implementation.
There is still a big CPU bottleneck when not in sync selection mode but it
is not related to the drawing function directly.
|
|
Differential Revision: https://developer.blender.org/D3719
|
|
Use the multiply blending mode for the weight paint overlay.
To support the opacity slider, we need a new shader. Otherwise this combination of multiplication and mixing does not seem to be supported by glBlendFunc.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3727
|
|
The existing alternative is to use a buffer and call
uniform_vector_float which is overkill for such a simple operation.
|
|
|
|
Differential Revision: https://developer.blender.org/D3688
|
|
Was done more like a hack on top of old drawing pipeline.
Should be re-implemented to fit new draw manager closer.
|
|
|
|
It is was not really a bottleneck but it was triggering my OCD when 1/3rd
of the drawcalls in a normal scene were basically only caused by this.
|
|
keeping GPU_SHADER_SMOKE until other occurences are removed.
|
|
|
|
This commit merge the full development done in greasepencil-object branch and include mainly the following features.
- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.
You can get more info here:
https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/
This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.
Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
|
|
|
|
|
|
This is intended to help developers to know how and when to use each shader.
There are plenty of undocumented shaders, but it's a matter of filling them in.
The script I used to quickly find the related shaders for a const is: P700
Original patch: D2318
|
|
This is a usefull feature that can be used to do a lot of precomputation on
the GPU instead of the CPU.
Implementation is simple and only covers the most usefull case.
How to use:
- Create shader with transform feedback.
- Create a pass with DRW_STATE_TRANS_FEEDBACK.
- Create a target Gwn_VertBuf (make sure it's big enough).
- Create a shading group with DRW_shgroup_transform_feedback_create().
- Add your draw calls to the shading group.
- Render your pass normaly.
Current limitation:
- Only one output buffer.
- Cannot pause/resume tfb rendering to interleave with normal drawcalls.
- Cannot get the number of verts drawn.
|
|
draw_common.c
|
|
|
|
This shader is used instead of blitting back and forth to a single sample
buffer.
This means it resolves the color and depth samples and outputs a fragment
which can be depth tested and blended on top of an existing framebuffer.
We do static shader variation with manual loop unrolling for performance
reason. In my test I get 25% more perf with intel integrated gpu and 75%
performance gain with dedicated nvidia card compared to a single shader
with a uniform for sample count.
|
|
This does not look great with light toolbar buttons as in the default,
so consider this a work in progress.
|
|
Originally added for icon drawing, no longer used.
|
|
Dithering the output color for 8bit precision framebuffer with bayer matrix.
On my tests the bayer matrux patterns are not noticeable at all.
Note that it also does that in opengl rendered mode which can be in a much
higher bitdepth. We can fix that if that's a problem in the future but I
doubt it will.
|
|
|
|
Will be used for probe outline id drawing.
|
|
This will let us draw multiple widget base at once.
|
|
Replace the 12 iterations of UI_draw_roundbox_4fv with only one batch.
This mean less overdraw and less drawcalls.
I had to hack the opacity falloff curve manually to get approximatly the
same result as previous technique. I'm sure with a bit more brain power
somebody could find the perfect function.
|
|
Special shader to draw nodelinks for the node editor.
We only pass bezier points to the GPU and vertex position is handled inside
the vertex shader.
The arrow is also part of the batch to avoid separate drawcalls for it.
We still draw 2 pass one for shadow and one for the link color on top.
One variation to draw instances of theses links so that we only do one
drawcall.
|
|
For this we use a new shader that gets it's data from a uniform array.
Vertex shader position the vertices using these data.
Using glUniform is way faster than using imm for that matter.
Like BLF rendering, UI icons are always (as far as I know) non occluded and
displayed above everything else. They also does not overlap with texts so
they can be batched at the same time.
|
|
I've made a separate version of the geom shader that works with full
3D modelviewmat.
This commit also includes some fixup inside blf_batching_start().
|
|
This vertex shader let us draw widgets with batches instead of imm calls.
|
|
This bypass the use of immediate mode for theses drawcalls. Placement and
and icon select (via uvs) is done inside the vertex shader.
|