7 Replies - 2644 Views - Last Post: 26 June 2012 - 07:36 PM

#1 zehawk  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 213
  • Joined: 23-February 12

OpenGL Confusion

Posted 23 June 2012 - 05:41 PM

Ok, so this is just me being curious, I'm wondering a few things about OpenGL. Like, alot of things. I hope to know the insides of this API and learn about its features, limits, and speed capabilities. Here's a few things i want to know, and also any other useful nuggets can be greatly appriciated.
I dont want links, i want answers from proffessionals who know this api inside and out!
I want to know:
On a regular Windows 7, witth 4 gig of Ram,

-How many triangles or squares can be drawn at a time, with regular double buffering and stuff, before a noticable lag can be seen. An estimate is ok!
-Is lighting as slow as people claim it to be?
-If so, how can i get away with making a good 8 lights in one scene, with ambient lighting considered?
-Is ambient lighting easily changed without putting performance strains on OpenGL?
- glVertex3f vs glVertex3fv?(and other things such as glColor3f vs glColor3fv? I want to know things like speed differences!)
-Whats a vertex array, and why couldn't i just pass in regular old vertices?
-Why is everyone bashing OpenGL these days? Does it really suck as much as everyone says it does?
-Is it a slow API?
-Whats a great, big book for beginners that will 1. keep me interested the whole book(doesnt drag on!), 2. goes into depth as to more advanced features and and why I'd need them, 3. Explains good speed optimization practices in mind.

I'm no more than a curious adolscent investigating in OpenGL and C++. I have people tell me to just use Unreal and Unity and such, but that doesnt fascinate me as much as the lower level stuffz!

Well, i think those questions are good for now, bring on the answers!

This post has been edited by zehawk: 23 June 2012 - 05:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: OpenGL Confusion

#2 GunnerInc  Icon User is online

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: OpenGL Confusion

Posted 23 June 2012 - 05:49 PM

Everything you ever need to know about OpenGL
Was This Post Helpful? 0
  • +
  • -

#3 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 614
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: OpenGL Confusion

Posted 24 June 2012 - 09:36 AM

Quote

How many triangles or squares can be drawn at a time, with regular double buffering and stuff, before a noticable lag can be seen. An estimate is ok!


Why don't you try it out, since it's very subjective to a number of things, in particular, the way the application is written and how OpenGL is set up to render. Be aware that there's techniques that can increase the speed of rendering, from simple things like using triangle strips (GL_TRIANGLE_STRIP) rather than triangles (GL_TRIANGLES), to more complex things such as VBO's (which store vertices in graphics memory instead of RAM) or Shader languages (GLSL), which basically allow work to be off-loaded to the GPU, and more control over the graphics pipeline given to the programmer.

Quote

-Is lighting as slow as people claim it to be?


Lighting calculations will always add a performance hit, regardless of the API. I can't find any sources that say OpenGL is especially slow with lighting effects. Where did you hear this?

Quote

-Is ambient lighting easily changed without putting performance strains on OpenGL?


How would you do it normally?

Quote

- glVertex3f vs glVertex3fv?(and other things such as glColor3f vs glColor3fv? I want to know things like speed differences!)


The latter is faster.

Quote

-Whats a vertex array, and why couldn't i just pass in regular old vertices?


It's just an array of vertices, but you can pass vertices in any way OpenGL allows. Using functions allowing arrays to be passed rather than individual values is favorable and easy though, since vertices will often be stored in arrays anyway.

Quote

-Why is everyone bashing OpenGL these days? Does it really suck as much as everyone says it does?


I haven't heard that many complaints, really. It certainly doesn't suck, but there may be slightly faster API's or API's with more functionality. OpenGL is getting better all the time though, it's a serious competitor in the rendering "business". In fact, you will find that many games nowadays have an option to render with OpenGL or Direct3D, both of which usually perform just fine.

Quote

-Is it a slow API?


Fast enough for me.

Quote

-Whats a great, big book for beginners that will 1. keep me interested the whole book(doesnt drag on!), 2. goes into depth as to more advanced features and and why I'd need them, 3.


I am not sure to be honest, you should Google that question.

I think that you need to do plenty of your own research to come up with answers to these questions. Don't take what I, or anyone else says to be fact. There are many comparisons between API's out there if you look for them.

This post has been edited by Aphex19: 24 June 2012 - 10:03 AM

Was This Post Helpful? 0
  • +
  • -

#4 kidicarus  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 139
  • Joined: 13-February 09

Re: OpenGL Confusion

Posted 24 June 2012 - 08:37 PM

In open GL is it easy to remove an object from a screen. For example, say you draw two lines, could you delete one of the lines without having to (1) draw over it using the same color as the background or (2) having to clear the whole screen and then drawing everything (background, first line) all over again?

I ask because I've worked with little java animation where I'd have to clear the whole screen before I could remove one object.
Was This Post Helpful? 0
  • +
  • -

#5 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL Confusion

Posted 25 June 2012 - 06:23 AM

Quote

