INFINITE_PLANE

Everything todo with programming goes HERE.
User avatar
aP|Nelg
Match Winner
Posts: 621
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

INFINITE_PLANE

Post by aP|Nelg »

How exactly is infinity made? Is it actually an infinite plane or does it end eventually? Does it fail to work for anyone else on 0.4?
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: INFINITE_PLANE

Post by Ratchet »

for anyone who isn't sure what he's talking about:

Image
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
S0lutai
Average Program
Posts: 85
Joined: Thu Mar 14, 2013 11:53 pm

Re: INFINITE_PLANE

Post by S0lutai »

Ratchet wrote:for anyone who isn't sure what he's talking about:

Image
Way to go, Ratchet.
Attachments
7C2.gif
Image
A tragedy is commonplace but in the end they go away.
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: INFINITE_PLANE

Post by Ratchet »

Derailment: I'm used to other forums where people post memes and cat pics on spoilers so they don't annoy people too much (esp. mods).

It'd actually be pretty cool. And I can say that now cuz he-who-must-not-be-named can't use my vote in his dissertation of why we need spoilers.

P.S. what team would I be on, Z-man?
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: INFINITE_PLANE

Post by Z-Man »

I'd support spoiler tags for that, but have to note there are at least two alternatives available already:
1. Link or attach, don't embed.
2. Don't post them.
Ratchet wrote:P.S. what team would I be on, Z-man?
I'll have to count your post as half a point for team Evil Empire, it's not exactly not mentioning him. Not removing it because it is unlikely team Terror latches on to it. And if they do, one point for them. Rrrrisky play. Like tickling your sibling.

On the original topic, yes, it actually is an infinite plane. Well, on hardware where we know it's not supported, only an almost infinite plane. See, OpenGL uses projective geometry (not exactly for the math nerds, but close enough) for its input; points don't just have three coordinates (x,y,z), they have four (x,y,z,w), and four-coorinate-tuples that only differ by a positive factor are considered equivalent. So (x,y,z,w) and (2x, 2y, 2z, 2w) are the same point. And if w is not zero, you can always take the equivalent point (x/w, y/w, z/w, 1) instead. That's the normed form for regular points, and if you give OpenGL a three-vector (x,y,z), it is automatically internally expanded to (x,y,z,1).
And infinite points are just the case where w is 0 and you can't normalize the coordinates to (x', y', z', 1). Look at the limit of the normed form of (x,y,z,w) as you send w to zero: the first three coordinates go to infinity in the direction given by (x,y,z). That's what we use for the infinite plane. For fully functional OpenGL drivers, they should be no problem; the math that maps screen pixel coordinates to texture coordinates is beautiful and simple when expressed in projective geometry. But unfortunately, too many drivers are optimized for the common, boring, normalizable part of projective space because that's what everyone else is using exclusively.
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: INFINITE_PLANE

Post by Ratchet »

Maybe if I read it a few more times it will make sense. As of now, the only part I get is that as w approaches zero the 3 dimensional vector approaches infinity.
Last edited by Z-Man on Fri Aug 21, 2015 7:48 pm, edited 1 time in total.
Reason: She looked really happy and excited about that book.
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
User avatar
Magi
Match Winner
Posts: 634
Joined: Fri Oct 21, 2011 9:35 pm

Re: INFINITE_PLANE

Post by Magi »

Z-Man wrote: I'll have to count your post as half a point for team Evil Empire, it's not exactly not mentioning him. Not removing it because it is unlikely team Terror latches on to it. And if they do, one point for them. Rrrrisky play. Like tickling your sibling.
How do I get on team potato?
Image Image Image Image Image Image Image Image Image
Image

bye
User avatar
Magi
Match Winner
Posts: 634
Joined: Fri Oct 21, 2011 9:35 pm

Re: INFINITE_PLANE

Post by Magi »

Ratchet wrote:
Magi wrote:
Z-Man wrote: I'll have to count your post as half a point for team Evil Empire, it's not exactly not mentioning him. Not removing it because it is unlikely team Terror latches on to it. And if they do, one point for them. Rrrrisky play. Like tickling your sibling.
How do I get on team potato?
By double-posting! Spamming nooooooob.

