Mark Sachs (ksleet) wrote,
Mark Sachs
ksleet

  • Mood:
  • Music:

I sense someone who is jealous of my outside the box genius! Jealous with ENVY!

So I tried out that new clipping idea for the landscape engine. It worked pretty well!



This first image demonstrates how clipping works. I've created a triangle with one point just below the camera and the other two points out ahead of it in the direction that it's facing. I then pretend as if that triangle is being rasterized onto a video display and draw only the span of landscape within the triangle. (Who says old-school software rendering concepts are useless these days?)

Having confirmed that it behaves as expected, I could then simply extend the points of the triangle so they are just offscreen. The result is that we have identified the segment of the landscape that's visible to the user, and can take care to process and render only that segment of the landscape.



I was able to double the draw distance and still maintain an acceptable frame rate. Now that's what I'm talking about. At this point, we start having to worry about the problem of the entire map being visible at once and visibly repeating, since it's only 256 tiles across!

I also played with the camera a bit, trying out some methods to make it lag behind the aircraft's motion. This both provides more attractive camera angles when turning, and smooths out jerky motion even if the aircraft is moving in a jerky fashion. It works reasonably well, but is unfortunately framerate-dependent; that's a problem I have yet to resolve.
Tags: neon galaxy
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 6 comments