Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Scaevolus
Apr 16, 2007

In OpenGL, what's the best way to render a million cubes? (in a 100x100x100 grid) They won't be moving. Should I use display lists or vertex buffer objects?

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

InternetJunky posted:

I'd appreciate any and all help.
You may find these presentations useful:
Google I/O 2010 - Writing real-time games for Android redux
Google I/O 2009 - Writing Real-Time Games for Android

There are full transcripts so you can skip to the parts with benchmarks and recommendations pretty easily.

Scaevolus
Apr 16, 2007

Sabacc posted:

Now, I know pushing the attribute basically store all things affecting lighting--lights, materials, directions, positions, e.t.c. But how the hell am I supposed to capture this information in OpenGL ES? In OpenGL, I push the attribute, do some work, and pop it off.
You'll have to either 1) keep track of what state lighting is in in your rendering code and restore it afterwards or 2) use glGet* to query the necessary parameters, and restore them afterwards.

Scaevolus
Apr 16, 2007

Sabacc posted:

That's just it--I don't know what the mapping of "necessary parameters" are. I was hoping to find an equivalency list online somewhere: "If you're trying to do glPushAttrib(GL_LIGHTING_BIT), call these functions instead."
According to the MSDN OpenGL docs, it involves these values:

quote:

GL_COLOR_MATERIAL enable bit
GL_COLOR_MATERIAL_FACE value
Color material parameters that are tracking the current color
Ambient scene color
GL_LIGHT_MODEL_LOCAL_VIEWER value
GL_LIGHT_MODEL_TWO_SIDE setting
GL_LIGHTING enable bit
Enable bit for each light
Ambient, diffuse, and specular intensity for each light
Direction, position, exponent, and cutoff angle for each light
Constant, linear, and quadratic attenuation factors for each light
Ambient, diffuse, specular, and emissive color for each material
Ambient, diffuse, and specular color indexes for each material
Specular exponent for each material GL_SHADE_MODEL setting
You probably don't change all of these, though.

Scaevolus
Apr 16, 2007

Zilla32167 posted:

How do OpenGL versions map to DirectX versions in terms of hardware requirements? For example, if I can target DirectX 9.0c, what OpenGL versions do I have to work with?
Probably OpenGL 2.0.

DirectX 9.0c came out in August 2004, and OpenGL 2.0 came out in September 2004. Cards that came out late 2004 and early 2005 might have support for one but not the other, though.

Scaevolus
Apr 16, 2007

slovach posted:

How exactly does fxc / compiled shaders work in DX11? Is it compiled to some device independent format then the driver takes it from there later when you create / set it? Could compiling at run time could potentially yield a more optimized end result because it could be tailored to that machine's hardware?

It's a device independent bytecode. The graphics card will convert them as appropriate. The point is that your shaders aren't in an easily readable form, and you can skip the compilation phase.

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

Suspicious Dish posted:

Does JOGL not have shaders and VBOs and stuff? glBegin and friends have been dead since forever.

When you're only pushing a few hundred triangles, using deprecated immediate mode APIs isn't a big deal.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply