Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Direct3D + OpenGL?

Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 13:03
Looking at my low FPS rate and counting the different numbers and types of video cards out there, I kept having a question for some time. What if SL could work at choice with both OpenGL or Direct3D? I hope this is not a stupid question... I remember for example Unreal Tournament classic had a way to choose one of the two and that helped a lot. I think SL currently works on OpenGL only if im right, and even if I remember Direct3D was slower in some situations, maybe a way to switch to the one that suits your video card best wouldn't be too bad. What do you think?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-18-2008 13:15
There are two problems with Direct3D, in addition to whatever technical hurtles there might be in even incorporating it in the first place. First, it's Windows-only. Mac and Linux users wouldn't be able to use a Direct3D based viewer. Second, since Direct3D is a Microsoft product, LL would be subject to Microsoft's licensing requirements, which is a direction they probably wouldn't want to go in.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-18-2008 13:15
I think that LL chose OpenGL because of the 'Open' part. It is an open (free to use) standard for 3D graphics. It's also available for many platforms like Windows, Mac, and Linux. Microsoft's Direct3D is only available for Windows (and other Microsoft) OSs and a license must be purchased before you are allowed to use it.

http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D
_____________________
I heart shiny ! http://www.shiny-life.com
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 13:28
Hmm that changes things a bit. But anyway Opengl is faster from what I remember. Was just wondering if getting a direct3d version of SL could somewhat improve fps when opengl cannot.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-18-2008 14:32
From: Mircea Lobo
Was just wondering if getting a direct3d version of SL could somewhat improve fps when opengl cannot.

I wouldn't expect it would. The biggest reasons why SL runs as slowly as it does have little to do with the software itself. Most of it is due to the fact that the world's assets are unoptimized, since they're made by users instead of by professional game artists.

In games, every model is made with the least possible amount of polygons, and the smallest possible textures. But in SL, people routinely use textures that are way too big, and make items with insanely high poly counts.

Take a hair piece made from a few dozen twisted toruses, for example. You're looking at maybe a 500-1000 polygons per lock of hair. Multiply that by 50 strands, and that's 25,000-50,000 polys, just for hair. Consider that the average human model in a game has only 3000-5000 polygons for the entire model, and I think you can see the problem. You could have 10 entire characters on-screen in a game for what it costs, computationally, to draw just that one hair piece in SL.

Then you have the people who put 1024x1024 textures on little 2-foot signs, where a 128x128 would work just fine. Consider that every 1024x1024 consumes 3 or 4 megabytes of video memory, and every 512x512 uses 768K or 1MB (depending on bit depth). Put a few hundred of those in view, and you'll make almost any video card choke. A 256x256, however, uses just 192K or 256K, and a 128x128 uses only 48K or 64K. You could have over sixty 128x128's on-screen for the same cost as just one 1024x1024.

Those numbers add up really fast. The average mall in SL has hundreds of megabytes, or in many cases several gigabytes, worth of textures on display. But the average video card can only process a couple hundred megabytes at a time for everything in the scene, so of course they trip and fall in those situations.

There are, of course, many factors that are well beyond our control as users, but there are plenty of things we CAN control that people constantly misuse. Go to an empty island with nothing on it, and you'll see your framerate soar. Put a well optimized build on it, and will stay almost as high. Then go back to the poorly thought out mess that is 90% of SL, and you'll watch your FPS plummet again.

Bottom line, could the software be better? Absolutely. But is that what's immediately killing your FPS? No. Most of it is due to user error.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
04-18-2008 14:41
Ditto what Chosen says, plus some:

Even moreso on the back end. People blithely use/wear tons of prims, often with one or more scripts in each one. They then wonder why they can hardly teleport or cross sim borders even. Well, when you are forcing the simulator to transfer and start running potentially THOUSANDS of scripts every time you do, it chokes and your TP / border crossing fails.
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 15:07
Indeed... I guess Chosen's point made me see things better. Of course software can improve it too... I mostly got used to modern rendering taking up most FPS however, not models theirselves.

Still, how does this explain that an option such as Atmospheric Shader is what takes 35% of my fps away? Or anisotropic filtering or even anti-aliasing, which in other games make almost no difference (was really surprised to see anti-aliasing actually slowing my sl down... never happened to me in any other 3D application since SL with Windlight rendering).
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
04-18-2008 15:24
Well, I can't speak to the new WindLight "features". They barely work for me because I apparently am so far behind in technology with my system. Thus the shaders could be because of the way they are coded, or could be something specific to the way your specific card/driver combo runs them.

As for anisotropic filtering, it will have more impact in SL, because it is a mid-pipeline transformation on texture data before it is applied to a mesh. The more and larger textures displayed, especially at distance, the slower it will be.

As for antialiasing, it is usually a post-process effect (which means it is done on the final scene image, either by averaging multiple frames, or using sampling techniques). It should not slow down appreciably more in SL than in any other game with similar settings. That is probably the culprit, though, some games control AA directly, and may not be using the full AA settings, whereas SL may be using them set at max.

Anyway, all the things you have listed thus far are totally related to the client and your system hardware, drivers, OS, and settings.
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-18-2008 15:26
Well said,, Chosen and Talarus!

