Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Texturing a terrain (texture splatting?)

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    15

    Texturing a terrain (texture splatting?)

    Hello, everyone

    I am working on terrain editor but interested on a way to improve appearance and performance so I put it on a octree, now the texture doesn't look convincing to then I saw the farcry map editor on youtube http://www.youtube.com/watch?v=8pkicqIO-8I what I deducted from it is that they are using maybe texture splatting but then every texture would be drawn as independent squads so they wouldn't be using share texture coordinate making it hard use vertex share
    Click image for larger version. 

Name:	squads.jpg 
Views:	120 
Size:	9.1 KB 
ID:	818
    so I was thinking if there is a way to generate the texture coordinates on a shader maybe, I though on using gl_VertexID to identify vertex but that doesn't exist on OpenGL ES any help on this?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	squads.png 
Views:	90 
Size:	4.2 KB 
ID:	817  
    Last edited by jmanuelexe; 07-21-2012 at 06:31 AM.

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    6
    then every texture would be drawn as independent squads so they wouldn't be using share texture coordinate making it hard use vertex share
    nope
    You have, for example, 4 color textures and 1 splat texture. You read the splat texture and decide which color texture should be used for this fragment.
    Example here http://supcom.wikia.com/wiki/Height-...ols#Texturemap

    The color textures are tiling so they can all use same texture coordinates.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    The problem with using 4-channel splatting texture where each channel is exactly attributed to a single albedo map is that, well, you can have at max 4 albedo textures with this approach. An alternative is what's also called stenciling where each albedo map is assigned a single stencil. You can reduce the stencil size substantially if you don't need pixel-precise mappings of color (which most users won't give a damn about anyway) and compress them well since for most stencils the prevalent color will be black.

    For simple examples, the single splatting texture approach is ok though.

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    15
    My confusion was since in texture splatting you have a many big square area like regions where many small quads which would have to 1 or 3 texture like grass dirt etc, would be cover with just one alphamap per region I thought I have to draw every small tiling one as separate squads now I realize that I only need to scale the textures so it could be use as many small tiles and the use the alphamap with no scale (which is a small texture too stretch)that cover the region, like that works great and few memory was use obviously only 4 texture could be use for each regions assuming not using cube maps which for me it kind of defect the purpose of reducing the texture size.

    Quote Originally Posted by thokra View Post
    The problem with using 4-channel splatting texture where each channel is exactly attributed to a single albedo map is that, well, you can have at max 4 albedo textures with this approach. An alternative is what's also called stenciling where each albedo map is assigned a single stencil. You can reduce the stencil size substantially if you don't need pixel-precise mappings of color (which most users won't give a damn about anyway) and compress them well since for most stencils the prevalent color will be black.

    For simple examples, the single splatting texture approach is ok though.
    how those that work?
    Last edited by jmanuelexe; 08-29-2012 at 12:00 PM.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    In my last post I mentioned pairing a stencil texture, basically a single channel map, with a color texture with reduced resolution. Thinking about it and taking it a little bit further, you can still go and use multiple RGBA textures als stencils textures packing 4 stencil values. Just increase the number of RGBA textures. You can map each RGBA stencil texture, or splatting texture or whatever, to 4 color textures, 2 RGBA stencil textures to 8 colors and so on.

    The benefit is: more applicable color maps while packing all information into 4 channels of each stencil texture.
    The drawback: higher memory usage, more texture fetches -> higher bandwidth requirements.

    Plus, the more color textures you can access, the more potential ALU work may be incurred. Say you got 2 stencils, and a you determine that at a fragment you have all 8 color maps influencing the fragment -> 8 multiplies (each color is weighted by a non-zero stencil value) and 8 additions (add all weighted colors to produce the fragment color) in a brute force approach. And this is only albedo. No lighting and stuff yet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •