I was messing around with the pastry mod to plan for integrating preemptive information into the stronghold sampler, and came across this case:
The magenta-outlined sub-chunks are the chunks rendered and block entities like spawners will show up on pie. you can see the sub-chunk containing the spawner on the right was rendered despite the view frustum is pointing in the exact opposite direction. I have also heard of other players reporting this issue. Why is that?
private boolean isBoxInFrustumRaw(float minX, float minY, float minZ,
float maxX, float maxY, float maxZ) {
for(int i = 0; i < 6; ++i) {
Vector4f vector4f = this.frustum[i];
if (!(vector4f.dot(new Vector4f(minX, minY, minZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(maxX, minY, minZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(minX, maxY, minZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(maxX, maxY, minZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(minX, minY, maxZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(maxX, minY, maxZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(minX, maxY, maxZ, 1.0F)) > 0.0F)
&& !(vector4f.dot(new Vector4f(maxX, maxY, maxZ, 1.0F)) > 0.0F)) {
return false;
}
}
return true;
}
This is the code that checks the bounding box of a subchunk is within the view frustum. For each face of the view frustum, the game checks if at least one corner of the subchunk was inside the extended plane of each face of the frustum. If any of the said plane doesn’t containe any of the corners, that subchunk is not rendered.
Because the game is using the extended plane, some false positive cases will slip through.
Take this view frustum as an example:
Extended plane of green(left) contains 2 corners:
Extended plane of blue(top) contains 2 corners:
Extended plane of magenta(right) contains a corner:
Extended plane of yellow(bottom) contains 2 corners:
Notabely, extended plane of cyan(near) contains at least 1 corner:
The far plane will obviously contain all 8.
this is going to be so annoying. why can’t they just do this properly






