Results 1 to 4 of 4

Thread: texture clamping problem

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2002
    Posts
    3

    texture clamping problem

    since i got really big textures about 1500x1000
    pixels, i divided them up into many 256x256 textures and applied them to as many quads.

    because of linear filtering i get the problem, that the seams between the patches are messy/visible. so i clamped the textures, to achieve a better filtering result.

    the actual problem is, that my textures are just half as bright in the clamped region as the original texture. this ends up in dark visible seams. what could be the reason for this undesired clamping result?

    thanks, Henon
    ::: Henon :::

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: texture clamping problem

    the actual problem is, that my textures are just half as bright in the clamped region as the original texture. this ends up in dark visible seams. what could be the reason for this undesired clamping result?
    [/B]
    When tiling textures,like you are trying to do, I learned a technique a while ago the worked very well.
    I am assuming that, when you split up your textures, you make two textures facing each other have the same border texels? This is a must since you use linear filtering. In linear filtering the texel in the middle of the texture is the only texel with its original color.
    Even this will not give you satisfying results though. The trick is to stretch the border texels half a pixel. This way a border will only have one pixel(two halfs).Here is an excellent explaination of this technique: http://www.fractalscape.org/TextureSeams

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2002
    Posts
    3

    Re: texture clamping problem

    hmm, there must be an easier way.

    when tiling a large image you get linear filtering artefacts if you use GL_REPEAT wrap function.

    my approach is: clamping! should work, because the error is REALLY NOT NOTICABLE.


    my problem is, that the border pixels of my textures which were created with clamping are exactly the last row of pixels as it should be but TOO DARK.

    Anyone had problems with clamping?
    ::: Henon :::

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: texture clamping problem

    Sound like your using GL_CLAMP which will make your edge pixels take on the texture border color. The default border color is black which would darken your edge texels. Use CLMAP_TO_EDGE instead and you'll be fine. CLAMP_TO_EDGE is an extension to OpenGL 1.1, but it's standard since 1.2 I think. There are many old threads in theseforums (at least in advanced) about the difference between CLAMP and CLAMP_TO_EDGE so a search would probably turn up lots of info.

Similar Threads

  1. problem with depth clamping
    By TroyMcLure in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 11-14-2010, 12:54 PM
  2. 32F texture clamping?
    By IneQuation.pl in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 11-20-2008, 02:32 PM
  3. Depth Clamping problem
    By mikeman in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 02-03-2004, 09:16 AM
  4. texture clamping
    By tellaman in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 09-17-2003, 03:16 PM
  5. clamping a 3d texture
    By Arath in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 09-19-2002, 04:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean