• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

smitty1276

Alpha component of textures.

7 posts in this topic

I want to draw a quad with a texture mapped onto it. I only want certain parts of the texture to be visible.... for example, an icon on the screen, where you can still see other objects behind the "empty" parts... perhaps a little sword in the corner of the screen in an RPG that the player could click on. My question is: what would the RGBA (especially the A) values need to be for the quad and the texture to make that work? Also, is this the proper/best way to do that?
0

Share this post


Link to post
Share on other sites
Yes, setting the alpha values is the first step. The most logical would be setting them to 0. The next step is to enable alpha testing and here do you also decide which alpha that will pass the test. One example
http://www.ati.com/na/pages/resource_centre/dev_rel/sdk/rage128sdk/OpenGL/Samples/Rage128AlphaTest.html
0

Share this post


Link to post
Share on other sites
I realize that setting the alpha is the first step... what I''m wanting to know is to set the alpha for WHAT? If I set the alpha to 0.0 for every pixel on the texture, would I still see the quad behind it? OR, does the quad itself need an alpha value of 0.0 before the whole thing would disappear?

I want the non-black parts of the texture to be good and bright.
0

Share this post


Link to post
Share on other sites
Why not look at the example?
You are thinking of the quad and the texture as two different things but both are proccessed at the same time. If you are setting the alpha values with glColor for the vertices of the quad will the values be interpolated but you want to cut out something like a sword.

You must set the alpha values for the texture this can be done using a paint program such as Paint Shop or Photoshop. The RGB values for the texture does not matter, black or white or something else. Look at the example also the red book covers alpha testing.
0

Share this post


Link to post
Share on other sites
Okay... sorry. I should''ve looked at the example first. I just got the erroneous impression that you misunderstood my question.

Thanks.
0

Share this post


Link to post
Share on other sites
check my site ( the most recent demo ) the leftside box is your textures pixel colour, the middle is whats alreay on the screen.
play around with the blending methods and few the final pixels colour on the righthand side of the screen

http://members.xoom.com/myBollux
0

Share this post


Link to post
Share on other sites
This may be a dumb question...

In the example, there is this line...

glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);

What is GL_REPLACE? I thought that the only options were GL_DECAL, GL_BLEND, and GL_MODULATE. Is this a Rage specific thing?
0

Share this post


Link to post
Share on other sites
I probably missunderstood at least part of the question but it is easier to talk about a example. You want to know how the texture data is mixed with the quads data, right?

GL_REPLACE is a standard and means that the RGBA values is from the texture only. Use replace as in the example in your code. From the red book:
"void glTexEnv{if}(GLenum target, GLenum pname, TYPEparam);
void glTexEnv{if}v(GLenum target, GLenum pname, TYPE *param);
Sets the current texturing function. target must be GL_TEXTURE_ENV. If pname is
GL_TEXTURE_ENV_MODE, param can be GL_DECAL, GL_REPLACE, GL_MODULATE, or GL_BLEND, to
specify how texture values are to be combined with the color values of the fragment being processed. If pname is
GL_TEXTURE_ENV_COLOR, param is an array of four floating-point values representing R, G, B, and A
components. These values are used only if the GL_BLEND texture function has been specified as well.
The combination of the texturing function and the base internal format determine how the textures are applied for each
component of the texture. The texturing function operates on selected components of the texture and the color values
that would be used with no texturing. (Note that the selection is performed after the pixel-transfer function has been
applied.) Recall that when you specify your texture map with glTexImage*D(), the third argument is the internal format
to be selected for each texel."

On page 268 do you have tables with the equations. You can download a pdf with the red book for OpenGL 1.1 here at gamedev.
0

Share this post


Link to post
Share on other sites