Submit
In response to Transparent color
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Mar 26, 2003 at 18:22

although it’s possible, surely pixel shaders would be a VERY stupid way to do it. It won’t provide much if any speed increase and it reduces your target audience wildly, because only top end Radeons support pixel shaders in hw.

not a flame, just an opinion :)

In response to 3D object
590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Mar 26, 2003 at 12:52

I am sorry Akirayuki if I sounded rude. I was just worried of the consequences of giving away code in this form. I hope you understand.
However if you would like there are places where you would learn a lot of stuff.
Read the Red Book - it teaches you your assignment too.
Just take a look @ the following link - it has VERY good stuff

http://opengl.org/developers/code/tutorials.html
Of these you better read the Online Books section. The others are short cuts to learning OGL and you might not exactly be able to learn it as much as you can. < No offence meant >
I hope you get to work in OGL and enjoy it too.

In response to Transparent color
6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Mar 26, 2003 at 11:25

good luck. happy to helped out

btw, this is what is done in the bumpmapping demo from nehe, to show the logos. he adds the alpha values manually in code to make them transparent..

took me ages those days to find that out, hehe…:D but its so simple:D

anyways, good luck

In response to Transparent color
49921baa7439fb1e91e02caf0a925cfe
0
DarkLight 101 Mar 26, 2003 at 11:17

Thank to all of you for the replyis. This is exactly what I’ve searched for. As I said I’m using RGB arrays for textures and there is no matter if I’ll use RGBA or I’ll convert TGA - this is the same. I’m just didn’t know that I can specify Alpha for each pixel in texture and then blend only transparent pixels :)
Again, thank you

In response to 3D object
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Mar 25, 2003 at 18:23

if your assignment consisted of more, it wouldn’t be a problem, but because it seems to me that to answer would be to tell you your whole assignment, then I’m gonna refrain from telling you the answer to YOUR assignment.

Try investigating on your own, using google and MSDN etc.

In response to Transparent color
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Mar 25, 2003 at 18:13

what you can do with the TGA is simple. The TGA format allows for 4 bytes of data per pixel. RGBA, red, green, blue and alpha. The alpha ‘channel’ can be different for each pixel. All you do is set it to 0 for all the pixels you want to be transparent, and 1 for all the ones you want to be opaque. You can also have values in between, but that produces semi-transparent pixels. You might want to look at the TGA format, as it actually stores the pixels in BGRA format. You need to switch the R and B bytes.

In response to Transparent color
6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Mar 25, 2003 at 18:06

well, the trick is.. you actually need an alpha value to determine transparency (and 1 or 0 == transparent is up to your set up of the blending equation..)

you just want one color, so what you need to do is to set there alpha to transparent..

for every pixel
 if pixel.rgb == colorkey.rgb
 pixel.alpha = transparent
 else
 pixel.alpha = opaque

you can do that eighter before uploading the texture (and upload as GL_RGBA!! :D)

or, depending on hw, you can do it in the pixelshaders..

base idea:

distance = fragment.rgb - colorkey.rgb
out.alpha = dot_product(distance,distance)

and then using for example alpha test to check if alpha is greater than some threeshold, say 0.01.. that means, distance to colorkey is far enough => color != colorkey => passes the alpha test

those are the two ways possible..

In response to Transparent color
49921baa7439fb1e91e02caf0a925cfe
0
DarkLight 101 Mar 25, 2003 at 17:07

Problem is that I don’t want to make texture transparent, only one color from it. I know the basic of alpha blending. Of cource, 0 for transparent and 1 for solid -exuse me. But this have no matter - I’m not seeking for exact code, only for solution.

In response to Transparent color
203e4e77a4880ecbd91054865fc5d0b7
0
Phaetos 101 Mar 25, 2003 at 16:44

Have a look at this page: http://nehe.gamedev.net/data/lessons/lesso…n.asp?lesson=08

It adresses directly the transparency and blending concept, and as I just read, 1 means opaque and 0 means transparent, not vice versa as I said earlier…

Cyrax: TGA is cool, yes. I use it quite often, too. Just for Info: Nearly any file format is described here: http://www.wotsit.org/

Greetings
Stefan

In response to Transparent color
49921baa7439fb1e91e02caf0a925cfe
0
DarkLight 101 Mar 25, 2003 at 16:41

@CyraX

Ever tried TGA??
They will have all that stuff embedded directly into the image.
It will greately ease your development time.

Can you explain? As I know OpenGL doesn’t support image formats
Can you tell me how to use TGA in OpenGL and what exactly it will give me?

In response to Transparent color
590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Mar 25, 2003 at 16:22

Ever tried TGA??
They will have all that stuff embedded directly into the image.
It will greately ease your development time.

In response to Transparent color
49921baa7439fb1e91e02caf0a925cfe
0
DarkLight 101 Mar 25, 2003 at 16:07

This is not exactly three, it is object which should particulary hide another objects. It is small and textures are created via RGB arrays. It is possible to use RGBA array and A-value 1 for all pixels that should be transparent? I think this should work (you say texture should be of the type GL_RGBA).
Thank you for the help

In response to Transparent color
203e4e77a4880ecbd91054865fc5d0b7
0
Phaetos 101 Mar 25, 2003 at 15:48

Hi!

You can create a tree, where each branch is a triangle or a quad plane and the
texture is of the type GL_RGBA.
Then, if you turn on GL_BLEND and provide the proper blending function
at glGlendFunc() the pixels with alpha > 0 will be more or less
transparent.
But this means, you have to provide an alpha channel in your texture image.
Most image manipulation programs can handle transparency. I suggest to
use The Gimp, its free and very powerful.

