A texture jackpot

This update is sort of like two-in-one because I fixed two problems in the past few days:

  1. The texture is now made up of a series of smaller textures rather than flat pixel values.
  2. The texture generation algorithm now blends the different layers into each other.

I think the results speak for themselves:

globe-textured-beautiful.png

Next up: boring old optimizations and efficiency fixes. This globe took a full four minutes to generate, about 3.5 of which were eaten up by my super-slow heightmap generation algorithm. That’s the first target, and I think I can dramatically improve its speed.

My problem is that right now I read and write one pixel per calculation, which is horribly inefficient, as any techie can tell you that disk reads and writes are some of the slowest operations out there; it’s orders of magnitude faster to write a 1-gigabyte file than to write 1,000 1-megabtye files.

With this in mind, I think I’ll do the reads upfront, load the written values into an array and then apply the final pixel values all at once when the calculations are finished, rather than one at a time. This approach will be tricky, as I’ll have to figure a fast method of converting from 2D (a plane) to 1D (an array) because my heightmap algorithm right now works by calculating 2D distance, which sort of doesn’t work if you happen to be working with fewer than two dimensions. Ultimately, though, it’s the only way, as performance is pretty horrific right now due to this bottleneck.

Oh, and I’d also like to increase the resolution of the textures, but the efficiency fixes come first unless I’d like to wait until I’m an old man for a high-res globe to complete.

Advertisement

~ by Nate on July 20, 2009.

5 Responses to “A texture jackpot”

  1. That is one sexy ball.

  2. seriously dude that looks awesome!

  3. Looking really good.

  4. Thanks, bros! I appreciate the support!

  5. Oh yeah!? Well I think it’s AWFUL and… no, actually it is quite good.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.