Dunno how that happened :o
Last edited by Magi on Thu Aug 20, 2015 10:55 pm, edited 1 time in total.
Image Image Image Image Image Image Image Image Image
Image

bye
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: INFINITE_PLANE

Post by Ratchet »

Magi wrote:
Z-Man wrote: I'll have to count your post as half a point for team Evil Empire, it's not exactly not mentioning him. Not removing it because it is unlikely team Terror latches on to it. And if they do, one point for them. Rrrrisky play. Like tickling your sibling.
How do I get on team potato?
By double-posting! Spamming nooooooob.
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: INFINITE_PLANE

Post by Jonathan »

Z-Man wrote:On the original topic, yes, it actually is an infinite plane. Well, on hardware where we know it's not supported, only an almost infinite plane. See, OpenGL uses projective geometry (not exactly for the math nerds, but close enough) for its input; points don't just have three coordinates (x,y,z), they have four (x,y,z,w), and four-coorinate-tuples that only differ by a positive factor are considered equivalent. So (x,y,z,w) and (2x, 2y, 2z, 2w) are the same point. And if w is not zero, you can always take the equivalent point (x/w, y/w, z/w, 1) instead. That's the normed form for regular points, and if you give OpenGL a three-vector (x,y,z), it is automatically internally expanded to (x,y,z,1).
And infinite points are just the case where w is 0 and you can't normalize the coordinates to (x', y', z', 1). Look at the limit of the normed form of (x,y,z,w) as you send w to zero: the first three coordinates go to infinity in the direction given by (x,y,z). That's what we use for the infinite plane. For fully functional OpenGL drivers, they should be no problem; the math that maps screen pixel coordinates to texture coordinates is beautiful and simple when expressed in projective geometry. But unfortunately, too many drivers are optimized for the common, boring, normalizable part of projective space because that's what everyone else is using exclusively.
OpenGL doesn't/shouldn't care if you go beyond infinity. Such a shame that mere infinity can break some renderers. I wonder what such renderers are doing. I'm not sure if I've ever seen it. I certainly don't have a recollection of it. What does it look like? How would you even 'optimize' this, with the correct process being rather streamlined already?
ˌɑrməˈɡɛˌtrɑn
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: INFINITE_PLANE

Post by Z-Man »

Well, you can save a couple of multiplications and additions if you assume all point vectors have their projective component set to 1 and all regular transformation matrices have the first row (or column) set to 1,0,0,0. It can also happen that they normalize vectors in between (no, I would not know why) and get division by zero that way. All I know is that it simply does not work properly for some drivers. Drivers and hardware are not, it seems, tested against the specification, but against common clients.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: INFINITE_PLANE

Post by Jonathan »

Most of that seems unlikely. Apparently w_o=0.001 is handled correctly when infinity is turned off, suggesting it isn't simply discarded. By the time we get to clip coordinates, we have w_c=-z_e using a standard projection matrix. At that point we have a similar w_c for any kind of perspective rendering, no matter what happened before. Maybe it's normalization for no reason. My carefully considered verdict: whatever.
ˌɑrməˈɡɛˌtrɑn
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: INFINITE_PLANE

Post by Z-Man »

Jonathan wrote:Most of that seems unlikely.
I agree! But the observed fact was that it did not work properly on some cards/drivers. I think it was back in the day when drivers needed to do all the transformations on the CPU (so saving a mult meant something; today it probably hurts) and there was a greater variety of GPU manufacturers. Today, it seems even the worst offender that's still around (Intel) gets it right.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: INFINITE_PLANE

Post by Jonathan »

I'm thinking of so many possible reasons, and I don't even know what it looks like. I should just stop. I guess I'll vanish again. :)
ˌɑrməˈɡɛˌtrɑn
User avatar
Ratchet
Match Winner
Posts: 779
Joined: Sat Mar 15, 2008 5:55 am

Re: INFINITE_PLANE

Post by Ratchet »

Wait, what?

Z-man, what does your edit even mean?

"She looked really happy and excited about that book."

I don't think there was anything in the original post that required censorship.. lol? Wut?
Image
"Dream as if you'll live forever,
Live as if you'll die today." -James Dean
Post Reply