Age | Commit message (Collapse) | Author |
|
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.
|
|
This module has no use now with the new DrawManager and DrawEngines and it
is using deprecated paths.
Moving gpu_shader_fullscreen_vert.glsl
to draw/modes/shaders/common_fullscreen_vert.glsl
|
|
This separate context allows two things:
- It allows viewports in multi-windows configuration.
- F12 render can use this context in a separate thread and do a non-blocking render.
The downside is that the context cannot be used while rendering so a request to refresh a viewport will lock the UI. This is something that will be adressed in the future.
Under the hood what does that mean:
- Not adding more mess with VAOs management in gawain.
- Doing depth only draw for operators / selection needs to be done in an offscreen buffer.
- The 3D cursor "autodis" operator is still reading the backbuffer so we need to copy the result to it.
- All FBOs needed by the drawmanager must to be created/destroyed with its context active.
- We cannot use batches created for UI in the DRW context and vice-versa. There is a clear separation of resources that enables the use of safe multi-threading.
|
|
and also rename some related functions
|
|
|
|
Differential Revision: D2914
|
|
This improves eevee's cache performance by 13% in my test.
|
|
Use mesh batch cache for mesh selection.
Note that we could create the batches and free immediately
so they don't take up memory.
This resolves a problem where selection was limited
to immediate-mode buffer size.
|
|
Goal is to make them more modular, to allow more variants (variable
single-color, thickness, ...) to be added without having to
copy-and-change-one-line of whole chain of shaders.
|
|
Mainly adding 'wire' suffix to wire/distance drawing func and shader.
Also, match wire vertex shader behavior with solid one regarding
head/tail only drawing (i.e. alwas expect head bone mat, never tail one,
and assume that if a radius is negative, then we only draw on the other
end of the bone).
|
|
Envelope bones are now pretty much identical to old drawing code.
Note that currently new DwM drawing code does not seem to care about
wire/solid drawing modes at all, guess this is still TODO... For now we
hence just get both wire and solid for envelope bones, this can be
refined later.
|
|
This is not complete, it does not implement 3D solid drawing of
envelope bones. 2D wire is hence always drawn for now.
Some notes:
I did not try to implement the 'capsule' approach suggested by @fclem, because:
1. I spent enough time on this already, and finally got something working.
2. I managed to get rid of geometry shader completely.
3. Current approach allows us to use same shader for
distance outline and envelope wire.
It's working fine, except for one glitch - superpositions of envelope
outlines do not work as expected, not sure what's wrong here, tried to
disable zbuff, enable GL_BLEND, no luck so far...
I think we need our own 'background' drawpass to get them working (also
to avoid them drawing over the wire lines).
|
|
Actually it's done by the Draw Manager, so other engines can use it.
|
|
Currently only uses the simple shader.
|
|
Vertex/weight paint now work with core profile, resolves T51380.
|
|
This implements weight rendering with the draw manager, with all drawing
options (Shading, wire, face masking, vertex masking).
This is part of T51208
Reviewers: campbellbarton
Subscribers: dfelinto
Differential Revision: https://developer.blender.org/D2654
|
|
This is actually nearly same code as 2D version, maybe we can
deduplicate that later?
|
|
Same fundamental problem as fonts -- there is no longer GL_ALPHA format.
|
|
|
|
See gpu_shader.c for the main changes.
EXT_geometry_shader4 brought this feature to GL versions < 3.2, but now it's just cluttering up our code.
Soon all platforms will be on version 3.3 so we won't even have to check support at runtime!
|
|
Added new shader for clipping, also cleaned up rotation manipulator
drawing code a bit.
This code should be replaced by new transform manipulators soon, just
keeping this working in the meanwhile.
|
|
Particle system (not edit mode)
|
|
|
|
|
|
Renamed existing getter/setter that only FX shaders use. We could convert FX code to use the richer new interface or leave it as is.
Removed unused GPUShader fields. ShaderInterface tracks the same information.
|
|
We don't want to clutter gpu_shader.c with engine specific code
Added face's center dot
Simplified loose vert shader
|
|
|
|
|
|
Updated shader names and code that uses them.
All of these shaders produce round points that are anti-aliased and blended against the background.
These were initially named SMOOTH because they replace glEnable(GL_POINT_SMOOTH). But SMOOTH in shader-land refers to vertex attribute interpolation (like glShadeModel(GL_SMOOTH)).
Using SMOOTH to mean two things is confusing, so we now use AA to mean "the point is anti-aliased".
|
|
Based on the previous overlay shader from merwin.
This shader takes care of clipped vertex cases and do all edit mode face info in one pass (except face centers).
As the shading is done one the triangle itself the visual can't go beyond the surface of the mesh. That leads to half displayed edges on the outline of the mesh.
This problem can be fixed by a second pass.
This is work in progress.
|
|
D2376 by @ianwill, part of T49043
review by @merwin
Box select, circle select, etc. Introducing the dashed-line shader! See D2376 for more info.
|
|
new shader to draw an image with one isolated channel
|
|
|
|
- Added runtime display matrices to EditBone and bPoseChannel
- Added Object space instance vertex shader and modified the simple lighting shader accordingly
|