Results 1 to 7 of 7

Thread: Texture Problem on distance elements

  1. #1
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Texture Problem on distance elements

    hi,

    i have a texture problem. sometimes on objects far away from my camara the texture looks strange..
    i will add 2 screens : near and far.
    i allready use mipmaps but that does not solve it..

    thanks for ideas
    uwi
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

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

    Re: Texture Problem on distance elements

    This looks like Z-fighting.
    Are you sure to draw the geometry only once ?
    Old but useful to know : http://www.sjbaker.org/steve/omniv/l..._z_buffer.html

  3. #3
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Texture Problem on distance elements

    hi zbuffer,

    thanx first of all, but this was not the solution.
    itīs only drawn once per frame.
    but a strange thing is.. this objects ( cubic planes ) have this texture on all sides, but this effect only apperes on the top of them , not at the bottom...
    can you think of a reason for this ?

    thanx a lot
    uwi
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

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

    Re: Texture Problem on distance elements

    Then this is definitely z-fighting.
    If you reverse the drawing order of faces, the "effect" will happen at a different place.
    What are your glFrustum / gluPerspective / projection values ?

  5. #5
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Texture Problem on distance elements

    hi,

    thanx ! one value here was defnetly wrong and lowed as well my fps !

    so, i only have a call to:
    gluPerspective (60, 1.6, 0.5, float(sight) ); //(1280x800)
    in my script.
    no glFrustum call and i am not quite shure what you mean by projection ?
    i am not so familiar with opengl, can you give me a hint pls.

    thanx
    uwi2k2
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  6. #6
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,789

    Re: Texture Problem on distance elements

    Code :
    gluPerspective (60, 1.6, 0.5, float(sight) ); //(1280x800)
    Depending on the value of sight your znear is too low. Try changing it to 1, 2, 3, 4 etc until you find an acceptable value that gives you the scene you want but doesn't z-fight.

  7. #7
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Texture Problem on distance elements

    hi,

    and thanx , thanx thanx !!
    that was it. i never tought of that value.
    i guess i need to read even more on this topic.

    cu
    uwi
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

Similar Threads

  1. Texture Flicker in the Distance
    By Revanz in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 11-27-2015, 11:09 AM
  2. Point distance attenuation problem?
    By Dormouse in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-12-2010, 05:48 AM
  3. Problem adding elements to menu!!!!
    By angeldarkholme in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-17-2005, 01:39 AM
  4. problem with distance from plane algorithm
    By narayan2005 in forum OpenGL: General
    Replies: 3
    Last Post: 06-30-2005, 02:17 AM
  5. Problem with Color or Polygones in distance
    By Solobase in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-23-2004, 09:39 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