Skip to content

Commit af175d4

Browse files
committed
Fixed trunks position so it does not probabilistically block m_eye
1 parent 49c2046 commit af175d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraForestSER/D3D12RaytracingSakuraForestSER.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,9 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
11121112
float randomYOffset = randomOffset(gen);
11131113
float randomZOffset = randomOffset(gen);
11141114

1115-
float posX = x * spacingBetweenTrees + randomXOffset;
1116-
float posY = 2.0f - (randomYOffset / 8);
1117-
float posZ = z * spacingBetweenTrees + randomZOffset;
1115+
float posX = x * spacingBetweenTrees + (randomXOffset / 6);
1116+
float posY = 2.0f - (randomYOffset / 3);
1117+
float posZ = z * spacingBetweenTrees + (randomZOffset / 6);
11181118
trunkPositions.emplace_back(posX, posY, posZ);
11191119

11201120
// Trunk instance

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraForestSER/Raytracing.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ struct Ray
208208
};
209209

210210

211-
// Trace a radiance ray into the scene and returns a shaded color.
211+
// Trace a radiance ray into the scene and returns a shaded color.
212212
float4 TraceRadianceRay(in Ray ray, in int currentRayRecursionDepth)
213213
{
214-
if (currentRayRecursionDepth >= 2)
214+
if (currentRayRecursionDepth >= 1)
215215
{
216216
return float4(0, 0, 0, 0);
217217
}

0 commit comments

Comments
 (0)