Fix #119527: Aliased Wireframe In XRay

This change reverts 14500953ed. This commit improved the performance
but introduced the regression. The wireframe shader checks the normal
buffer to detect if attributes are being rendered. The VBO contains both
positions and normals.

In Blender 4.2 this VBO was separated (#116902)and this solved the rendering. It is
to late and risky to add this separation to 4.1 in the last minute so we
decided to revert the performance improvement as it was already an issue
for several years.

The performance improvement will still be in Blender 4.2 where it doesn't
have these artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/119656
This commit is contained in:
Jeroen Bakker 2024-03-19 14:23:43 +01:00
parent 4a7c5d3d3d
commit b5168ee771

@ -66,8 +66,7 @@ void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata)
const bool use_select = (DRW_state_is_select() || DRW_state_is_depth());
GPUShader *wires_sh = use_select ? OVERLAY_shader_wireframe_select() :
OVERLAY_shader_wireframe(pd->antialiasing.enabled &&
!pd->xray_enabled);
OVERLAY_shader_wireframe(pd->antialiasing.enabled);
for (int xray = 0; xray < (is_material_shmode ? 1 : 2); xray++) {
DRWState state = DRW_STATE_FIRST_VERTEX_CONVENTION | DRW_STATE_WRITE_COLOR |