0
\$\begingroup\$

When i did frustum culling, far parts of land not rendering. It is good like i want. But after I see sky box instead of these parts. My question is, is this normal ? Or what i need to see or what i need to do ? Because it doesn't look nice in the game.

I will show my problem to you with pictures. Over "Blender" program.

enter image description here

enter image description here

I ADDED NEW PICTURE:

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ What do you want to see in those regions, if it's neither the terrain nor the skybox? \$\endgroup\$ – DMGregory Dec 8 '18 at 18:34
  • \$\begingroup\$ @DMGregory What do you think I should see? Shouldn't I use frustum culling for terrain? \$\endgroup\$ – Emre Kaya Dec 8 '18 at 18:51
  • \$\begingroup\$ Are you saying you want to see the terrain in the red regions you've marked as "I do not want to see sky box here"? If so, your frustum might be too short, causing it to cull some parts of the terrain that you didn't want to cull. \$\endgroup\$ – DMGregory Dec 8 '18 at 18:55
  • \$\begingroup\$ @DMGregory I added new picture to tell problem better. Can you check. \$\endgroup\$ – Emre Kaya Dec 8 '18 at 20:00
  • \$\begingroup\$ Stencil buffers? \$\endgroup\$ – Gabriele Vierti Dec 8 '18 at 21:31
2
\$\begingroup\$

So before you added frustum culling, the far-terrain was showing, and now it is not? I assume you draw your terrain in chunks, and some chunks are culled? Are you using an existing engine, or writing your own?

It sounds like the far-plane of the culling frustum is set too close then.

Are you sure that your projection matrix and frustum cull use the same far-distance?

UPDATE based on your new illustration:

You can not afford to cull the orange marked chunks. You either:

  1. Need to render them, and only cull behind camera, and out of the view cone.

  2. Or add fog, so that terrain chunks that lie behind your far plane are not visible, because they are fully hidden by fog. In that case, you can keep culling them out as you do now.

Players can sometimes hate fog, so maybe it's best to go for option 1, which can be achieved by moving out your clipping far plane so that it is behind everything in your world.

\$\endgroup\$
  • \$\begingroup\$ i added new picture to tell problem. Can you check and i divide terrain into grids. Is that said "chunk"? \$\endgroup\$ – Emre Kaya Dec 8 '18 at 19:59
  • \$\begingroup\$ I think "players hate fog" might be taking it a bit far. "Players hate having significant details obscured" might be fairer. There are uses of fog for realism / aesthetic effect that are quite well received (think of participatory media lighting effects for example). But if it's hiding something the player needs to see, or plastering over a visual artifact, it might not be so appreciated. ;) \$\endgroup\$ – DMGregory Dec 8 '18 at 22:23
  • \$\begingroup\$ Sure, a grid cell with terrain data, I simply call chunk, but any nomenclature will do: chunk, section, cell, part, etc. \$\endgroup\$ – Bram Dec 9 '18 at 0:17

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.