|
@@ -431,24 +431,23 @@ void ClusterBin::binTile(U32 tileIdx, BinCtx& ctx, TileCtx& tileCtx)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Decals
|
|
|
|
|
|
|
+ // GI probes
|
|
|
{
|
|
{
|
|
|
- Obb decalBox;
|
|
|
|
|
- for(U i = 0; i < ctx.m_in->m_renderQueue->m_decals.getSize(); ++i)
|
|
|
|
|
|
|
+ Aabb probeBox;
|
|
|
|
|
+ for(U i = 0; i < ctx.m_in->m_renderQueue->m_giProbes.getSize(); ++i)
|
|
|
{
|
|
{
|
|
|
- const DecalQueueElement& decal = ctx.m_in->m_renderQueue->m_decals[i];
|
|
|
|
|
- decalBox.setCenter(decal.m_obbCenter.xyz0());
|
|
|
|
|
- decalBox.setRotation(Mat3x4(decal.m_obbRotation));
|
|
|
|
|
- decalBox.setExtend(decal.m_obbExtend.xyz0());
|
|
|
|
|
|
|
+ const GlobalIlluminationProbeQueueElement& probe = ctx.m_in->m_renderQueue->m_giProbes[i];
|
|
|
|
|
+ probeBox.setMin(probe.m_aabbMin);
|
|
|
|
|
+ probeBox.setMax(probe.m_aabbMax);
|
|
|
|
|
|
|
|
- if(!insideClusterFrustum(frustumPlanes, decalBox))
|
|
|
|
|
|
|
+ if(!insideClusterFrustum(frustumPlanes, probeBox))
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for(U clusterZ = 0; clusterZ < m_clusterCounts[2]; ++clusterZ)
|
|
for(U clusterZ = 0; clusterZ < m_clusterCounts[2]; ++clusterZ)
|
|
|
{
|
|
{
|
|
|
- if(!testCollision(decalBox, clusterBoxes[clusterZ]))
|
|
|
|
|
|
|
+ if(!testCollision(probeBox, clusterBoxes[clusterZ]))
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -458,23 +457,24 @@ void ClusterBin::binTile(U32 tileIdx, BinCtx& ctx, TileCtx& tileCtx)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // GI probes
|
|
|
|
|
|
|
+ // Decals
|
|
|
{
|
|
{
|
|
|
- Aabb probeBox;
|
|
|
|
|
- for(U i = 0; i < ctx.m_in->m_renderQueue->m_giProbes.getSize(); ++i)
|
|
|
|
|
|
|
+ Obb decalBox;
|
|
|
|
|
+ for(U i = 0; i < ctx.m_in->m_renderQueue->m_decals.getSize(); ++i)
|
|
|
{
|
|
{
|
|
|
- const GlobalIlluminationProbeQueueElement& probe = ctx.m_in->m_renderQueue->m_giProbes[i];
|
|
|
|
|
- probeBox.setMin(probe.m_aabbMin);
|
|
|
|
|
- probeBox.setMax(probe.m_aabbMax);
|
|
|
|
|
|
|
+ const DecalQueueElement& decal = ctx.m_in->m_renderQueue->m_decals[i];
|
|
|
|
|
+ decalBox.setCenter(decal.m_obbCenter.xyz0());
|
|
|
|
|
+ decalBox.setRotation(Mat3x4(decal.m_obbRotation));
|
|
|
|
|
+ decalBox.setExtend(decal.m_obbExtend.xyz0());
|
|
|
|
|
|
|
|
- if(!insideClusterFrustum(frustumPlanes, probeBox))
|
|
|
|
|
|
|
+ if(!insideClusterFrustum(frustumPlanes, decalBox))
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for(U clusterZ = 0; clusterZ < m_clusterCounts[2]; ++clusterZ)
|
|
for(U clusterZ = 0; clusterZ < m_clusterCounts[2]; ++clusterZ)
|
|
|
{
|
|
{
|
|
|
- if(!testCollision(probeBox, clusterBoxes[clusterZ]))
|
|
|
|
|
|
|
+ if(!testCollision(decalBox, clusterBoxes[clusterZ]))
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -800,7 +800,8 @@ void ClusterBin::writeTypedObjectsToGpuBuffers(BinCtx& ctx) const
|
|
|
out.m_aabbMin = in.m_aabbMin;
|
|
out.m_aabbMin = in.m_aabbMin;
|
|
|
out.m_aabbMax = in.m_aabbMax;
|
|
out.m_aabbMax = in.m_aabbMax;
|
|
|
out.m_textureIndex = &in - &rqueue.m_giProbes.getFront();
|
|
out.m_textureIndex = &in - &rqueue.m_giProbes.getFront();
|
|
|
- out.m_halfTexelSize = 1.0f / Vec3(in.m_cellCounts.x(), in.m_cellCounts.y(), in.m_cellCounts.z()) * 0.5f;
|
|
|
|
|
|
|
+ out.m_volumeSizeUOver6 = F32(in.m_cellCounts.x()) / 6.0f;
|
|
|
|
|
+ out.m_halfTexelSizeU = 1.0f / in.m_cellCounts.x() / 2.0f;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|