Author Topic: Getting OpenGL to look as good as DirectX  (Read 7216 times)

0 Members and 1 Guest are viewing this topic.

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
Ok I'm a bit confused.... DX is using lod 0 mipmap (the default map) for everything. and Opengl uses the correct lod mipmaps except lod 0 right?
D3D doesn't support mipmaps properly, so it's always using the base map (the highest resolution one).  OpenGL will make full use of mipmaps, which means that it will use what ever mipmap level best fits the geometry.  Multiple mipmap levels can be in use on a model at the same time (when you are viewing at an angle, or perspective, etc.).  Whether you are viewing LOD0 or LOD3 of the model makes no difference for what mipmap is used, the two things are totally unrelated.  If you have a full mipmap chain, with 1024x1024 as the base, and a given LOD0 model would fit a 256x256 texture in the current view, then OpenGL will use what ever mipmap level is closest to 256x256.  There would just be no reason to use a 1024x1024 texture in that case since it would have to be filtered down to fit anyway, and that distorts the image, producing very sharp edges, coloring issues, shimmering, etc.  If you were viewing LOD3 at full screen then it might use the 1024x1024 texture because that's what best fits it.

It's the same thing as in real life, the further something is from you the less detail it has.  D3D isn't using textures properly to simulate this, OpenGL does.  It not only provides a more realistic view of the model/scene, it also can greatly increase performance since it's only using the texture size that best fits the model rather than forcing it to fit.

If you look at your model in the lab then you'll see more detail in the texture, since the model is larger in that view and it will use a larger mipmap.  Now change the LOD for that model, you'll notice that although the model geometry changes, the texture is exactly the same.  It's the same in-game, if you are futher away from the model it should have less detail in the textures, but if you get close up then you can see every single bit of detail in the texture.

It's doing exactly what it should do.

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Re: Getting OpenGL to look as good as DirectX
That map is psychadelic!
Freelance Modeler | Amateur Artist

 
Re: Getting OpenGL to look as good as DirectX
Ahhh ok now I get it, I thought lod and mip level were directly related.  Opengl's mipmapping has lost points with me then.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
Opengl's mipmapping has lost points with me then.
It's not OpenGL's mipmapping though, that's just how mipmapping works, period.  If the D3D code wasn't crap then it would do the exact same thing.  ALL games do this if they support mipmapping (which is 99.9% of them).  And until I fixed the OpenGL code to work with mipmaps properly, FSO was in that 0.1% of badly designed games.  It's a good thing, and if you didn't compare it to the broken D3D code then it would look fine.  The whole point of mipmapping is so that it isn't tied to any particular LOD.

If you wanted the texture tied to a particular lod then go back to making 3 different versions of each texture and UV mapping them to each LOD, not using mipmaps.  You'll have to deal with the loss of overall quality, the performance drop, the extra memory needed, and having to create multiple textures when you could just make one, but that's your choice. :)

 
Re: Getting OpenGL to look as good as DirectX
Oh geez... there was an even simplier solution than all this.... just move the model closer to the camera. Looks great now  :)

I was more concerned about the intel room video moreso than in-game, there hopefully you'll never be that close anyways (or want to be  :lol: )
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: Getting OpenGL to look as good as DirectX
Sounds like you need to change your LOD values

 
Re: Getting OpenGL to look as good as DirectX
Oh, I thought only lod 0 was used in the tech room.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
Oh, I thought only lod 0 was used in the tech room.
It is.  Your fix is about the only solution to get what you were looking for.

 
Re: Getting OpenGL to look as good as DirectX
Can OpenGL be forced to use the highest quality mipmap? At least for the tech room where you want the ship to show off it's best and framerate isn't as important.  I just notice that my frigate is suffering from lower mipmap level, in fact a lot of the windows aren't even displaying.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
It could do that, but I'm not going to make such a change.

Technically it's showing up properly as it is and changing it to do otherwise should be considered a bug.  Using a higher level mipmap layer doesn't necessarily look better because it still has to be filtered down and that looks bad, or really bad depending on your video card and various settings.  There have been several threads and Mantis bugs about it doing just that and the quality suffers severely.

