Masked Textures

Member
Posts: 198
Joined: 2005.01
Post: #1
My apologies if this has been answered elsewhere in this forum.. haven't dug all the way through it yet.

I have a nice Aqua-like arrow animation I made using a Gimp script-fu program. It's pretty basic when you break down the pieces, a gradient from top to the center for a highlight, and a dark to bright gradient in the background for the gummy center; then a border and a shadow:

http://www.allusion.net/bard/tmp/arrow_rot_test.gif

My only problem is that I got to looking at the space requirements to do this thing at 64x64, and I figure it'd take almost a megabyte of texture memory, and that's only for one arrow type. Eek. Plus it feels impure to load up 60 frames of rotation animation when it seems like I ought to be able to do this programmatically.

So my question is, is there an easy way in GL that I could have a 64x64 "gradient" texture (specifically talking about the highlight) and mask it to the current shape it should have in the rotated configuration? I figure the stencil buffer would do things like this but that seems like awful overkill Smile

Thanks for any suggestions...

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #2
Hmm... after a bit of research into the subject, the stencil buffer appears perfect for this, actually:

http://www.opengl.org/resources/tutorial...de198.html

Even nicer, if the stationary textures are just gradients, I don't even need textures for them. What a cool feature...

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  2D. Rendering to a Masked Texture Zwilnik 3 3,022 Mar 23, 2003 04:07 PM
Last Post: Zwilnik
  Halo around masked sprites Bachus 3 4,812 Feb 4, 2003 06:26 PM
Last Post: NYGhost