For example, say you draw two lines, could you delete one of the lines without having to (1) draw over it using the same color as the background or (2) having to clear the whole screen and then drawing everything (background, first line) all over again?


You want to get rid of a line without either drawing over the line or rerendering the entire screen? What do you propose then?

Quote

I ask because I've worked with little java animation where I'd have to clear the whole screen before I could remove one object.
Yes. Either draw over the selected portion of the screen, or redraw the entire screen.
Was This Post Helpful? 1
  • +
  • -

#6 kidicarus  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 139
  • Joined: 13-February 09

Re: OpenGL Confusion

Posted 25 June 2012 - 03:35 PM

View PostOler1s, on 25 June 2012 - 07:23 AM, said:

You want to get rid of a line without either drawing over the line or rerendering the entire screen? What do you propose then?


Hello Oler1s, good to see you're still here. I always enjoy reading your posts.

Yes, i see now the logical problem with my thinking. I was thinking you could think of the line as an object that could be "removed." Once you remove the line that area of the screen becomes the same as the background, whatever it may be. perhaps a layered concept might fight my analogy, where you think of the screen as a system of layers, and a new layer can be easily removed, ala photoshop. I really don't know much about graphics programming though, as it wasn't emphasized in my course.

I don't like drawing over the line because it might not be possible if you have a complex background.

I see now that it's best to refresh the screen and now that I've researched it a bit it doesn't seem too bad in opengl, perhaps even easier than java.
Was This Post Helpful? 0
  • +
  • -

#7 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL Confusion

Posted 25 June 2012 - 04:32 PM

Quote

I was thinking you could think of the line as an object that could be "removed." Once you remove the line that area of the screen becomes the same as the background, whatever it may be. perhaps a layered concept might fight my analogy, where you think of the screen as a system of layers, and a new layer can be easily removed, ala photoshop.
This is all well and good, but these are high level concepts. When you talk about rendering through OpenGL commands, you are talking about the base level of implementation. So all these "remove" and "layer" concepts need to be resolved into what they mean in terms of rendering.

If that's not the level of abstraction you want to work at, then looking directly at OpenGL isn't the right approach.
Was This Post Helpful? 0
  • +
  • -

#8 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: OpenGL Confusion

Posted 26 June 2012 - 07:36 PM

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

I want to know:
On a regular Windows 7, witth 4 gig of Ram,

This doesn't tell anyone anything. Graphics APIs rely mostly on the capabilities of your graphics hardware more than anything else. In the old days of fixed function pipelines, APIs were optimized to work most efficiently with certain graphics cards. With the introduction of shading languages this has somewhat changed with card manufacturers trying to match the best features of each API.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-How many triangles or squares can be drawn at a time, with regular double buffering and stuff, before a noticable lag can be seen. An estimate is ok!

This cannot be answered either. It depends on the complexity of your models\shapes, as in how many vertices make up each one, the algorithms used to draw them, the type of lighting effects, culling, etc. Again, no idea of your graphics hardware.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Is lighting as slow as people claim it to be?

What are people claiming it to be? Generally, though, lighting algorithms do slow renders down considerably due to the high computational complexity for the best effects.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-If so, how can i get away with making a good 8 lights in one scene, with ambient lighting considered?

Don't have eight lights in your scene, as the illumination they provide will likely overlap and become a nasty bottleneck for no benefit.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Is ambient lighting easily changed without putting performance strains on OpenGL?

You're not putting strains on OpenGL, you're putting it on your hardware. Otherwise yes, it is very easy to change. Observe flat shading vs Phong and Garaud.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

- glVertex3f vs glVertex3fv?(and other things such as glColor3f vs glColor3fv? I want to know things like speed differences!)

For what you're doing there will be no noticeable performance difference. To notice anything you will need to run your code through a profiler that will give you numbers and graphs to point out the bottlenecks.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Whats a vertex array, and why couldn't i just pass in regular old vertices?

A vertex array is an array of points in conceptual space without magnitude or direction that described the form of an object or model in your scene. These vertices are drawn in a specific order like triangle strip or triangle fan for example. Contrast with index arrays.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Why is everyone bashing OpenGL these days? Does it really suck as much as everyone says it does?

OpenGL is excellent. Anyone bashing it has no idea of its capabilities and history.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Is it a slow API?

No, but you do have to be familiar with how it works internally in order to code efficiently in it.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

-Whats a great, big book for beginners that will 1. keep me interested the whole book(doesnt drag on!), 2. goes into depth as to more advanced features and and why I'd need them, 3. Explains good speed optimization practices in mind.

You are going to need patience and discover your own book that works for you.

View Postzehawk, on 24 June 2012 - 01:41 AM, said:

I'm no more than a curious adolscent investigating in OpenGL and C++. I have people tell me to just use Unreal and Unity and such, but that doesnt fascinate me as much as the lower level stuffz!

Well, i think those questions are good for now, bring on the answers!

Okay.

This post has been edited by ButchDean: 26 June 2012 - 07:38 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1