@@ -1029,7 +1029,6 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
1029
1029
int objectsPerRow = 20 ; // Object per row along Z and X axis
1030
1030
float largerCubeSpacing = 4 .0f ; // Spacing between larger cubes
1031
1031
float randomCubeSpacing = 0 .1f ; // Spacing between random smaller cubes
1032
- float spacingGap = 0 .0f ; // Gap between two groups of forests
1033
1032
1034
1033
// Create random number generator for random offsets
1035
1034
std::random_device rd;
@@ -1038,7 +1037,7 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
1038
1037
1039
1038
std::random_device rdBush;
1040
1039
std::mt19937 genBush (rdBush ());
1041
- std::uniform_real_distribution<float > randomOffsetBush (0 .0f , 0 .4f );
1040
+ std::uniform_real_distribution<float > randomOffsetBush (0 .7f , 0 .75f );
1042
1041
1043
1042
// Larger cubes for the floor
1044
1043
for (int x = -objectsPerRow / 2 ; x <= objectsPerRow / 2 ; ++x)
@@ -1098,7 +1097,7 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
1098
1097
}
1099
1098
1100
1099
int treesPerRow = 30 ;
1101
- float spacingBetweenTrees = 1 .7f ;
1100
+ float spacingBetweenTrees = 1 .9f ;
1102
1101
1103
1102
// Trunk and leaves
1104
1103
// Store random positions for trunks
@@ -1166,11 +1165,12 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
1166
1165
{
1167
1166
for (int z = -bushesPerRow / 2 ; z <= bushesPerRow / 2 ; ++z)
1168
1167
{
1168
+ float randomXOffset = randomOffset (gen);
1169
1169
float randomYOffset = randomOffsetBush (genBush);
1170
1170
1171
- float posX = x * 0.07 ;
1172
- float posY = 0 . 80f + randomYOffset;
1173
- float posZ = z * 0.07 ;
1171
+ float posX = x * 0.2 + randomXOffset ;
1172
+ float posY = 1 . 2f + randomYOffset;
1173
+ float posZ = z * 0.2 ;
1174
1174
1175
1175
D3D12_RAYTRACING_INSTANCE_DESC desc = {};
1176
1176
float scale = 2 .1f ; // Bush scale
@@ -1179,7 +1179,7 @@ void D3D12RaytracingSakuraForestSER::BuildAccelerationStructures()
1179
1179
desc.Transform [2 ][2 ] = scale;
1180
1180
1181
1181
desc.Transform [0 ][3 ] = posX; // X position with offset
1182
- desc.Transform [1 ][3 ] = posY + 0 . 8f ; // Y position with offset
1182
+ desc.Transform [1 ][3 ] = posY; // Y position with offset
1183
1183
desc.Transform [2 ][3 ] = posZ; // Z position
1184
1184
1185
1185
desc.InstanceMask = 1 ;
0 commit comments