We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Alpha blended terrain
Page Index Toggle Pages: 1
Alpha blended terrain (Read 548 times)
Alpha blended terrain
Mar 20th, 2008, 9:36pm
 
Hello,

I'm currently trying to do some really basic terrain rendering, actually simple, flat 2D terrain. Multitexturing seemed to be a nice compromise between simplicity and quality.

What I would like to obtain is be something like this :
http://img395.imageshack.us/my.php?image=terraintc3.jpg

This would be a "tile", or "ground cell" as I call it, with its own textures and alpha mask for the overlay texture.

The thing is, I would like to define my alpha mask as a very small texture (in the picture the mask was 32x32 pixels and was blurred after resize) so that I can load it on the fly and have a lot of tiles kept in memory. But having a small mask means having to resize it, and it's veery slow (at least using PImage.copy ). Doing it on the fly means having a big drop in framerate. And adding blurring on top of that is even worse.

The solution I found is making masks the size of a ground cell, already resized and blurred, but this means storing a lot of huge textures and big load times. I'm not really satisfied by this...

I also thought of using shaders to render the overlay texture, but that seemed a bit too complicated for something like this.

Does somebody have any idea or hint on this subject ? Is it possible to quicken the resizing/blurring of the mask ?


Thanks !

ps: the point is to make a simple seamless game world where terrain could load on the fly
Re: Alpha blended terrain
Reply #1 - Mar 25th, 2008, 1:52pm
 
you could try the blur routine used by JohnG here; http://www.hardcorepawn.com/sparks/

its very fast.
Page Index Toggle Pages: 1