Age | Commit message (Collapse) | Author |
|
|
|
Actually it's done by the Draw Manager, so other engines can use it.
|
|
Currently only uses the simple shader.
|
|
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
|
|
Using geometry shader allows us to get rid of the 'line origin' extra
vertex attribute, which means dashed shader no longer requires fiddling
with those vertex attributes definition, and, most importantly, does not
require anymore special drawing code!
As you can see, this makes code much simpler, and much less verbose,
especially in complex cases.
In addition, changed how dashes are handled, to have two 'modes', a
simple one with single color (using default "color" uniform name), and a
more advanced one allowing more complex and multi-color patterns.
Note that since GLSL 1.2 does not support geometry shaders, a hack was
added for now (which gives solid lines, but at least does not make
Blender crash).
|
|
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.
|
|
The fragment shader expects a normal, but the vertex shader was not providing one.
Fix: added a new vertex shader that has normals + smooth color interpolation.
I also split gpu_shader_3D_vert in two:
- one with just position
- one with position + normal
For each of the builtin shaders, we should be able to look at the GLSL and tell exactly what it's doing. Using #defines and #ifdefs for rendering options makes the shaders hard to read and easy to break.
|
|
|
|
This wasn't working outside of gpu module.
|
|
This introduces a new CMake option - WITH_LEGACY_OPENGL. Without this option
things may not draw perfectly, however, we should soon be able to build with
OpenGL core profile.
The matrix-related api calls are (still) not handled here (glTranslate, ...).
There seems to be no consensus on whether to make this build option the
default. We can talk about this later. For now two things are the
priority:
(1) To get rid of deprecated calls when WITH_LEGACY_OPENGL is ON
(2) To make core profile work for Mesa/Mac when WITH_LEGACY_OPENGL is OFF
Reviewers: merwin, sergey, campbellbarton
Differential Revision: https://developer.blender.org/D2603
Many thanks for Sergey Sharybin for the help.
|
|
These were in BIF_glutil which is documented to be removed,
so best not define new API's there.
|
|
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.
|
|
Since we need GPULamps for draw engines, it makes sense to separate them.
|
|
|
|
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.
Tested on Mac, time to push and test on Windows.
Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?
|
|
|
|
Particle system (not edit mode)
|
|
|
|
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
|
|
|
|
|
|
After a GLSL program is linked we can get all its inputs & never have to ask it again.
Several uniforms are considered "built-in". Nothing special about these to OpenGL itself, they just follow conventions of our built-in shaders.
This will help the matrix API, immediate & batch drawing APIs, and allow extra error/compatibility checking.
|
|
PrimitiveClass will help match shaders to draw calls & detect usage errors. For example a point sprite shader only makes sense with PRIM_POINTS.
Updated other files to include new primitive.h
|
|
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
|
|
Reviewed By: merwin
Differential Revision: https://developer.blender.org/D2512
|
|
|
|
|
|
|
|
Now we can draw keyframe markers as point sprites, with fewer draw calls and state changes.
Based on the builtin shader for round points with anti-aliased outline. This one is more pointy.
|
|
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.
OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
|
|
Initial work by Clément Foucault with contributions from Dalai Felinto
(mainly per-collection engine settings logic, and depsgraph iterator placeholder).
This makes Blender require OpenGL 3.3. Which means Intel graphic card
and OSX will break. Disable CLAY_ENGINE in CMake in those cases.
This is a prototype render engine intended to help the design of real
render engines. This is mainly an engine with enphasis in matcap and
ambient occlusion.
Implemented Features
--------------------
* Clay Render Engine, following the new API, to be used as reference for
future engines
* A more complete Matcap customization with more options
* Per-Collection render engine settings
* New Ground Truth AO - not enabled
Missing Features
----------------
* Finish object edit mode
- Fix shaders to use new matrix
- Fix artifacts when edge does off screen
- Fix depth issue
- Selection sillhouette
- Mesh wires
- Use mesh normals (for higher quality matcap)
- Non-Mesh objects drawing
- Widget drawing
- Performance issues
* Finish mesh edit mode
- Derived-Mesh-less edit mode API (mesh_rende.c)
* General edit mode
- Per-collection edit mode settings
* General engines
- Per-collection engine settings
(they are their, but they still need to be flushed by depsgraph, and
used by the drawing code)
|
|
This does not address stapling shader in 2.8, though the solution can be
similar (own shader, not polutting interlace shader).
part of T49043
Reviewers: merwin
Differential Revision: https://developer.blender.org/D2440
|
|
Needed because deps graph can destroy objects from any thread. We ran into the same problem & solved it in GPU_buffers.
Implemented in C++11 since it provides the needed machinery. The interface is in C like the rest of Gawain.
|
|
|
|
D2311 by @ianwill
This is the radial control that appears when we change the size of a brush in sculpt and vertex and texture painting modes, by pressing "f".
Also includes a new built-in shader that can be useful in other places.
Part of T49043
|
|
As seen at #bcon16. These were produced quickly and probably need further work.
SIMPLE variant draws triangle mesh edges. Based on this research:
http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/4884/pdf/imm4884.pdf
http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf
Non-SIMPLE variant can adjust thickness per edge. This can be used to draw only some edges, or accentuate some edges. Given the right inputs this is a general n-gon perimeter shader.
Part of T49165
|
|
As seen at #bcon16
Geometry shader version is automatically used on modern GL runtimes. Legacy version is used on pre-3.2 systems (Mac, Mesa compat profile). They have the same inputs and visual result.
TODO: specialized versions that are less flexible -- draw ALL edges or draw JUST silhouette edges.
Part of T49165
|
|
Discarded edges should not update depth buffer or blend with color buffer.
Geometry shader version will make this obsolete.
|
|
|
|
|
|
|
|
- rename image shaders to describe exactly what they do
- rename inputs to match other built-in shaders
- set & use active texture unit
- no need to enable/disable textures with GLSL
- pull vertex format setup out of loops
|