I wish that more people realized that inefficient content and overly-complicated attachments are the real culprits in most cases of low framerate and poor client performance.
_____________________
I heart shiny ! http://www.shiny-life.com
EliteData Maximus
Technical Geek
Join date: 3 Oct 2007
Posts: 298
04-18-2008 15:29
From: Chosen Few
I wouldn't expect it would. The biggest reasons why SL runs as slowly as it does have little to do with the software itself. Most of it is due to the fact that the world's assets are unoptimized, since they're made by users instead of by professional game artists.

In games, every model is made with the least possible amount of polygons, and the smallest possible textures. But in SL, people routinely use textures that are way too big, and make items with insanely high poly counts.

Take a hair piece made from a few dozen twisted toruses, for example. You're looking at maybe a 500-1000 polygons per lock of hair. Multiply that by 50 strands, and that's 25,000-50,000 polys, just for hair. Consider that the average human model in a game has only 3000-5000 polygons for the entire model, and I think you can see the problem. You could have 10 entire characters on-screen in a game for what it costs, computationally, to draw just that one hair piece in SL.

Then you have the people who put 1024x1024 textures on little 2-foot signs, where a 128x128 would work just fine. Consider that every 1024x1024 consumes 3 or 4 megabytes of video memory, and every 512x512 uses 768K or 1MB (depending on bit depth). Put a few hundred of those in view, and you'll make almost any video card choke. A 256x256, however, uses just 192K or 256K, and a 128x128 uses only 48K or 64K. You could have over sixty 128x128's on-screen for the same cost as just one 1024x1024.

Those numbers add up really fast. The average mall in SL has hundreds of megabytes, or in many cases several gigabytes, worth of textures on display. But the average video card can only process a couple hundred megabytes at a time for everything in the scene, so of course they trip and fall in those situations.

There are, of course, many factors that are well beyond our control as users, but there are plenty of things we CAN control that people constantly misuse. Go to an empty island with nothing on it, and you'll see your framerate soar. Put a well optimized build on it, and will stay almost as high. Then go back to the poorly thought out mess that is 90% of SL, and you'll watch your FPS plummet again.

Bottom line, could the software be better? Absolutely. But is that what's immediately killing your FPS? No. Most of it is due to user error.
i have to totally agree with you.
especially on the mall part with vendor boards that use 1024x1024 textures.
this is the primary reason why you see the memory useage for SL on a windows box shoot sky high, hence why i keep my draw distance low when i enter these places or anyplace where many complex things must be drawn on the screen.
raising my draw distance on mainland with many various complex builds and many 1024x1024 textures, i can witness my memory useage shoot over 2GB and start swapping out to the disk drive.
i suppose if i wanted to view the scenario without bottlenecks, i would have to run SL off server based hardware, with an OS that supports more than the max GB of memory with 2 8800GTX cards in SLI mode on one monitor, not including the internet connection, which for me is 30Mbit down, 5Mbit up, non-synchronous.
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 15:38
Not sure if I'm bumping my topic too much now, but to my surprise I discovered that disabling VBO from Hardware Options in Graphics improves my FPS very much. Which is weird as I knew VBO was all about performance gain whenever enabled. Interesting...
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-18-2008 15:49
From: Mircea Lobo
Not sure if I'm bumping my topic too much now, but to my surprise I discovered that disabling VBO from Hardware Options in Graphics improves my FPS very much. Which is weird as I knew VBO was all about performance gain whenever enabled. Interesting...

If you've got older hardware, VBO's may indeed slow it down. If your system doesn't fully support VBO's, or if you just don't have a whole lot of video memory to devote to them, they can end up worsening performance instead of improving it.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 16:12
From: Chosen Few
If you've got older hardware, VBO's may indeed slow it down. If your system doesn't fully support VBO's, or if you just don't have a whole lot of video memory to devote to them, they can end up worsening performance instead of improving it.


My graphics card is new enough... its an ATI Radeon X1300 /1550 series. Clearly not something that old, so that surprises me a lot.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
04-18-2008 16:19
There are know issues with ATI Radeon cards and VBO right now. I get the impression that it is either a driver issue with ATI/AMD, or issues with the client's implementation of VBO in relation to them.
Talon DeCuir
Angel
Join date: 19 May 2007
Posts: 350
04-18-2008 16:41
Thanks so much for bringing that up about the VBO, my desktop has the ati 1300x card aslo, disabled VBO and I got an increase of 5 fps.

Yippee!

Here is to making sure my new laptop has an nvidia card.
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-18-2008 17:03
Glad this could be of help to others too. Linden should mark this somehow, as when you mouse-over the VBO option it says it improves performance for any video card that isn't old.

Do note however, that even if you get a faster FPS with disabled VBO, you will instead have small freezes every now and then when around many prims (the games will freeze once every few seconds for a few miliseconds or so). But its better then having smooth but few framerates.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-18-2008 20:17
At the windlight team's townhall meeting, they did mention they've been trying to work with ATI to get them to improve their drivers. There are currently a lot of problems with them, which are beyond LL's direct control. LL does what it can to help out, but ultimately it's up to ATI to fix them.

When I said "If you've got older hardware", what I should have said was "If you have an ATI card, or an older nVidia card". The ATI thing slipped my mind.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
04-19-2008 01:38
Nvidia is probably better from what I heard. I heard there are less issues with Nvidia where there are many others with ATI these days, not only in sl.