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
samiamwork
Dec 23, 2006
This has been bugging me for a long time now:

GLSL allows me to, basically, assign whatever rgba colors I want to a pixel on a poly. But the blending of that pixel with whatever is already in the framebuffer seems to be determined by fixed-function junk (typically the standard alpha blend). Is this correct? Is there any way to have polys blend with multiply, screen, or any other blending I might want? I know I openGL has provided some minimal control over the blending function but nothing that would get me things like multiply or other photoshop-like blending modes, let alone arbitrary functions.

I really hope that made sense and that this is possible and I've just totally misunderstood things.

Adbot
ADBOT LOVES YOU

samiamwork
Dec 23, 2006

kewlpc posted:

Yeah, just use framebuffer objects. They're similar to the render-to-texture extension and pbuffers, but are faster and easier to use.

drat. I was afraid of that. I was really hoping to avoid using FBOs, but if that's what I have to use, that's what I'll use.

Thanks guys.

edit: Typo.

samiamwork fucked around with this message at 19:39 on Dec 7, 2007

samiamwork
Dec 23, 2006

kewlpc posted:

What's wrong with FBOs?

Nothing's wrong with them. Even if I had my magical programmable blending I'd probably have to use them anyway. I was mostly just confirming my suspicions.

samiamwork
Dec 23, 2006

kewlpc posted:

Does anybody know how far back ATI hardware supports FBOs and non-power-of-two textures (or at least texture rectangles)?

I don't have the answer, but you could probably find out with the database in the OpenGL Extension Viewer

http://www.realtech-vr.com/glview/

A pretty useful application especially for that kind of thing.

samiamwork
Dec 23, 2006
I'm rendering some junk to an FBO and I'd like to read the texture out into main memory with glGetTexImage. Unfortunately I'm getting "invalid enumerant" errors and it's driving me crazy. Does anyone have any idea what's wrong?

I create the texture like this:
code:
glGenTextures(1, &tex->id);
glBindTexture(tex->target, tex->id);
glTexParameteri(tex->target, GL_TEXTURE_STORAGE_HINT_APPLE,
        GL_STORAGE_CACHED_APPLE);
glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
glTexImage2D( tex->target, 0, GL_RGBA, tex->width, tex->height, 0, GL_BGRA,
	 GL_UNSIGNED_INT_8_8_8_8_REV, (const void*)tex->data);

GLenum status = glGetError();
if( status != GL_NO_ERROR )
	printf("error uploading texture: %s\n", gluErrorString(status));
and I try to read it out like this:
code:
glBindTexture( tex->target, tex->id );
glGetTexImage(tex->target, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
GLenum status = glGetError();
if( status != GL_NO_ERROR )
	printf("error downloading texture: %s\n", gluErrorString(status));
The "tex" struct members should be straightforward enough I hope.
The target is exactly the same (I've checked). "Format" and "Type" are also the same as you can see. I really don't see why I should be getting an "invalid enumerant" error. I can post more code if it's needed.

edit: For whatever reason it's working now. I guess the problem was somewhere else. I only wish I knew how I fixed it.

samiamwork fucked around with this message at 03:26 on Apr 7, 2008

Adbot
ADBOT LOVES YOU

samiamwork
Dec 23, 2006

Pseudo-God posted:

What do you guys think of polycode.org? The website and presentation make it look very good, but I have not heard of any game using it, or any person taking about it. Does anyone have any experience with it, and can write a couple of words about it?

I looked into it around last May and I would say that while it's pretty cool, I'd hold off on using it until there's a binary release. It's still a bit rough and the API is still in flux. It's more like löve2D and less like Unity. Hopefully that's the kind of info you're looking for.

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