So far this makes a new pass for image empties that does not write to the depth buffer.
Todo:
- Sort empties using `DRW_pass_sort_shgroup_z`.
- Calculate correct bounding boxes.
- fix bounding box memory leak.
Reviewers: fclem
Differential Revision: https://developer.blender.org/D3922
Support for showing images in background/foreground and only in perspective/orthographic view.
Internally the depth of the image is modified in the fragment shader by setting `gl_FragDepth` explicitly.
The UI still needs some work to improve usability, see D3863 for details.
Currently there is one duplicated function, not sure how to best deduplicate it yet. (`is_image_empty_visible`)
Reviewer: fclem, brecht, campbellbarton
Differential Revision: https://developer.blender.org/D3863
2.7x was displaying 2 additional subdivision for theses views. Bumping to 3
just to say we improved it!
Hypothetically it can be increased as much as we want but float precision
can quickly become an issue.
As it turned out the issue wasn't that we were drawing only the active,
but that the "object mode" lattice drawing was drawing on top of the
drawing for all the edit mode lattice objects.
We are doing the same original behaviour for curves and even meshes. To be
investigated if it is ok for those other cases.
Includes the following fixes
- Fix smoke texture creation: data was interpreted as Byte instead of Floats.
- Fix Velocity texture not being free after draw: also was causing crashes.
- Fix display_thickness not being copied during COW.
- Fix Blending and general volume rendering algorithm.
- Add Volume Shadowing support.
Avoid accessing object mode via the view layer active object
when drawing since it's done everywhere we store the active object mode
in the draw-context.
This commit make the Xray option for the wireframe different from the other
shading mode. This makes it possible to rapidly switch between wireframe +
Xray and Solid mode without Xray.
Xray alpha is also decoupled.
Both variables are duplicated and exposed separately through RNA.
We now treat Xray as being the mode where Limit selection to visible is off.
If Xray is OFF, Limit selection to visible is considered ON.
To allow 'see through wires' with solid shading (not Xray shading) we still
draw solid shading if Xray is ON with Xray Alpha set to 1.0.
For this we need to add a bias depending on the viewing angle.
But increasing the hardness of the test make float precision issues in
the mesh transformation more prominent (actual geometry is far below the
surface). So to solve this issue we use a more subdivided grid mesh
8x8 quads instead of 1 triangle.
The core logic of this implementation comes from the drawobject.c from 2.7x.
I'm using `ts.colorGridAxisZ` for its color because of the legacy code:
```
UI_GetThemeColor3ubv(TH_GRID, col1);
UI_make_axis_color(col1, col2, 'Z');
glColor3ubv(col2);
```
There is nothing stopping us from adding this to the theme though, as it should
have been the case to start with.
The only difference from 2.7x is that we were using glLineWidth(2.0) before,
which is not supported reliably in the latest OpenGL.
Big thanks to Clément Foucault for helping with this, on the design as well as
debugging the implementation.
For the records, I'm creating and destroying batches for the path geometry at
every draw. The pipeline is as follows:
1. Create GPUBatch with all the points
2. Create new shgroup with simple shader
3. Add call with the gpubatch
4. Save it in a linked list in stl->g_data
5. Free it after all drawing is done
* Draw bundle names.
* Draw bundle shapes (but spheres).
* Draw custom colors for bundles.
* Support selecting bundles.
* Object bundles also fully tested.
Missing from this commit:
* Camera path.
* Spheres are not drawn as solid.
* Blue dashed line from camera to tracker objects.
The extension GL_ARB_texture_gather is reported to be supported and does
not trigger an error when enabled but the textureGater functions are not
defined.
Workaround is to disable the use of this extension on such systems.