Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Alpha Sort Bug Fix to Bork Toon Shading??

Tod69 Talamasca
The Human Tripod ;)
Join date: 20 Sep 2005
Posts: 4,107
04-13-2007 21:18
So with this new "update", there is mention that it may affect Cel Shaded Avatars.

I made a few, using a blank texture with just an alpha channel on the outside, then coloring the inside of the shape black.

Does this mean my avatars are done for? Or does this only affect ones who have default blank texture set to 100% transparency??
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-14-2007 08:05
Most likely they're talking about the bug where if you twist a hollow sphere all the way in both directions, you get what looks like an outlined circle. There never was any good reason why that should work; it was just a peculiarity of SL.

If that is indeed what will be changed, then it's no big deal. Simply put a smaller "fill sphere" inside the larger "outline sphere", and you'll still get the cell shaded look. In other words, cell shade spheres the same way you'd cell shade any other shape. It's just two prims instead of one.
_____________________
.

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.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
04-14-2007 10:58
From: Chosen Few
if you twist a hollow sphere all the way in both directions, you get what looks like an outlined circle. There never was any good reason why that should work; it was just a peculiarity of SL.

It's because the vertex order of each poly gets reversed, therefore the the polys on the outside of the sphere "face" inward, and those of the hollow face outward. To speed rendering, "backfaces," i.e., those whose verts are in a certain order (typically clockwise), aren't drawn, because they'd normally be on the "back" of an object, where you'd never see them.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-14-2007 19:35
From: Deanna Trollop
It's because the vertex order of each poly gets reversed, therefore the the polys on the outside of the sphere "face" inward, and those of the hollow face outward. To speed rendering, "backfaces," i.e., those whose verts are in a certain order (typically clockwise), aren't drawn, because they'd normally be on the "back" of an object, where you'd never see them.

I guess maybe I wasn't clear in my meaning of "there was never any good reason". By "reason" I meant "intended purpose", not "explanation of the mechanics". Yes, the mechanical explanation is that the faces end up reversed, so the normals point inward instead of outward. That's not what I was talking about though. When I said "there was never any good reason for it", what I meant was that that particular behavior really shouldn't be happening. Twisting a sphere should not cause its polygons to flip. They should distort, absolutely, but they shouldn't flip over.

That flipping behavior is a bug. It happens to be a useful bug for one particular task, but it's a bug nonetheless. If it is indeed what is being fixed in the next update, then it's a pretty good example of why a bug should never be used as a feature. You can't depend on stuff like this to last. Sooner or later, the flaw gets corrected, and the trick no longer works.
_____________________
.

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.
Tod69 Talamasca
The Human Tripod ;)
Join date: 20 Sep 2005
Posts: 4,107
04-14-2007 21:40
Oooo! Just thought of another one- how will it affect Invisi-Prims?

I'll just have to wait & see how its going to mess up stuff.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
04-14-2007 22:52
From: Chosen Few
Twisting a sphere should not cause its polygons to flip. They should distort, absolutely, but they shouldn't flip over.
Consider how an SL sphere is "built." A circular sector is swept about an axis. When that sector is twisted so that part (or all) of it falls on the opposite side of the axis, the polygons derived from that part of the sector will have the order of their verts reversed, therefore the normals point the opposite direction.

I wouldn't call it a "bug" so much as just a peculiar consequence of implementing twist in the way they did for spheres. The behavior is expected, just not obvious to those unfamiliar with how surface normals are computed.

[Edit to add:]
I just checked out the preview client. As the release notes led me to suspect, the change doesn't affect the reversing of surface normals with twisted spheres, as discussed above. All they did was make it so if both the outer and hollowed inner surface have a 32-bit texture (including surfaces with a non-zero transparency value), the outer surface will always be drawn in front. So if either of the surfaces have a 24-bit texture and are completely opaque, this change won't affect them at all.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-15-2007 06:24
From: Deanna Trollop
Consider how an SL sphere is "built." A circular sector is swept about an axis. When that sector is twisted so that part (or all) of it falls on the opposite side of the axis, the polygons derived from that part of the sector will have the order of their verts reversed, therefore the normals point the opposite direction.

I wouldn't call it a "bug" so much as just a peculiar consequence of implementing twist in the way they did for spheres. The behavior is expected, just not obvious to those unfamiliar with how surface normals are computed.

Deanna, I'm not disputing how it does work. What I'm saying is that that's not how it HAS to work. They could easily fix it so that the normals stay pointing outward. The fact that it works as it does now is just plain sloppy implementation. I can set up a polygonal sphere to twist in any other 3D modeling program in a matter of seconds, and it won't end up reversing like that.

If you object to the term "bug" to define a mistake in the way something was put together, then how about "peculiarity that has no good reason behind it", just like I said in my first post here?

From: Deanna Trollop
[Edit to add:]
I just checked out the preview client. As the release notes led me to suspect, the change doesn't affect the reversing of surface normals with twisted spheres, as discussed above. All they did was make it so if both the outer and hollowed inner surface have a 32-bit texture (including surfaces with a non-zero transparency value), the outer surface will always be drawn in front. So if either of the surfaces have a 24-bit texture and are completely opaque, this change won't affect them at all.

Okay, so I guess we've been talking about this for nothing then. If what you've described is indeed all that has has changed, then I think LL unnecessarily blew the panic whistle on the cell shading thing. If the twisting "peculiarity" still works, and putting an opaque sphere inside an outwardly transparent one still works, then I don't see how this change could at all affect the way most cell shading is done in SL.
_____________________
.

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.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
04-15-2007 11:16
From: Chosen Few
If what you've described is indeed all that has has changed, then I think LL unnecessarily blew the panic whistle on the cell shading thing.
Oh, I agree. As it's worded in the release notes:
* Alpha textures sorted more accurately
** Example: the hollow inner surface of a sphere will no longer draw on top of the outer surface
** This change will cause some content (which used this bug to imitate cel-shading) to look dramatically different

It should be clear that the first note only applies when two alpha'd textures are being compared, since it's in the context of alpha-sorting, but many aren't aware of the distinction. And the "some content" in the second note could easily be (and has been) misinterpreted to mean all cell-shaded objects, rather than just a particular subset of them.
Dnel DaSilva
Master Xessorizer
Join date: 22 May 2005
Posts: 781
04-15-2007 13:56
From: Tod69 Talamasca
Oooo! Just thought of another one- how will it affect Invisi-Prims?

I'll just have to wait & see how its going to mess up stuff.


Or log into the test grid....
_____________________
Xessories in Urbane, home of high quality jewelry and accessories.

Coming soon to www.xessories.net

Why accessorize when you can Xessorize?