From 9bb041a090dab428469647a203a57147a5d09c0b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 09:03:00 +0400 Subject: fix(render): use the native lamps in the designer viewport Use the pair of local directional lamps from iron3d.dll and convert their directions into the model coordinates as Terrain.dll does. Keep world point lights out of the model viewport. Verified the light vectors against the native setter and the assembled model in the stock Field Camp Vulkan window. --- adapters/fparkan-render-vulkan/shaders/triangle.vert | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'adapters/fparkan-render-vulkan/shaders/triangle.vert') diff --git a/adapters/fparkan-render-vulkan/shaders/triangle.vert b/adapters/fparkan-render-vulkan/shaders/triangle.vert index 4615bae0..868c26f3 100644 --- a/adapters/fparkan-render-vulkan/shaders/triangle.vert +++ b/adapters/fparkan-render-vulkan/shaders/triangle.vert @@ -203,7 +203,9 @@ LightingTerms native_material_lighting( ); } } - for (uint index = 0u; index < point_light_buffer.header.x; ++index) { + // The model viewport has its own lamps and does not sample the world's lights. + uint point_light_count = frame.lighting_floor.w > 0.5 ? 0u : point_light_buffer.header.x; + for (uint index = 0u; index < point_light_count; ++index) { PointLightRecord point_light = point_light_buffer.records[index]; if (point_light.owner_scope != 0u && point_light.owner_scope != uint(gl_InstanceIndex)) { continue; -- cgit v1.2.3