Skip to content

Commit 83394e4

Browse files
author
kevyuu
committed
Fix normal computation for icosphere example 67
1 parent 0b30462 commit 83394e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

67_RayQueryGeometry/app_resources/render.comp.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ float3 calculateSmoothNormals(int instID, int primID, SGeomInfo geom, float2 bar
7575
case OT_ICOSPHERE:
7676
default:
7777
{
78-
n0 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[0] * vertexStride));
79-
n1 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[1] * vertexStride));
80-
n2 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[2] * vertexStride));
78+
n0 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[0] * 12));
79+
n1 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[1] * 12));
80+
n2 = normalize(vk::RawBufferLoad<float3>(normalBufferAddress + indices[2] * 12));
8181
}
8282
}
8383

0 commit comments

Comments
 (0)