Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


interactive plane terrain texturing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 velkyel   Members   -  Reputation: 143

Like
0Likes
Like

Posted 10 March 2013 - 05:20 AM

hello,

 

i'm trying to do simple textured terrain - terrain is plane xy with base repeatable texture.  I have about 16 repeatable textures which i wan't to interactively place at plane as textured quads with one alpha mask.  Each quad is aligned to grid a randomly rotated.  Interaction is important because this texturing is part of game editor.  Each grid cell can contains one textured quad which has double size as grid size.  This technique works quite nice:

 

photo.jpg

 

Target hardware is ios/ipad so i can't use alpha testing because it's too slow.  Only blending, but overdraw is too heavy.  Is there any another good technique with less fillrate?  I tried render all these rotated quads into halfsized FBO and then blend fullscreen quad into main back buffer - it's much faster but it looks terrible.  Any idea please?

 

Attached Thumbnails

  • photo.jpg


Sponsor:

#2 C0lumbo   Crossbones+   -  Reputation: 2346

Like
1Likes
Like

Posted 10 March 2013 - 12:10 PM

It'd be faster to combine your multiple textures in a shader, instead of doing multiple passes and alpha blending. You'd want to make sure you have a few permutations of your blending shader so that for each chunk of terrain, you use a shader that handles only the exact number of textures necessary. You should also make sure that all your texture reads are non-dependent (i.e. your vertex shader should pass UVs to the pixel shader 'ready to go' and don't pack multiple into a vec4 or anything).

 

I believe this approach will be faster, but I'm not sure if it'll be fast enough. Particularly on something like an early iPad where the GPU is very underpowered relative to the number of pixels.



#3 velkyel   Members   -  Reputation: 143

Like
0Likes
Like

Posted 14 March 2013 - 10:15 AM

thanks for advice.  It's faster but it's not enough.   I tried 3 shaders - flat, 2 textures combiners (up and right borders) and 4 textures (up, right, diagonal).   Mixing 4 textures and mask slows whole drawing down too much (all texture reads are non-dependent).  Because rendering textured surface is not main game visual feature so i decided to put together much simpler and faster way which is not so nice :(






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS