Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Using Transparency to reduce Lag

Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
12-03-2007 15:20
I don't really know the answer to the OP because I don't know how SL specifically is handling transparent polygons (Bobby could be correct if the renderer knows not to bother sending fully transparent polygons to the videocard,) but as far as how exactly transparent polygons are rendered you are incorrect Chosen. The graphics card isn't drawing the scene on top of alpha polygons, but the other way around. Basically, first it draws all of the opaque polygons (using the z-buffer to overlap things correctly) and then it draws semi-transparent polygons on top of the scene.

This by the way is why alpha polygons close together are sometimes rendered on top of each other in weird ways; in that last step where the semi-transparent polygons are drawn on top of the scene, they are drawn in order from furthest to nearest but that ordering is sloppy in order to be fast.

The entire process is pretty simple to understand really. It's just like painting in real life; if you paint one thing and then later paint something else on top of it, the later thing appears to be in front of the earlier thing. The z-buffer makes things different for opaque polygons, but it's this simple for semi-transparent objects.

---

Incidentally, your use of the term "render pass" is incorrect too, but it's close enough that I understood what you were getting at. A render pass is rendering the entire scene once, which you then layer with other render passes in order to do various effects (eg. blur by layering multiple render passes) while you are talking about the number of times the videocard has to draw a polygon.
_____________________
(Aelin 184,194,22)

The Motion Merchant - an animation store specializing in two-person interactions
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-03-2007 19:38
From: Johan Durant
I don't really know the answer to the OP because I don't know how SL specifically is handling transparent polygons (Bobby could be correct if the renderer knows not to bother sending fully transparent polygons to the videocard,) but as far as how exactly transparent polygons are rendered you are incorrect Chosen. The graphics card isn't drawing the scene on top of alpha polygons, but the other way around. Basically, first it draws all of the opaque polygons (using the z-buffer to overlap things correctly) and then it draws semi-transparent polygons on top of the scene.

This by the way is why alpha polygons close together are sometimes rendered on top of each other in weird ways; in that last step where the semi-transparent polygons are drawn on top of the scene, they are drawn in order from furthest to nearest but that ordering is sloppy in order to be fast.

The entire process is pretty simple to understand really. It's just like painting in real life; if you paint one thing and then later paint something else on top of it, the later thing appears to be in front of the earlier thing. The z-buffer makes things different for opaque polygons, but it's this simple for semi-transparent objects.

---

Ah, I had it backwards then. Same principle, basically, just the other way around (which is a lot more sensible). Thanks, Johan.

From: Johan Durant
Incidentally, your use of the term "render pass" is incorrect too, but it's close enough that I understood what you were getting at. A render pass is rendering the entire scene once, which you then layer with other render passes in order to do various effects (eg. blur by layering multiple render passes) while you are talking about the number of times the videocard has to draw a polygon.

So what would be the correct term then? I've often head the words "render pass" used in this capacity, even if it's not technically correct. I would assume it's one of those things like "alpha sorting", which would more correctly be termed "transparency sorting" since it affects simple-transparency textures too, but everybody just calls it "alpha sorting" anyway. Is there a better term than "render pass" that people should be using?
_____________________
.

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.
Lana Tomba
Cheap,Fast or Good Pick 1
Join date: 5 Aug 2004
Posts: 746
alpha=less lag
12-11-2007 08:36
yes I've been told by a linden that alpha textures cause lag..so do toruses...Torus= 21 sided prim..or something like that. I've heard that..like...walls...to hide textures that are far away somehow helps with lag.

I did a sim once and at the TP in area I had it all open...someone mentioned that because there was soo much of the sim that needed to be rezzed it was hard on the client side?...or something like that..so the client walled in the tp area.

Also..aren't particles actually textures?..and aren't they alpha based?..I ask because some places say "no" to particles because of lag..maybe thats why?..or it could be that multiple textures being rezzed again and again and again is just hard on the server..((shruggs))

I have to watch my bandwidth threshold(limited bandwidth daily) and recently i've noticed that something that can eat up my bandwidth in a few minutes are those "shells"..gun shells?...that drop to the ground after a weapon is fired?...Im thinking that each one of those shells that drop to the ground are a download for me...just like maybe a complex avatar rezzing would be.

....my two cents

~Lana Tomba
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-11-2007 11:37
From: Lana Tomba
yes I've been told by a linden that alpha textures cause lag..so do toruses...Torus= 21 sided prim..or something like that. I've heard that..like...walls...to hide textures that are far away somehow helps with lag.

The definition of "side" can vary. What's important to know about toruses is that they each have 2048 polygons in them. Compare that to a cube which has just 108, or a cylinder which has only 192, and toruses really stand out as "polygon hogs", just like sculpties.

The wall thing you're referring to is called occlusion culling. It may or may not be turned on in your client. You'll have to check your settings. It's on the client menu (press ctrl-alt-d to show the client menu if it's currently hidden). With OC turned on, far away objects that are obscured by closer objects will not be drawn. With less to draw in each frame, the frames get drawn faster. More frames in each second means less "lag".

The faster drawing comes with a price though. In each frame, the software has to do an extra check to see what's in front of what, and decide what not to draw. Sometimes this can slow things down immensely, especially if you move your camera around a lot. It's not uncommon for the client to lock up for a few seconds when you rotate your point of view quickly, and the software has to figure out what to do with all the new objects that just entered the scene. But generally, things will run faster with OC than without.

From: Lana Tomba
I did a sim once and at the TP in area I had it all open...someone mentioned that because there was soo much of the sim that needed to be rezzed it was hard on the client side?...or something like that..so the client walled in the tp area.

That's unfortunate. Personally, I hate walled-in arrival points. You end up bumping into the walls, or sometimes even getting trapped within them, as you try to move before the walls have rezzed. Since there's no way to force the system into any particular order in which to rez everything, sometimes it can be a long time before all the walls and the door appear so you can find your way out. It can be really annoying.

Outdoor arrival points are always better whenever possible. If the guy's having problems rezzing outdoor spaces, tell him either to turn down his draw distance or turn up his network settings (or both).

From: Lana Tomba
Also..aren't particles actually textures?..and aren't they alpha based?..

It's not fair to say that particles ARE textures, but they do use textures, just like everything else. They don't have to include alpha, but they usually do.

From: Lana Tomba
I ask because some places say "no" to particles because of lag..maybe thats why?..or it could be that multiple textures being rezzed again and again and again is just hard on the server..((shruggs))
Actually, the "lag" from particles usually is from the client-side calculations required to create them. It's not usually about the textures that are on them. One particle is computationally cheap, but when you have thousands of them on-screen, they add up quickly.

As for the server, it's almost completely out of the loop where particles are concerned. The texture only gets sent to you once, even if it's on 5,000 individual particles. After that, the particles themselves are generated client-side. The server doesn't even know they're there, as far as I know.

From: Lana Tomba
I have to watch my bandwidth threshold(limited bandwidth daily) and recently i've noticed that something that can eat up my bandwidth in a few minutes are those "shells"..gun shells?...that drop to the ground after a weapon is fired?...Im thinking that each one of those shells that drop to the ground are a download for me...just like maybe a complex avatar rezzing would be.

More likely, it's the combination of both the shells and the bullets. Each one is an individual object, and as the gun rezzes them one by one, they are each one more item for you to download.
_____________________
.

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.
1 2