Chatroom
 

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Bad Astronomy and Universe Today Forum > General > Off-Topic Babbling
Register FAQ Members List Calendar Mark Forums Read

   

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 29-June-2007, 11:57 AM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default OpenGL programming

Hi!

I'm programming some experimental flight simulation software in OpenGL.

Now I've got a tiled (repeated) texture on a flat plane, nice. However, it apears to suffer from major aliasing issues, streets and other line elements in the BMP texture "flicker" because they are continuously jagged in a different way. Well, if you can program OpenGL you know what I mean.

Is there a simple way to prevent this from happening? It need not be a superadvanced filtering/rendering technique (well, if you've got one I can easily implement, go ahead ). If you have a simple way to ever so slightly "smush out" the texture or render such that the effect disappears, I could also give it a go.

I've never worked in OpenGL before, so it's all new to me. Well, so far so good!

here's a screenshot:

http://aycu40.webshots.com/image/206...3556640_rs.jpg

You can notice the aliasing (?) problems in the lower part of the screen, especially in the narrow streets. n motion, the end result is a bit as if you're flying above water if you know what I mean, the pixels appear to swim/wave.

Any help on how to easily lessen this problem are appreciated.
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #2 (permalink)  
Old 29-June-2007, 12:12 PM
777 geek's Avatar
777 geek 777 geek is offline
Senior Member
 
Join Date: Jan 2006
Location: Aberdeen, UK
Posts: 886
Default

Not OpenGL! I tried to learn that, but my compiler could work with even the demonstration programs.
__________________
2 good 2 need 4 engines
Reply With Quote
  #3 (permalink)  
Old 29-June-2007, 03:16 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

I would think OpenGL would have an Anti-Aliasing switch. Then again, there's a lot of things I think should be, but aren't. I gave up programming after BASIC (you don't have aliasing issues in DOS!).
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
  #4 (permalink)  
Old 29-June-2007, 04:49 PM
jumbo's Avatar
jumbo jumbo is offline
Senior Member
 
Join Date: May 2002
Location: Cardiff, Wales, UK
Posts: 627
Default

Are you MIP mapping your textures?
Textures that are more distant from the viewer have this technique applied. Basically you vary the resolution of the textre depending upon the distance to the viewpoint. It essentially anti aliases the texture before its applied to the geometry IIRC.

Im sure theres plenty of practical tutorials on line. (Its been ages since ive written code to do it and its lurking somewhere in my code but goodness knows where!)
Reply With Quote
  #5 (permalink)  
Old 29-June-2007, 06:44 PM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

"not openGL" is not an option, since the simulator requires it .

If I could find how to apply mipmaps I could try that. I know there's option for mipmapping.

There are options for anti-aliasing, but only for lines, points and polygons, hence geometry. I've found none for texturing.

The online tutorials couldn't really help me.

I hope mipmapping helps, but since the aliasing problems are already occuring quite in front of the screen, I'm not too sure.

Well, thanks for the help so far!
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #6 (permalink)  
Old 29-June-2007, 06:54 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

This is all greek to me, but perhaps this site will help?
Also, here's a source-code sample of OGL Hardware AA

Again, I've literally been out of programming since Basic (technically went into Vis. Basic in win95). My only experience with anything more has been some game modding for Quake (the first). So these links very well could be junk, but they looked like they are what you're after.

FSAA (full screen antialiasing) should take care of both the geometry and the textures, methinks.
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
  #7 (permalink)  
Old 29-June-2007, 07:54 PM
jumbo's Avatar
jumbo jumbo is offline
Senior Member
 
Join Date: May 2002
Location: Cardiff, Wales, UK
Posts: 627
Default

Theres some bits about applying mipmapping at the link below:
http://64.233.183.104/search?q=cache...ient=firefox-a

If you can get hold of the OpenGL Superbible its also covered in Chapter 8 on Basic Texutre mapping (or is in my copy)

The Nehe tutorials have an example using mipmapping in them.
http://nehe.gamedev.net/data/lessons....asp?lesson=07
Its around about the section with the // Create MipMapped Texture comment

Hope this does the trick!
Reply With Quote
  #8 (permalink)  
Old 02-July-2007, 09:14 AM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

I checked NeHe, but its mipmapping tutorial didn't help (it's texturing tutorial did for showing me how to load a bitmap ).

I'll check out the rest, thanks all!
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #9 (permalink)  
Old 18-July-2007, 06:04 PM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

I managed to apply texture mipmapping. No more artifacts now. A bit too blurry in fact, but I'm already at linear_mipmap_linear, so I think there's no possibliity to get more detail. Better to have a blurry texture (in the distance) than artifacts in this prog, so it's fine!

For the grid alternative to the texture I have to cull quite near, but that way also there most artifacts are gone. This is getting somewhere .
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #10 (permalink)  
Old 20-July-2007, 11:36 AM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

Now I also have a texture showing a simple "black lines on blue" grid. The mipmapping makes the grid lines disappear soon. Any tricks to reduce this? Increasing the texture bitmap size such that the lines are more pixels wide? As mipmapping reduces the amount of pixels per mipmap, that should allow more mipmaps to still show the lines...in theory...

I'll try things on monday.
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #11 (permalink)  
Old 20-July-2007, 02:55 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

If it's just a grid, can't you use some basic programming to just draw the lines on the fly instead of using a bitmap?
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
  #12 (permalink)  
Old 20-July-2007, 07:33 PM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

I did have a grid based on line commands. Too much side effects in the distance, and no possibility to smooth them out any more than with standard anti-aliasing. That's why I tried switching to textured grid. It also appears to take less processing time.
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #13 (permalink)  
Old 20-July-2007, 07:49 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

Well, do you have to mipmap every object, or can you have Mip's for the ground texture, then create a seperate plane for the grid texture and not mipmap that one?
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
  #14 (permalink)  
Old 20-July-2007, 08:22 PM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

Then you'd still have the problem that the grid texture would get all messy and show moiré and other effects far away from the camera. But anyway, my program shows OR the grid OR the ground texture, not both at the same time.

A mipmapped grid texture seems to do the trick, if I could get it to keep the lines clear just a bit more. I'm quite confident that a bigger texture with more pixel width for the lines will solve it, as it will keep the lines more than one pixel wide for the first few mipmap levels. If it doesn't smudge too much in the process, that should improve things. If not, I'd have to try something else .
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #15 (permalink)  
Old 20-July-2007, 08:27 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

Well, sounds like you got it under control. I've never seriously programmed, and definately not in 3d. I stick to the modeling/animating end of things.
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
  #16 (permalink)  
Old 20-July-2007, 08:34 PM
Nicolas's Avatar
Nicolas Nicolas is offline
Senior Member
 
Join Date: Sep 2004
Location: Belgium
Posts: 11,546
Default

Well, that part is quite similar .
__________________
To the regular visitor of internet bulletin boards it is clear that it's an excellent idea your parents get to choose your real name.
Reply With Quote
  #17 (permalink)  
Old 20-July-2007, 08:39 PM
Fazor's Avatar
Fazor Fazor is offline
Senior Member
 
Join Date: Oct 2006
Location: Near Columbus, Ohio
Posts: 4,854
Default

I don't worry about mipmapping though. And most of my stuff is for animation, not real-time, therefore I can solve aliasing issues by sampling and, well, using anti-aliasing.
__________________
I'm like one of those idiot savants...well, except for the savant part.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which programming language are you? ToSeek Off-Topic Babbling 23 23-August-2006 05:03 PM
Fox has worst programming, say parents hewhocaves Off-Topic Babbling 50 21-October-2005 05:26 AM
Major advance in understanding the programming of life.... junkyardfrog Off-Topic Babbling 2 05-May-2005 08:37 AM
Solar System Model for Programming Purposes dartmanx Astronomy 4 20-October-2004 07:59 PM
Moon Hoax on PAX TV mcclir Conspiracy Theories 12 10-June-2004 11:07 PM


All times are GMT. The time now is 11:56 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
©  2006 Bad Astronomy and Universe Today