Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: black holes

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    black holes

    Hello,

    I added bump mapping to my terrain engine and it works and looks fine, but there are pixels appearing that are entirely black.. like little black spots on the surface. I am sure that they are there where the terrain is in fact darkest (due to the bump mapping), but I think it is a little abrupt, and looks bad when moving around, even more with aniso filtering. Do you understand what I mean? You can see the effect on these screenshots:
    http://de.geocities.com/westphj2003/black1.jpg http://de.geocities.com/westphj2003/black2.jpg http://de.geocities.com/westphj2003/black3.jpg

    Another person working on this project says that he thinks this could even be a bug.. does anyone of you have an idea?

    Jan

    [This message has been edited by JanHH (edited 02-26-2004).]

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,052

    Re: black holes

    Those links aren´t working.
    GLIM - Immediate Mode Emulation for GL3

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: black holes

    this is weird.. when you click on them, they don't work, but after hitting enter in the browser's url field, they do.

  4. #4
    Intern Contributor
    Join Date
    Dec 2002
    Posts
    69

    Re: black holes

    No they don't, no matter how many times you hit enter in the address bar.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    Re: black holes

    You have to copy and paste the url into a broswer. It seems to be a 'feature' of geocites websites perhaps to save bandwidth?

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: black holes

    It does looks like a bug. Maybe a clamp or sign inversion ?

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: black holes

    The third shot has some hefty texture aliasing. How, if at all, do you filter your bumpmaps?

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: black holes

    texture filtering:

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 2.0);

    glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);

    Maybe the normal maps are to bumpy? So at least you agree with me that there seems to be something wrong and this is not how it should be?

    Jan

  9. #9
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: black holes

    and this is the fragment program:

    !!FP1.0

    TEX H0, f[TEX0], TEX0, 2D; # texel from colormap

    TEX H1, f[TEX5], TEX5, 2D; # texe from normal map
    MAD H1, H1, 2.0, -1.0;

    TEX H2, f[TEX2], TEX4, CUBE; # texel from normalization cube map for diffuse
    MAD H2, H2, 2.0, -1.0;

    DP3 H3, H1, H2;
    MUL H4, H3, H0;

    TEX H5, f[TEX3], TEX4, CUBE; # texel from normalization cube map für specular
    MAD H5, H5, 2.0, -1.0;
    DP3 H5, H1, H5;
    POW H5, H5.x, f[TEX7].x; # f[TEX7]: specular exponent

    TEX H6, f[TEX5], TEX7, 2D; # TEX7: spec map
    MAD H5, H6, H5, H4;

    MAD H5, H0, p[0], H5; # p0: ambient light

    MOV o[COLH], H5;

    END

    I think this is quite ordinary.. if you see anything strange about it, please let me know

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: black holes

    I guess the problem comes from the specular highlights. I found out that when changing the vertex program so that the specular highlights get entirely wrong, the whole scene gets totally dark. this seems strange to me as I always thought of the specular part simply ti be ADDED to the diffuse lighting, so that it could under no circumstances make anything DARKER, only brighter. But this seems to be the case here.

    And this can only be if the dot product between the normalized half vector and the normal vector coming from the normal map has a negative result. It's too late to be good in math but I think in general, this is possible, isn't it?

    I think the specular highlights are wrong anyway as they get brightest when looking perpendicular down to the ground, no matter where the light comes from .

    So I guess a combination between the effect of having a negative result of the dot3 operation together with broken specular highlights are the reason for the black pixels.

    Do you think that this sounds reasonable?

    Jan

Posting Permissions

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