HLSL: high level shading language.
Cg is a high-level shading language developed by nvidia. It can compile
into Dx9 code, and OGL code, either NV_* extensions or the ARB_vp and
ARB_fp extensions. It’s completely compatible with the HLSL
try out the following links. I hope its what you’re looking for:
What is cg anyway? An OpenGL modelling tool?
don’t worry about it, it’s not a problem :)
I disagree - because of your posts, ourselves and future members can
look up similar pitfalls we may encounter with the same problem.
so, thank you for bringing it up!
Well, as luck would have it, I figured out the tiling problem just after
I posted the thread; however, I am still looking for the plugin for
converting directly to .x in 3dsmax environment. :rolleyes:
I hate putting something on a forum and then figure it out on my own–
It wastes the reader’s time. Maybe I should try harder before I post
something. Thanks anyway…..
I would like to read an article that covers the typical stages of game
The main thing is: Every step needs to provide a good solution for Linux
programmers! As I only develop unter Linux there are some steps where I
have any tools that can assist me. For example: Character animation.
This is where
all my development stop as I don’t get an animated 3D model into my
I think we should add an option to that poll, which says:
“Program/Module/Engine/whatever else” Design
looks amazing!!!!! very impressive.
Would you be interested to make an article/tutorial on that? That would
be an excellent addition to the devmaster contributions…
Btw, it would be nice if someone could make an article about opengl
extensions; that would be really nice to have here….
just to let you know, that somebody will be submitting a demo about
I don’t suppose that is much use ;)…
It would be easier to find the problem if you post some code or at least
show the approach you are using. Its hard to judge based on the issue.
But the compression algorithm for TGAs (RLE encoded) is quite simple to
implement, too. So you
can reduce the size on Harddrive a bit.
Advantage with TGA-
Setting an ALPHa value in an editor (I suggest GimP) like Photoshop
would be far more easier and would also be less headache.Then you also
have the runtime Alpha value. If today you think htat you are on Earth
and Everything that is green is transparent in the world, suppose you
get a state where you have to render jungle - lo behold you are in deep
trouble - you would only be showing off Space or Desert. Not exactly the
kinda things you expect.
However TGA textures could be nasty big.
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 :)
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
Read the Red Book - it teaches you your assignment too.
Just take a look @ the following link - it has VERY good stuff
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.
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
took me ages those days to find that out, hehe…:D but its so simple:D
anyways, good luck
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
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
Try investigating on your own, using google and MSDN etc.
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.
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
you just want one color, so what you need to do is to set there alpha to
for every pixel
if pixel.rgb == colorkey.rgb
pixel.alpha = transparent
pixel.alpha = opaque
you can do that eighter before uploading the texture (and upload as
or, depending on hw, you can do it in the pixelshaders..
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..
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.