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
Mithaldu
Sep 25, 2007

Let's cuddle. :3:
Well, for one thing: First off make sure you know programming. Begin by picking up a book on whatever language the iPhone uses.

Then, what helped me tremendously were the NeheGL tutorials [ http://nehe.gamedev.net/ ]. However take these with a grain of salt. They show the most simple, quick and rudimentary way to get certain things done and help you to understand what's going on. However you would NEVER actually use the things they show in production as they are demonstrated there, as the most simple way is usually also the least optimal.

Edit: Also, this guy comes recommended by people who hate the Nehe tutorials: http://www.xmission.com/~nate/opengl.html

Mithaldu fucked around with this message at 20:20 on Nov 11, 2008

Adbot
ADBOT LOVES YOU

haveblue
Aug 15, 2005



Toilet Rascal
For a second thing, the iPhone does not use shaders, so learning those at this stage won't be too helpful.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Tap posted:

I've recently been inspired to start game programming as a hobby, but I know virtually nothing about the subject. Do you guys have any literature you'd recommend for a beginner? I'd like to get started with basic stuff like vertexes and pixel shading, etc..
If you want to dive into the iPhone, please start making 2D stuff so you can get the hang of the API without having to deal with the difficulty of 3D content creation.

Mithaldu posted:

Thanks. I needed it to make the occlusion check shapes also render when the camera is inside them.
Don't do that, not only does it break if something inside of the volume is obscuring the outer hull, but it's much cheaper to just use convex visibility volumes and check if the camera point is inside.

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
If you already know C, Frank Luna's "Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach" is probably the best graphics introduction I've read. Even though I'm using XNA now I still refer to it all the time.

http://www.amazon.com/Introduction-Game-Programming-Direct-9-0c/dp/1598220160/ref=sr_1_1?ie=UTF8&s=books&qid=1226473567&sr=1-1

Actually looking online I see he's got a DX10 book out now, anyone checked it out yet?

Mithaldu
Sep 25, 2007

Let's cuddle. :3:

OneEightHundred posted:

Don't do that, not only does it break if something inside of the volume is obscuring the outer hull,
drat, right.

OneEightHundred posted:

but it's much cheaper to just use convex visibility volumes and check if the camera point is inside.
Is that another awesome OpenGL technique i never heard of or is it just a fancy way to say "check where your camera is"? :)

Alright, got it. :)
vvvv

Mithaldu fucked around with this message at 12:38 on Nov 12, 2008

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Mithaldu posted:

Is that another awesome OpenGL technique i never heard of or is it just a fancy way to say "check where your camera is"? :)
Basically yes. It's really cheap to check if a point is inside a volume, so just do that and if the camera is inside (or nearly inside, so you don't run into weird nearplane fuckery in some instances) then all objects inside the volume should be considered visible.

heeen
May 14, 2005

CAT NEVER STOPS
Why is my opengl occlusion_query returning almost exactly (+-2) the half of my viewport resolution?

Mithaldu
Sep 25, 2007

Let's cuddle. :3:
Can you try giving a bit more information? When i tested it in my project i also made a few test to see if the reported pixel count was right and it was in every case for me.

Scarboy
Jan 31, 2001

