LWJGL Forum

Programming => OpenGL => Topic started by: matanui159 on March 29, 2014, 01:12:30

Title: Speed up gluSphere?
Post by: matanui159 on March 29, 2014, 01:12:30
When I create large detailed spheres with gluSphere the frame-rate drops (as expected).
So I thought I could put it into a VBO...

But I don't know how to make my own sphere (and I don't plan to either) and I can't get the vertex and texture points from gluSphere.

I have been reading up about Display Lists... Will these make it faster? Is it a problem if it is deprecated?
If not what is something that will speed it up?

Thanks in advance
Title: Re: Speed up gluSphere?
Post by: Daslee on April 01, 2014, 11:32:42
http://www.glprogramming.com/red/chapter02.html#name8 (http://www.glprogramming.com/red/chapter02.html#name8) this page should help you.
Title: Re: Speed up gluSphere?
Post by: matanui159 on April 15, 2014, 00:19:06
Quote from: Daslee on April 01, 2014, 11:32:42
http://www.glprogramming.com/red/chapter02.html#name8 (http://www.glprogramming.com/red/chapter02.html#name8) this page should help you.

Sorry but I can't really see how that can help. There's a lot of stuff on that page and that #name8 doesn't seem to scroll down
Title: Re: Speed up gluSphere?
Post by: DapperPixpy on April 15, 2014, 07:29:19
A quick search on Google popped up with a quick and easy pseudo-code example of sphere generation on the OpenGL forum.
https://www.opengl.org/discussion_boards/showthread.php/159584-sphere-generation (https://www.opengl.org/discussion_boards/showthread.php/159584-sphere-generation)
And here's a nice tutorial if you want to texture it (Should be relative easy to port.)
http://www.opengl.org/wiki/Texturing_a_Sphere (http://www.opengl.org/wiki/Texturing_a_Sphere)

Although I do recommend you read more into Daslee's link as it's got an explanation as to how it works. (Hell, I bookmarked it.)
If it doesn't scroll down, Ctrl+F "Some Hints for Building Polygonal Models of Surfaces". It's the bottom one.
On the topic of DisplayLists, It's not recommended to use anything deprecated, however it shouldn't be a problem.
Title: Re: Speed up gluSphere?
Post by: Daslee on April 15, 2014, 10:00:03
Quote from: matanui159 on April 15, 2014, 00:19:06
Quote from: Daslee on April 01, 2014, 11:32:42
http://www.glprogramming.com/red/chapter02.html#name8 (http://www.glprogramming.com/red/chapter02.html#name8) this page should help you.

Sorry but I can't really see how that can help. There's a lot of stuff on that page and that #name8 doesn't seem to scroll down

Scroll till you see "Some Hints for Building Polygonal Models of Surfaces". This article should really help you. I've already made sphere with uv mapping in vbo rendering mode by reading this article.
Title: Re: Speed up gluSphere?
Post by: matanui159 on April 15, 2014, 22:58:00
Guys, I told you:
Quote from: matanui159 on March 29, 2014, 01:12:30
But I don't know how to make my own sphere (and I don't plan to either)...

So stop giving me links to "how to make a sphere" >:(
Title: Re: Speed up gluSphere?
Post by: DapperPixpy on April 15, 2014, 23:16:04
You've gotta make a sphere to put it into a VBO. (Which is, at the moment, the fastest way of drawing, and "speeding up" the functionality of gluSphere)
As you said, you could put it into a DisplayList. But again, it's deprecated, and not encouraged. However it should be faster than using regular glVertex(..)
Title: Re: Speed up gluSphere?
Post by: Daslee on April 16, 2014, 12:32:05
Quote from: matanui159 on April 15, 2014, 22:58:00
Guys, I told you:
Quote from: matanui159 on March 29, 2014, 01:12:30
But I don't know how to make my own sphere (and I don't plan to either)...

So stop giving me links to "how to make a sphere" >:(

So google for glusphere source code if you are too lazy to read the article.