See Through Polygons With a Texture?

Started by
5 comments, last by karwosts 13 years, 4 months ago
I was wondering if I'm able to use transparent images with a white shape in them to see through other polygons in the screen.

Here is an example:
Lets say I draw a quad over 3 other quads.
Those 3 other quads have textures on them that I want to see though.
So I assign the 4th quad thats overlapping the other 3 with a white circle texture.
I want to use that circle in the texture to see through the other quads.

Is that possible without the use of GLSL? I'm not sure sure how to ask this in graphic speaking terms, but I also have a small question if anyone can answer it.

I'm using glReadPixels to save an image in FreeImage API. I was wondering if I can change the image quality of the output image read from OpenGL so the resulting .jpg looks more high resolution when the .jpg is saved.

Thanks, Andrew.

P.S I'm not afraid or don't hate to use GLSL, but I want to aim my software for video cards that are using OpenGL 1.4. Silly I know right? But my testing station only allows 1.4 functions and that doesn't include GLSL shaders... :(
Check out my open source code projects/libraries! My Homepage You may learn something.
Advertisement
Technically it's not possible with our without glsl, I think you need to strengthen your understanding of the graphics pipeline.

Once you draw an opaque object, it obliterates whatever was underneath it, there's no way to "peel it off" or "undo" it. The information of what was behind it is just not there anymore.

If you describe more what effect you're trying to achieve, there may be alternate methods to achieve it, but in general once you draw something you're stuck with it until you clear the frame.

If you can change around the order and draw your circle first there's some tricks you can do with the depth buffer to prevent your other 3 quads from drawing those pixels, but you're going about it in reverse order.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
If you can do it in the reverse order, use alpha testing on the quad with the white circles (so it doesn't draw the white circles) and render into the stencil buffer. Then render your other quads.
[size="1"]
I see, I'll have to play around with this then and see what I can get. Also is there some sort of OpenGL program I can use to play around with BlendFunc or maybe play with the draw order of polygons?

I do remember playing with a OpenGL tool that allowed me to draw quads and play with OpenGL functions to get affects going. By any chance would anyone know where I can find it?

Thanks, Andrew.
Check out my open source code projects/libraries! My Homepage You may learn something.
Maybe this would help.

Visual glBlendFunc Tool

I think was created by a gamedevver a while back.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
I think it's pretty useful, but what function do I use the drop down for Display? I tried Google, but I can't find anything on those words with Google that show up a function that uses that.
Check out my open source code projects/libraries! My Homepage You may learn something.
If you're talking about the display box on that page, that's not part of any function. All blend mods have a source, destination, and final color, changing that is just a different way of looking at the data sources.

Source is the color that you're drawing, destination is the color that's already in the framebuffer, and final is the result of the blend. All blend modes use some combination of source/destination to produce the final color.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

This topic is closed to new replies.

Advertisement