Jump to content

  • Log In with Google      Sign In   
  • Create Account


Terrain: Hardware instancing for texture blending, or texture blend maps ?


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 PhillipHamlyn   Members   -  Reputation: 454

Like
0Likes
Like

Posted 01 September 2012 - 09:43 AM

As a general design pattern, for situations like terrain tiles where they all share the same geometry (height calculated from heightmap in shader) which of these two approaches is the "best" for passing texture blend (or other per-tile info) into the shader ?
  • Load the texture blend data into the shader by using a Texture and texture lookups (each channel indicating weight of texture)
  • Load the texture blend data into the shader by using a hardware instanced Vertex set in addition to the unvarying geometry data
For the sake of comparison, my terrain tiles have the same number of geometry vertexes as the heightmaps do pixels, so there is the same quantity of data flowing between the CPU+GPU but I have assumed up until now that the compression capabilities of Textures mean they are superior to using Vertex data where there is a choice of methods.

Is there a generally preferred way of passing data to a shader where we could use either harward instanced vertex data OR texture data to represent the same thing ?

Thanks,

PhillipH

Sponsor:

#2 phil_t   Crossbones+   -  Reputation: 3222

Like
1Likes
Like

Posted 01 September 2012 - 11:28 AM

I don't think there is really a preferred choice. But note that if you're using per-vertex data as opposed to index texture lookups in the pixel shader, you will get different results. Generally, index texture lookups in the pixel shader would produce nicer results I think (at a higher performance cost), since you're interpolating between 4 values instead of 3 that depend on your terrain's triangulation..

Texture lookups in the vertex shader should produce the same results as per-vertex data, of course. But I think some older graphics cards have poor performance doing texture lookups in the VS.

#3 PhillipHamlyn   Members   -  Reputation: 454

Like
0Likes
Like

Posted 01 September 2012 - 03:15 PM

Phil_t,

Thanks - a useful distinction between 3 and 4 way interpolation. On the whole I think I'll keep passing in my data using textures rather than hardward instancing.




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