I hope this helps a bit

Greetings
Stefan

In response to Actual Game Developing
49921baa7439fb1e91e02caf0a925cfe
0
DarkLight 101 Mar 25, 2003 at 15:41

Currently I’m writting a game. It will be Open-source - I whink games should be kept open-source for many reasons. Game is using OpenGL for graphics and have level-editor included. I’m working in a team - I’m writting the game and the main code of the level editor, another person is making textures and writting parts of level editor :)

In response to 3D object
590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Mar 25, 2003 at 13:47

The whole forum is here to help (in the first place).
However you should understand that help is not doing ur assignment. You must first start coding and understanding the concepts - No spoon feeding here. We would like to train Hackers in Grafix. Try to ask you questions and we will give you answers.

Get started:
In OGL your bible/Quran/Gita/Granth Sahib == Red Book. You will find the online version of it too.
For some example OS related code - nehe.gamedev.net

If you want any other help - ask. Smart guyz ask for help.
I should however warn you - THIS IS NOT A PLACE TO POST YOUR ASSIGNMENT and ask us to do it.

In response to 3D object
6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Mar 25, 2003 at 13:46

well, i think on NeHe, you’ll find the needed code’s.. espencially code for a rotating cube is used in a lot of his tutorials (see tutorial .. 5 i think..)

for the sphere, he uses quadrics.. you can use other methods, but they are rather simple.. you’ll find it in another tut..

rotating:
check glRotatef(…)

scaling:
check glScalef(…)

moving:
check glTranslatef(…)

In response to game code
590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Mar 25, 2003 at 13:37

If you want to see/critic a game(s) then you have to first look @ what type of games they are.
Broadly you will find:
First Person Shooter (FPS) - Quake series, Unreal ,doom
Simulation :
|_ Space Simulation - Descent, Star Lancer
|_ Flight - M$ Flight Simulator, F22 Raptor, F16 etc; Commanche Series
|_ Car/Drive - NFS

RPG :
|_ Dungeon Siege
Arcade:
|_ Tekken series, Mortal Kombat
Scroll Games also RPG:
|_ Age of Kings/Empires, Command && Conquer series, Simcity, Caesar, Diablo
Third Person:
|_ Tomb Raider, Indiana Jones

@ one estimate you might be having more than 10 -20 genres today. So go ahead and work about with the history of games. Today’s games - well you will get lotsa help - but I guess you should first look @ the games that started it all - Mario, Contra etc; Then come to the Classic Doom, Wolfenstein. Then you might end up with the today’s gamez.
I think you will have a balanced act with:
StartX: Mario -
New Ideas: Doom
AI: Deus Ex/Max Payne/Half Life/ Thief - order of precedence Thief being best @ AI (IMHO)

In response to game code
E703c53346f243aa06e093b3cf2e30d4
0
craigl281 101 Mar 25, 2003 at 13:10

were going to do like a case study on them

and put down what made the game work out; he hasn’t told us a whole lot so far. but were going to tell what each part does
then after all this were going to make a little program using different specs to have a demo of each game

In response to game code
C24eb7e6aaefba78b94c831ddc7b4d0b
0
donBerto 101 Mar 25, 2003 at 01:35

baldurk: thanks for the correction

craig: how about giving us a little bit more info? we [or maybe just me] can’t help with so little information.

:yes:

In response to game code
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Mar 24, 2003 at 21:18

what do you mean ‘use’ those games?

In response to game code
E703c53346f243aa06e093b3cf2e30d4
0
craigl281 101 Mar 24, 2003 at 19:34

@donBerto

before I (or anyone else) provides answers

can you tell us more about the assignment? I don’t understand the “find games that have actually been sold…”

I didn’t think nehe had zelda, i thought it was that person that linked through nehe. i could be wrong…

check out:

freespace [links provided here somewhere]
ID software

can think of anything else on the top of my head.

he wants us to use games that have actually made it onto the market
like tetris, zelda, roms and such

In response to game code
6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Mar 24, 2003 at 19:09

http://www.flipcode.com/cgi-bin/msg.cgi?sh…orum=iotd&id=-1

that game has sources, too.. sure, its not yet a full game. but levels, enemies, etc.. so what? and its really fun to play:D

In response to game code
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Mar 24, 2003 at 19:05

NeHe never sold zelda, so that wouldn’t really count.

Also, ID Software’s website is idsoftware.com not id.com

In response to game code
2562953b4e8e2602a8bfc24b1123a341
0
EvilSmile 101 Mar 24, 2003 at 17:45

The source code for Quake II was released under the GNU - GPL.
So ,that’s free software too :) (free as in free speech)

In response to game code
203e4e77a4880ecbd91054865fc5d0b7
0
Phaetos 101 Mar 24, 2003 at 16:48

Hi!

The source of “Doom” was released, the source
“Descent” (very good game!) was released, too.
I think the source of Quake is free, too.

I once looked into the source of Descent and they did
a great job hiding the interesting parts in their
code *g*. So much for the clarity of the code.
The developers flamed each other in the code,
too. It was quite funny to read.

Greetings
Stefan

Welcome to DevMaster, a community-driven game development website of posts and resources!

Recent Tags

indie × 5
game-development × 5
ios × 3
android × 3
algorithm × 1
effects × 1
physics × 1
iphone × 1
c# × 1
mobile × 1
physics-engines × 1
native × 1
macos × 1
sound × 1
music × 1
networking × 1
testing × 1
multiplayer × 1
design-patterns × 1
game-programming × 1
3d-engine × 1
shaders × 1
cross-platform × 1
gaming × 1
game-industry × 1