Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d11bcf2
perf(vulkan): skip camera/light/transform nodes in replay fingerprint…
brianmk Sep 5, 2026
01d4c3b
vulkan: instanced/batched opaque drawing + replay-gate stabilization
brianmk Sep 5, 2026
7fcd8d4
sostate: inline the getElement() hot read path
brianmk Sep 5, 2026
e60dd59
vulkan-rt: transmit scene lights + transparent shadow + material/geom…
brianmk Sep 5, 2026
d908a5a
Merge commit 'df2672ac2270a179006b70f424a299b1edf10244' into HEAD
brianmk Sep 5, 2026
dcf6b4a
rendering: fix MSVC/clang-cl /WX conformance in the Vulkan renderer
brianmk Sep 6, 2026
c9b46f3
rendering/xml: silence -Wall -Wextra warnings so the bundled Coin bui…
brianmk Sep 6, 2026
c73ddc9
renderer: extract VulkanRecordContext for per-recording state
brianmk Sep 6, 2026
85854ac
renderer: pre-size instance-model ring and drop per-draw growth
brianmk Sep 6, 2026
cba85eb
renderer: add opt-in device-memory sub-allocator (FC_VULKAN_MEM_POOL)
brianmk Sep 6, 2026
5cd1752
renderer: compact Vulkan vertex layout 48->32 bytes (M3)
brianmk Sep 6, 2026
eca7c9d
renderer: trust retained geometry pointer identity for change detecti…
brianmk Sep 6, 2026
44abcb0
renderer: full-target clear via render-pass loadOp (FC_VULKAN_RP_CLEAR)
brianmk Sep 6, 2026
f88cbc5
renderer: micro-bundle perf (M6 part 1: dpr hoist, sampler cache, buc…
brianmk Sep 6, 2026
e637f81
renderer: consolidate texture staging into one reused pool (M6 part 2)
brianmk Sep 6, 2026
75475d3
Vulkan backend: worklist pre-pass with pre-assigned lighting slots (M1b)
brianmk Sep 6, 2026
5965d06
Vulkan backend: serial secondary command buffers for the opaque pass …
brianmk Sep 6, 2026
5264cb9
Vulkan backend: move the per-recording slot cursor into VulkanRecordC…
brianmk Sep 6, 2026
07f2150
Vulkan backend: parallel record, perf fixes, and external-path frameb…
brianmk Sep 6, 2026
dabdf79
Merge freecad-master into fix/vulkan-replay-perf
brianmk Sep 6, 2026
363fca4
renderer: fix GL retained-lighting regression from world-space rerouting
brianmk Sep 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")

coin_msvc_link_static_crt(${COIN_BUILD_MSVC_STATIC_RUNTIME})
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DNOMINMAX)
else()
if(APPLE)
add_definitions(-DGL_SILENCE_DEPRECATION)
Expand Down
22 changes: 12 additions & 10 deletions data/shaders/vulkan/rt/ClosestHit.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ layout(location = 0) rayPayloadEXT Payload payload;

const int COIN_MAX_LIGHTS = 8;

// Same Gouraud evaluation as the raster visual program.
vec3 coin_rtx_gouraud(vec3 eyePos, vec3 eyeNormal, vec3 baseColor,
// Same Gouraud evaluation as the raster visual program. The producer's
// light data is world-space (the standard IR convention), so the evaluation
// runs directly in world space; dot-product shading makes this identical to
// the eye-space form.
vec3 coin_rtx_gouraud(vec3 worldPos, vec3 worldNormal, vec3 baseColor,
RTMaterial mat)
{
vec3 N = normalize(eyeNormal);
vec3 V = normalize(-eyePos);
vec3 N = normalize(worldNormal);
vec3 V = normalize(frame.u_cameraPos.xyz - worldPos);
if (mat.params.y > 0.5 && dot(N, V) < 0.0) {
N = -N;
}
Expand All @@ -79,7 +82,7 @@ vec3 coin_rtx_gouraud(vec3 eyePos, vec3 eyeNormal, vec3 baseColor,
float attenuation = 1.0;
float spotFactor = 1.0;
if (mat.lightType[i].x > 0.5) {
vec3 lightVector = mat.lightPosition[i].xyz - eyePos;
vec3 lightVector = mat.lightPosition[i].xyz - worldPos;
float distanceToLight = length(lightVector);
if (distanceToLight <= 0.0001) continue;
L = lightVector / distanceToLight;
Expand All @@ -89,7 +92,7 @@ vec3 coin_rtx_gouraud(vec3 eyePos, vec3 eyeNormal, vec3 baseColor,
0.0001);
if (mat.lightType[i].x > 1.5) {
vec3 coneDir = normalize(mat.lightDirection[i].xyz);
vec3 fromLight = normalize(eyePos - mat.lightPosition[i].xyz);
vec3 fromLight = normalize(worldPos - mat.lightPosition[i].xyz);
float spotCos = dot(coneDir, fromLight);
if (spotCos < mat.lightSpot[i].x) continue;
spotFactor = pow(max(spotCos, 0.0), mat.lightSpot[i].y);
Expand Down Expand Up @@ -153,12 +156,11 @@ void main()

if (payload.info.w == 0u) {
// Preview mode: full Gouraud shading (matching the raster viewport
// and the old compute tracer).
vec3 eyePos = (frame.u_view * vec4(worldPos, 1.0)).xyz;
vec3 eyeN = normalize(mat3(frame.u_view) * worldN);
// and the old compute tracer); world-space light data is consumed
// directly.
vec3 rgb = mat.diffuse.rgb;
if (mat.params.w > 0.5) {
rgb = coin_rtx_gouraud(eyePos, eyeN, mat.diffuse.rgb, mat);
rgb = coin_rtx_gouraud(worldPos, worldN, mat.diffuse.rgb, mat);
}
payload.color = vec4(clamp(rgb, 0.0, 1.0), 1.0);
}
Expand Down
Loading
Loading