Results 1 to 11 of 11

Thread: OpenGL Rendering Question?

  1. #1

    Thread Starter
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157

    OpenGL Rendering Question?

    Hi,
    I have attached a screenshot of my first official 3D game program. I have created 'pine trees' in a snowy valley. Look closely at the pine tree in the foreground. Notice the texture is 'pixelated' (I think this is the right term)...those little rectangles...

    How do I smooth them out?

    Regards,
    ChuckB
    Attached Images Attached Images  
    I learn Robotics, Electronics and Game Programming at http://www.gameinstitute.com

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    http://nehe.gamedev.net/

    Look at the tutorial "texture filtering"... and also, it still won't look very good, try moving one power of 2 up (ex if you're using 32x32 use 64x64, keep going until it looks good ! )
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    Hi,
    I am using 64x64. I suppose I could go up and try 128x128.

    I know from looking at spheres made of dozens of polygons, that often you can select an option that smooths all of the edges on the polygons so they look round. I was wondering if there is a GL command to do this.

    Regards,
    ChuckB
    I learn Robotics, Electronics and Game Programming at http://www.gameinstitute.com

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    That effect is done by computing normals differently... try doing a google on rounding normals or something to that effect.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    Hi Sas,
    I think I get it now. I don't have any lighting turned on yet. Once I do, then I can add and then modify the normals that are necessary for OpenGL to calculate stuff like reflectivity.... am I on the right track?

    Regards,
    ChuckB
    I learn Robotics, Electronics and Game Programming at http://www.gameinstitute.com

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes. It's called Gouraud Shading.

    If you expect your textures to be seen from very near and you don't repeat them you should consider 256x256 textures.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    CornedBee,
    I'll give the 256x256 a try.....

    When you say 'if you don't repeat'...does that mean the GL_REPEAT flag?

    Regards,
    ChuckB
    I learn Robotics, Electronics and Game Programming at http://www.gameinstitute.com

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I'm not sure in GL, but he means that you'll have the texture tiled on a surface. (like a 2x2 field or something to that extent!)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I don't know OpenGl.

    But if you have a square that gets extended to 512x512 pixels on the screen then a 256x256 texture usually gets stretched to 512x512 pixels. But if you create a seamless texture (that is, the left edge and the right edge aren't seen when placed next to each other, same for top and bottom) you could just place the texture four times on the square, resulting in no stretching at all.
    Of course this means that the texture shrinks to 128x128 on a 256x256 square or the appropriate mip map level is used.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    Hi,
    I understand what you are saying now.

    I use paintbrush to create the textures, so if there are major lines I make sure that they begin on left side at the same vertical position as the right side. This allows me to group them several tiles together so they are seemless.

    I am attaching one of my more complicated textures. Complicated because it required matching major lines and colors on all four edges. It makes for a nice wall.

    I tried the 256x256 texture...looks better...but not great. I still have a few tricks up my sleeve.....

    Regards,
    ChuckB
    Attached Images Attached Images  
    I learn Robotics, Electronics and Game Programming at http://www.gameinstitute.com

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    This is a cool texture.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width