As I've already said, it's doing exactly what it's supposed to.  Get used to it. :)

 
Re: Getting OpenGL to look as good as DirectX
Would rescaling my textures down for the tech window help? I should play around with PS's mipmap export setting.

Edit: nope still looks blurry

Double Edit: Well it looks good (sharp) in game so I guess I can quit whining about it  :D

btw Got a question about shaders.  Are they done entirely by code (using CSG or something similar) or is there map work involved?
« Last Edit: September 20, 2006, 04:48:43 am by Scooby_Doo »
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
btw Got a question about shaders.  Are they done entirely by code (using CSG or something similar) or is there map work involved?
In code.  Map work could be invovled, depending on the shader, but that would probably get folded into the material system or something and not be specifically tied to shaders.  I have to say that I'm pretty curious about what people actually come up with.  I also have a bad feeling that I might have to redesign some of the code to handle what people start doing. ;)

Normal maps (bumpmapping) will be a fair bit of map and model work though.  It will either come out about the same time as the initial shader support, or just before it.  I have/had bump mapping mostly working previously, but have since gotten side tracked by bug fixing, so it's been a while since I actually coded on that.  I don't know how long it would take to complete, or how long it is going to take to finalize the shader code that I have and integrate it into the current code base.  It probably all depends on how much pressure I get to finish the new pilot code first thing after 3.6.9 gets kicked out of the door. :)

 
Re: Getting OpenGL to look as good as DirectX
Eeeck normal mapping, my mapping won't work with normal mapping then, I reuse uv's to a certain extend.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: Getting OpenGL to look as good as DirectX
Yeah, that can be a problem with normal mapping :( It shouldn't be too bad on the Oragnic models though ;)

 
Re: Getting OpenGL to look as good as DirectX
Hmm good point.. and good since I haven't started playing with my creature meshes either (excluding zoyberg and the winged spikey thing)
I think on the normal craft, bumpmapping should hopefully be enough to give it some detail.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: Getting OpenGL to look as good as DirectX
Hey Scooby, do you know about the F3 lab?  Try it out there.  Don't worry too much about how the techroom looks if the lab shows it fine.  Also try messing with anisotropic filtering, 2X or 4X.  See if that works without much of a slowdown.

It probably all depends on how much pressure I get to finish the new pilot code first thing after 3.6.9 gets kicked out of the door. :)
The graphics people are probably going to kill me, but I for one would like the new pilot code before bumpmapping ;)

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
It probably all depends on how much pressure I get to finish the new pilot code first thing after 3.6.9 gets kicked out of the door. :)
The graphics people are probably going to kill me, but I for one would like the new pilot code before bumpmapping ;)
I kinda want the pilot file code done as well, and as quickly as possible.  The problem is just how large of an update it is, and it's a significant pain to work on given the number of changes.  The first pilot file code rewrite was about 30,000 lines worth of changes.  This new update could very well surpass 100,000 lines, even after I clean out all of the debug/testing/trash code (it currently is sitting well above 100,000 lines worth of changes, and isn't even complete yet).  Basically, I'm rather scared of it at this point.  :shaking:

Bumpmapping on the other hand would possibly be a couple thousand lines, so it's a lot less of a brain altering experience to work on that. :)

I plan to start up work on the pilot code again after 3.6.9 ships, but I doubt I'll work on it exclusively as I have too many smaller projects to work out too (graphics stuff, sound stuff, CVPs, etc.).  Luckily I can do about 139 things simultaneously. :D

  
Re: Getting OpenGL to look as good as DirectX
OMG  :eek:
How long has F3 been around? I could have used that ages ago... Whoever made this




Couple of small requests for it.. One be able to stop the rotation and move manually so we can get a good snapshot of it. two, be able to zoom, especially for capships. But otherwise wow.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Shade

  • 211
Re: Getting OpenGL to look as good as DirectX
You can rotate the model at will (including *not* rotating it) by holding down the left mouse button and moving it around.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Getting OpenGL to look as good as DirectX
You can also just click on the "Render Options" menu at the top and tick the "No Rotation" box to prevent it from rotating.  Then you can still move it with the mouse, but it will remain in that position when you let go of the mouse button.  That's the best way to get lab screenshots too, btw.