Modules/Sketch3D/shaders/stroke.vert
Шурупов Илья Викторович 6d200eb171 Port rendering stack from OpenGL to Vulkan
Replace the OpenGL rendering backend with Vulkan across the engine:

- Graphics: add VulkanContext (instance/device/swapchain/renderpass with
  depth-stencil), port Canvas to nanovg-on-Vulkan and DebugGUI to the imgui
  Vulkan backend, drop GLEW. Wait for the Wayland configure handshake before
  the first present and rebuild the swapchain to the confirmed size so the
  window maps reliably on fractional-scale outputs.
- RasterRender: reimplement RenderBuffer, shaders and object pipeline on
  Vulkan (offscreen VkImage target with MSAA resolve, SPIR-V pipelines,
  push-constant MVP, depth remap for Vulkan clip space).
- Sketch3D: port the stroke renderer (geometry-shader line expansion) and
  stroke GPU buffers to Vulkan.
- 3DEditor: port the path-tracer texture upload to a Vulkan staging upload
  and keep raster/path-tracer viewports oriented consistently.
- Add a nanovg external-VkImage bridge plus a render-target registry so 3D
  render targets can be shown inside the 2D canvas.
- Prefer the Wayland platform in GLFW regardless of DISPLAY.
- Widgets: make BasicLayout size distribution converge with a sub-pixel
  epsilon instead of an exact-zero comparison, which could otherwise spin
  forever on fractional-scale displays and block the first frame.

Vendor nanovg_vulkan and add a standalone VulkanGraphics module.
2026-10-13 03:04:08 +03:00

23 lines
442 B
GLSL

#version 450
layout(location = 0) in vec4 point;
layout(location = 0) out float thickness;
layout(push_constant) uniform PushConstants {
mat4 MVP;
vec4 Color;
vec4 BGCol;
float Ratio;
float Target;
} pc;
void main() {
thickness = point.w;
vec4 vec = pc.MVP * vec4(point.xyz, 1.0);
vec.z *= vec.w;
// Remap OpenGL clip Z [-w, w] to Vulkan [0, w] after the depth trick above.
vec.z = (vec.z + vec.w) * 0.5;
gl_Position = vec;
}