Good Luck!
This should be really simple but I can't figure it out. I'm drawing a big black quad over the entire iphone screen. I want to load a texture of a circle onto the screen to REMOVE the black from that area (e.g. see what's behind the big black quad in that area). Any simple way to get this working with blend functions or something obvious that I can't figure out?

BernieLomax
May 29, 2002
A thank you for this thread: this thread was invaluable for getting my demo outta the door.

I couldn't make the original demo I aimed at, but made this one quicky in two days when I realized the original one was desitened to fail

Anyway: http://http.de.scene.org/pub/parties/2008/kindergarden08/demo/rund.zip
Requires a newer card and breaks horribly on non-supported cards. If you have a <=DX9 card I would love to supply a debug version. It uses NPOT and really nothing else but high polys.

BernieLomax fucked around with this message at 00:06 on Nov 23, 2008

shodanjr_gr
Nov 20, 2007

Scarboy posted:

This should be really simple but I can't figure it out. I'm drawing a big black quad over the entire iphone screen. I want to load a texture of a circle onto the screen to REMOVE the black from that area (e.g. see what's behind the big black quad in that area). Any simple way to get this working with blend functions or something obvious that I can't figure out?



You can do this in a few ways (not with blending though). THe first that comes to mind is to use the stencil buffer to find the affected fragments by the "circle draw" and only draw on those pixels for the final pic.

Scarboy
Jan 31, 2001

Good Luck!

shodanjr_gr posted:

You can do this in a few ways (not with blending though). THe first that comes to mind is to use the stencil buffer to find the affected fragments by the "circle draw" and only draw on those pixels for the final pic.

I've read solutions that use the stencil buffer but OpenGL ES on the iphone doesn't support it :(

Mithaldu
Sep 25, 2007

Let's cuddle. :3:
You may want to simply generate/load a texture with varying alpha values and draw the rectangle with that texture. Just make sure you have all the blending flags (refer to tutorials linked earlier in the thread) enabled and draw the rectangle last.

shodanjr_gr
Nov 20, 2007
I have an issue with some fixed pipeline code I am writting. I'm running the code on my Acer Aspire One, with a GMA945. The problem is that it looks like it is extremely fill-rate limited, and it feels like its not being accelerated by the GMA. Now I understand the crapyness, but this thing runs unreal tournament fine at high resolutions, so it's not a lack of support on the hardware side.

I think that the header files, or the DLLs I am using are not talking to the driver properly and thus everything runs in software mode. I cant track down an "Intel-specific" opengl32.dll anywhere...




Does anyone have any suggestions on where I can go from here?

stramit
Dec 9, 2004
Ask me about making games instead of gains.

shodanjr_gr posted:

I have an issue with some fixed pipeline code I am writting. I'm running the code on my Acer Aspire One, with a GMA945. The problem is that it looks like it is extremely fill-rate limited, and it feels like its not being accelerated by the GMA. Now I understand the crapyness, but this thing runs unreal tournament fine at high resolutions, so it's not a lack of support on the hardware side.

I think that the header files, or the DLLs I am using are not talking to the driver properly and thus everything runs in software mode. I cant track down an "Intel-specific" opengl32.dll anywhere...




Does anyone have any suggestions on where I can go from here?

Try direct x :S It sounds like a dll related issue. Are you running UT in GL or DX? If the first can you track down the DLL that it is using?

shodanjr_gr
Nov 20, 2007

Stramit posted:

Try direct x :S It sounds like a dll related issue. Are you running UT in GL or DX? If the first can you track down the DLL that it is using?

I think its not using the driver DLL but instead the generic windows one. I just cant figure out how to change that...On runtime it loads OPENGL32.DLL

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
What version of OpenGL are you using? From this table it looks like the hardware only supports OpenGl 1.4.

http://en.wikipedia.org/wiki/Intel_GMA#Table_of_GMA_graphics_cores_and_chipsets

I've never used OpenGL or the FFP so maybe this has nothing to do with your problem, though.

haveblue
Aug 15, 2005



Toilet Rascal
Maybe it's falling back to software? Can you request a hardware-only context and see if it refuses or fails to render?

shodanjr_gr
Nov 20, 2007

sex offendin Link posted:

Maybe it's falling back to software? Can you request a hardware-only context and see if it refuses or fails to render?

Is there a way to do this with GLUT?

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text
This shouldn't be an issue at all. Reinstall your device driver.

a slime
Apr 11, 2005

Any thoughts on a 3D modeller that meshes well with OpenGL? I want to do some basic low-poly modelling and skeletal (I guess?) animation.

I'm tooling around in Blender right now. Is this a reasonable choice?

tripwire
Nov 19, 2004

        ghost flow

not a dinosaur posted:

Any thoughts on a 3D modeller that meshes well with OpenGL? I want to do some basic low-poly modelling and skeletal (I guess?) animation.

I'm tooling around in Blender right now. Is this a reasonable choice?
Some people use milkshape or whatever gmax is called now but those are both lame in my experience (disclaimer: everyone has their own tastes and a lot of people prefer the interface of what they first started learning with). I recall Mithaldu likes Wings3d but I don't care for it too much and its not very full featured on its own.

Blender is ok but theres soooo much better modellers out there, especially the commercial ones. Some of them have student/learning editions or trials (both Silo 3d and Modo come to mind, and they're both excellent). Just because they happen to be really fully featured besides doesn't mean you can't do low poly models in them just as easily.

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
If you learn Blender it's really powerful but if you ever want to learn another modeler you're have to forget everything you know. The UI is completely different from anything else.

It's probably my favorite modeler, although I am a programmer so my opinion isn't all that useful.

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 18:15 on Jun 24, 2020

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
Getting geometry from modeling software is far less about the software than about the FORMAT. The formats used by the modeling packages are horribly unsuitable for being directly loaded by a game engine, so you always want the model exported in a format you can handle, catered to the capabilities of your engine.

The project I'm working on uses its own format and imports that from other easier-to-parse formats like MD5, SMD, or PSK/PSA. COLLADA and FBX are the ultimate intermediate formats right now and are supported by virtually every decent modeling package, but it's still much more complex than game-specialized formats.

StickGuy
Dec 9, 2000

We are on an expedicion. Find the moon is our mission.

shodanjr_gr posted:

Does anyone have any suggestions on where I can go from here?
What exactly are you trying to do? It sounds like you're attempting to use some GL functions that aren't supported by your hardware, which is causing it to default to software rendering.

a slime
Apr 11, 2005

OneEightHundred posted:

Getting geometry from modeling software is far less about the software than about the FORMAT. The formats used by the modeling packages are horribly unsuitable for being directly loaded by a game engine, so you always want the model exported in a format you can handle, catered to the capabilities of your engine.

The project I'm working on uses its own format and imports that from other easier-to-parse formats like MD5, SMD, or PSK/PSA. COLLADA and FBX are the ultimate intermediate formats right now and are supported by virtually every decent modeling package, but it's still much more complex than game-specialized formats.

Yeah, this answers my question. Sounds like a custom format is the way to go. Thanks everyone :)

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through

not a dinosaur posted:

Yeah, this answers my question. Sounds like a custom format is the way to go. Thanks everyone :)

If you've never imported a 3D model format before you might want to go with someone else's proprietary format to learn the ropes. Id's MD5 is a pretty good place to start - it's fairly simple but still modern.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
A custom format is the way to go, but the way you go about doing it is also kind of important.

The best candidates for import formats if you're doing skeletal animation are MD5 (Doom 3, text), PSK/PSA (Unreal Engine, binary, see this page for specs), SMD (Source, text), and Cal3D (open source, binary).

SMD is the only one of the bunch that will export normal data, but it's definitely something you DON'T want to load directly, unlike the other three. It contains a ton of duplicated data. Personally, I recommend PSK/PSA because it uses matrix palette blending implicitly, which is much better for doing transforms on the GPU and doesn't require doing stupid poo poo to avoid branch mispredictions on the CPU. TMRF uses a hybrid format which doesn't favor any weight blending method, and the skeletal library uses preblended transform matrices which are very SIMD-friendly.

Supporting COLLADA would be an extremely desirable goal: Every major modeling package supports it, it allows normal/tangent/binormal data to be exported so seams are never a problem, and its ubiquity futureproofs it.

The only problem is that it's HARD to parse it. Getting meshes to import requires digging through several more layers of complexity than dealing with one of the afforementioned formats, and animations... well, let's just say that NONE of the major open source 3D engines will import COLLADA animations yet.

OneEightHundred fucked around with this message at 21:42 on Dec 12, 2008

shodanjr_gr
Nov 20, 2007

StickGuy posted:

What exactly are you trying to do? It sounds like you're attempting to use some GL functions that aren't supported by your hardware, which is causing it to default to software rendering.

Im writting some OpenGL 1.1 (or it could be 1.2) code, and I doesnt seem to be running in hardware mode (it is extremely fill-rate limited). I dont think I am using any unsupported calls...

StickGuy
Dec 9, 2000

We are on an expedicion. Find the moon is our mission.

shodanjr_gr posted:

Im writting some OpenGL 1.1 (or it could be 1.2) code, and I doesnt seem to be running in hardware mode (it is extremely fill-rate limited). I dont think I am using any unsupported calls...
Just because a function is in OpenGL 1.1 or 1.2 doesn't mean it won't drop to software mode. For example, glPixelTransfer almost always forces the software path if you set anything but the default options.

You're also being incredibly vague about your application. What is it and what does it do? What do you mean by fill rate limited (i.e. what and how many things are you drawing that need to be filled)? Are you using any shaders? If so, what are you doing with them? What other things are you using? Lights? Textures? Blending? etc, etc

shodanjr_gr
Nov 20, 2007

StickGuy posted:

You're also being incredibly vague about your application. What is it and what does it do? What do you mean by fill rate limited (i.e. what and how many things are you drawing that need to be filled)? Are you using any shaders? If so, what are you doing with them? What other things are you using? Lights? Textures? Blending? etc, etc

My app loads a low-poly model off an OBJ file, creates a display list and renders it on the screen.

I think it is fillrate limited, because the framerate is only affected by the size of the viewport and not by the complexity of the model being rendered (a 500*500 window runs at 5-10 fps, a 100*100 window runs way faster).

I am not using any shaders (this is pure fixed pipeline code), only one light, no blending, I do use textures though.

Battle Bott
May 6, 2007

I'm writing a raytracer, really basic stuff, but I cannot find a good model format. It needs to be something that can export from 3ds max and parsed in python. Something easy to understand preferably.

I'm looking at collada, which has a parser written in python for blender, but it might be a bit over my head. Anyone know a dead simple format?

Mithaldu
Sep 25, 2007

Let's cuddle. :3:
Wavefront .obj is what you're looking for. With a tiny bit of understanding of what the abbreviations mean it is even human-readable for smaller models.

hexadecimal
Nov 23, 2008

by Fragmaster

shodanjr_gr posted:

My app loads a low-poly model off an OBJ file, creates a display list and renders it on the screen.

I think it is fillrate limited, because the framerate is only affected by the size of the viewport and not by the complexity of the model being rendered (a 500*500 window runs at 5-10 fps, a 100*100 window runs way faster).

I am not using any shaders (this is pure fixed pipeline code), only one light, no blending, I do use textures though.

How big is your texture? Also there are various options you can set up that can speed it up, such as mipmapping. I think you can make OpenGL do mipmapping automatically, but it has been a while since I have been doing OGL so i could be wrong.

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text

Mithaldu posted:

Wavefront .obj is what you're looking for. With a tiny bit of understanding of what the abbreviations mean it is even human-readable for smaller models.

obj is like the bmp of 3d. dead simple to read / write.

newsomnuke
Feb 25, 2007

How reliable are non-pow2 textures in OpenGL? They've been promoted to the core spec and I've never had any problem with them, but I've only had a very limited range of cards to test on (all nvidia). I've just come back to graphics coding after a pretty lengthy absence - are they still slow, or is the speed difference negligible?

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

ultra-inquisitor posted:

How reliable are non-pow2 textures in OpenGL? They've been promoted to the core spec and I've never had any problem with them, but I've only had a very limited range of cards to test on (all nvidia). I've just come back to graphics coding after a pretty lengthy absence - are they still slow, or is the speed difference negligible?
On my X1600 Pro, they cause a massive framerate hit.

a slime
Apr 11, 2005

ultra-inquisitor posted:

How reliable are non-pow2 textures in OpenGL? They've been promoted to the core spec and I've never had any problem with them, but I've only had a very limited range of cards to test on (all nvidia). I've just come back to graphics coding after a pretty lengthy absence - are they still slow, or is the speed difference negligible?

On my laptop with an X300, test program goes from 190fps to 2fps

Adbot
ADBOT LOVES YOU

newsomnuke
Feb 25, 2007

Ok, that's a bit more drastic than I was expecting, and pretty conclusive. I was actually only considering using one for a full-screen overlay (ie using one 1024x768 texture) because using a 1024x1024 is causing slight but noticeable scaling artifacts. I don't think this is going to impact performance - I'm more worried that drivers (especially ATI's) will be dodgy and give me the old white texture routine.

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