Results 1 to 4 of 4

Thread: More on the green line problem, bug in Clanlib?

  1. #1
    Peasant pTymN's Avatar
    Join Date
    Oct 2006
    Location
    Durham, NC
    Posts
    9

    Default More on the green line problem, bug in Clanlib?

    I had started a previous thread on this topic, but I couldnt figure out how to change the title from "Solved" to "bug". Using Clanlib, on ATI cards, I see a filtered green line appear along the right and bottom edges of a rotated surface.

    I tracked it down to a specific difference in the Windows XP drivers for ATI and NVidia. If I make a 100x100 surface, it uses a 128x128 texture. What color is used for the uninitialized texels? Is that set by clanlib or does it remain uninitialized? The ATI filtering seems to be slightly off, because it is using the uninitialized texels adjacent to the right and bottom edges, and those texels are bright green opaque.

    I confirmed this bug by resizing all my surfaces to be power of two along the X,Y dimensions, and the green line problem goes away. This may not technically be a Clanlib issue, but should be investigated thoroughly.
    Screenshot of my project. Converted from Lisp to C++ and piled on even more optimizations. I can perform sorted collision testing between 20 objects at ~800 fps. Dynamic line-circle collision test source.

  2. #2

    Default

    I've a similar problem here: I have some surfaces with a TGA-Image on it (20x20 pixels). What I do is to move them on screen (like stars coming "out" of the screen) and scaling them, starting with a small scale-factor and increasing it up to 1.0. The lines are flickering, i.e. they are not always visible.

    I also had these lines with a scaling of 1.0 (constant) when I used CL_Surface::draw(float x, float y) and did NOT cast the parameters to int. When I do so, the flickering is gone - so it seems the ClanLib/OpenGL-internal cast from float to (integer) screen coordinates makes problems here.

    However, this is not a solution for the problem with scaling, as it's not a good idea to cast a value between 0.0 and 1.0 to int

    Oh, and I also have an ATI card, but with Windows Vista.

    EDIT: Strange effect: When I set the color of the surface to red, i.e. set_color( 1.0f, 0.0f, 0.0f ), the lines seem to be gone. I first thought it's only a matter of contrast, because my background is black, but even if I look very carefully, I don't see the lines. However, that's not a solution - it's just strange
    Last edited by kullerhamPster; 03-21-2007 at 10:09 PM.

  3. #3
    Peasant pTymN's Avatar
    Join Date
    Oct 2006
    Location
    Durham, NC
    Posts
    9

    Default

    My theory is that if you resize the image to 32 by 32 and just add transparent pixels for the extra space, you won't see the lines anymore. Also, the fact that the lines show up sometimes and sometimes don't can be misleading. It isn't strictly int/float conversions or anything like that. An ATI card uses bilinear or trilinear filtering by default, and the particular alignment of the last row of texels and the last column of texels can vary slightly with a large effect on how the filtering is done.
    Screenshot of my project. Converted from Lisp to C++ and piled on even more optimizations. I can perform sorted collision testing between 20 objects at ~800 fps. Dynamic line-circle collision test source.

  4. #4

    Default

    Quote Originally Posted by pTymN View Post
    My theory is that if you resize the image to 32 by 32 and just add transparent pixels for the extra space, you won't see the lines anymore. Also, the fact that the lines show up sometimes and sometimes don't can be misleading. It isn't strictly int/float conversions or anything like that. An ATI card uses bilinear or trilinear filtering by default, and the particular alignment of the last row of texels and the last column of texels can vary slightly with a large effect on how the filtering is done.
    You're right, with an image of 32x32 pixels, the green lines are gone, both with scaling and with using float values as arguments for "draw".
    Thanks a lot

Similar Threads

  1. Video in ClanLib
    By d_oilen in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 06-04-2007, 02:52 PM
  2. Green border around rotated sprite on ATI cards - Solved!
    By pTymN in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 11-06-2006, 08:44 PM
  3. The green voice!
    By in forum Dink Smallwood HD
    Replies: 0
    Last Post: 12-03-2003, 06:04 PM
  4. Legend of the Green Dragon
    By Broadband in forum RTsoft Tavern
    Replies: 9
    Last Post: 07-28-2003, 01:11 AM

Bookmarks

Bookmarks

Posting Permissions

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