• Advertisement
Sign in to follow this  

interactive plane terrain texturing

This topic is 1776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

 

[sharedmedia=core:attachments:14126]

 

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?

 

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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 :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement