PDA

View Full Version : WAD textures that don't need blue parts.Please!!!!!



Mihail121
03-14-2003, 11:01 PM
Hi!

Please help me cause one of my engine parts depends on that.As all of you know i'm doing HL BSP load but there is a sligh problem.The texture parts that must not be seen are blue backgrounded.The problem is that what ever i do there is still some blue spots that are making some crap of the whole story.Please if anyone can do some research or just tell me a calculation to remove all of the blue parts.PLEASE!!!

10x

rgpc
03-14-2003, 11:18 PM
for (nY = 0; nY < tex->height; nY++)
for (nX = 0; nX < tex->width; nX++)
tex.rgba[(nY * tex->width) + nX].alpha = 0;


Even better yet...




for (int nCount = 0; nCount < 100; nCount++)
MessageBox(NULL, "I will stop posting OT Halflife questions in the Opengl forum.", "Get the point!", 0);





10 Print "GOING TO HALFLIFE DEV FORUMS NOW."
20 GOTO www.forumplanet.com/planethalflife (http://www.forumplanet.com/planethalflife)


[This message has been edited by rgpc (edited 03-15-2003).]

Mihail121
03-15-2003, 12:29 AM
Ok!

I'll stop posting about HL.But in times like this i want to be able to jump trhough my computer,come to you,and as the guys from Limp Bizkit say "BREAK YOUR ****IN' FACE TONIGHT".No hard feelings.As you noticed i don't ask about how to load BSP,the history of the BSP,BSP revisions over time but i ask for simple OpenGL - related question about how to perform color clearing operation.No since you know where planet Half-Life is i suggest to take a spaceship go there as soon as possible.Planet Mars is also a good suggestion.You can tell to the greenskined figures there how good programmer and HOW STUPID actually you are.

rgpc
03-15-2003, 02:52 AM
Don't tell me the message is finally getting through. Opengl couldn't give a rats as to how your images are stored, or whether you need to clear the blue mask out of the data read from the WAD file.

What you are asking is how to process the data read from a file so that it displays properly when you send it to Opengl. It doesn't involve Opengl - you could be using DirectX or GDI - IT IS NOT RELEVANT TO THIS FORUM.


No since you know where planet Half-Life is i suggest to take a spaceship go there as soon as possible

I wonder whether you are just being childish or you genuinely are not aware that there is a planet halflife (http://www.planethalflife.com) . You do strike me as being too thick to understand that you would get more assistance by posting on forums that are dedicated to people doing development related to Half life.


As you noticed i don't ask about how to load BSP

No you've already asked that question and others concerning HL (there's no actual opengl content in any of these posts - save the calculation of texture coords - which is not really opengl and better suited to the basic forum)

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008830.html)

and

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008832.html)

and

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008928.html)

and

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008946.html)

and

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008960.html)

And then there's the Quake3 question

here (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008842.html)

------------------------------------------

Ysaneya
03-15-2003, 02:55 AM
Well, let's see your posts history:

Nehe tutorial 36: off-topic reply about VC++ 7
Half-Life BSP!!!: completely off-topic
BSP Bezier patches: off-topic
"noshader texture" in Quake3: completely off-topic
Effect from Game developper magazine: off-topic reply about bulgaria
HL BSP texcoords: completely off-topic
HL lighting: again BSP stuff, completely off-topic
HL BSP but this time OpenGL too!: more or less on-topic
Chat rooms about opengl programming: off-topic, granted everybody went off-topic quickly
WAD textures that don't need blue parts: more or less on-topic, but poorly described

Because you're working on a HL BSP loader using OpenGL doesn't imply that any question you have about your HL BSP loader is on-topic.

Y.

rgpc
03-15-2003, 04:05 AM
Originally posted by Ysaneya:
Chat rooms about opengl programming: off-topic, granted everybody went off-topic quickly


Was that off the off-topic or just off-topic. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

SirKnight
03-15-2003, 09:30 AM
Please if anyone can do some research or just tell me a calculation to remove all of the blue parts.PLEASE!!!


Why should WE do graphics research for YOUR program? That's YOUR job.

Also, could you explain what's going wrong here? I don't quite understand what you want. Do you just want to eliminate the blue component altogether, or make what ever is blue considered to be transparent, or what? Maybe a screenshot of how it _should_ look compared to how _yours_ look would be helpful.

-SirKnight

jwatte
03-15-2003, 11:23 AM
I believe he doesn't quite have the appropriate words.

What I believe he's saying is that he has crhoma-keyed textures, where everything that's blue should become transparent.

This can be done using ARB_fragment_program, but it's probably better done as a pre-process in C code where every pixel is examined, and if it's blue, set the alpha to 0, else set the alpha to 1, and turn on alpha test.

For more information, check wotsit.org for image file format information, and the beginner's forum for how to enable alpha test and what it can do for you.

Or just download the OpenGL specification and read it from start to end. I highly recommend it.

Mihail121
03-17-2003, 02:24 AM
Well guys i just think that all you do is escaping the direct question - ho to remove the blue color.Tips,tricks articles and etc.It seems that you can't this trick and i'm not impressed since it's hard :-]]]].Now for my posts.This is a free forums and the only people who can tell me whether to post something or not are the moderators.Now i suggest to answer to the topic question or else just SHUT UP!!!

P.S.
Ofcourse i know where planet Half-Life is you jerk.As you can see in my previous reply i also suggested planet Mars since the guys at HL are just to good for you!

JustHanging
03-17-2003, 03:05 AM
Mihail, rgpc already told you the answer in his first post. Kind of. The idea is to scan though the texture at load time and for each blue texel (rgb = 0, 0, 1) you set the alpha component to zero, and for the others set it to one. Make an rgba texture out of this and when drawing, alpha test out the fragments with zero alpha. You do this by calling

glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5);

If there's still some blue color on the edges of the cut-out parts, you might want to replace the blue color (keep alpha as 0) with the average of those of it's neighbour texels that aren't blue. Or more easily, just make them black, often that looks ok too.

As for the rest of this crap, I find this guy's question perfectly on-topic, and if some of his previous ones haven't been, this is hardly the place to tell him that.

-Ilkka

Tom Nuydens
03-17-2003, 03:15 AM
Mihail, even if people are giving you crap, flaming them back won't do you much good. And quoting Limp Bizkit songs is the ultimate sign of immaturity. So don't http://www.opengl.org/discussion_boards/ubb/smile.gif

-- Tom

Mihail121
03-17-2003, 03:28 AM
Well exuse me but they started it first.If the engine is not for this forum then don't answer it.But if the you are able to help me then give the tip.No need to add flames to the topic icons.

JustHanging
03-17-2003, 03:35 AM
Originally posted by Mihail121:
Well exuse me but they started it first.

Another ultimate sign of immaturity. Your question has already been answered here at least twice. If there's still something you don't understand, you have to be more specific, not to mention constructive, to get help.

-Ilkka

Deiussum
03-17-2003, 05:48 AM
Now I remember why I've been mainly sticking to reading the beginner's forums. You guys can be brutal. http://www.opengl.org/discussion_boards/ubb/smile.gif

davepermen
03-17-2003, 06:33 AM
Originally posted by Mihail121:
Well exuse me but they started it first.If the engine is not for this forum then don't answer it.But if the you are able to help me then give the tip.No need to add flames to the topic icons.


haha. we flame him by adding flames to the topic icons! haha http://www.opengl.org/discussion_boards/ubb/biggrin.gif

seriously. there are no moderators in here, thats why moderators will not tell you to shut up, but we do.

for every ***ing pixel, if pixel == blue, then pixel.alpha = 0, else pixel.alpha = 1.
do alpha testing

done.

and please now move over to planet halflive, its the place for you to be. thats why those planets exist. and for your info, those planets do have homepages! http://www.opengl.org/discussion_boards/ubb/biggrin.gif

seriously. shut up and get mature. then you can come back, at the moment you learned to actually understand wich forum is apropriate to a specific question, and you actually know what you really want to ask.

first, learn to use basic opengl. then, when you move over to advanced opengl, this is the forum for you.

what you want is perfectly described in a nehe tutorial. the one with the bumpmapping.

find it, read it, try it, understand it, learn it.

jwatte
03-17-2003, 08:11 AM
That's certainly the last time I answer a question from Mihail121 -- he responds to my description of two suggestions with *THAT*?

VikingCoder
03-17-2003, 10:37 AM
"No need to add flames to the topic icons."

The flame icon means it's a hot topic, Mihal. That there have been many posts in it.

And just as you have the right to post any question you want here, we have the right to inform you that your chances of getting an intelligent reply are much improved if you actually ask your question someplace where the people already know what you're talking about, and are willing to respond to your question.

Elixer
03-17-2003, 01:00 PM
Sure, I will do the research for you! My fee is $100/hour, minimum of 5 hours.

rgpc
03-17-2003, 07:59 PM
Originally posted by davepermen:

for every ***ing pixel, if pixel == blue, then pixel.alpha = 0, else pixel.alpha = 1.
do alpha testing


I don't know dave, I reckon you should set all the pixels with an alpha of 0, just to be sure... http://www.opengl.org/discussion_boards/ubb/wink.gif


haha. we flame him by adding flames to the topic icons! haha

Lol http://www.opengl.org/discussion_boards/ubb/biggrin.gif


Originally posted by jwatte:
he responds to my description of two suggestions with *THAT*?

It's mini-shanedudddy. Identical in every way except 1/8th shanedudddy's size... http://www.opengl.org/discussion_boards/ubb/eek.gif


[This message has been edited by rgpc (edited 03-17-2003).]

Mihail121
03-18-2003, 01:18 AM
Yeah sure!It seems that you guys are even bigger idiots than i originally thought.Why do you jerks think that i'm posting for help.Ofcourse i've tried to set 0 alpha value for each ***ing pixel which has red and green values to 0 and blue value of 255 but the ***ing problem here is that this things doesn't fully work!The most of the blue pixels are removed but there are still blue edges!Maybe if you deserve i'll post a screenshot!!!About having no moderators.If there are no moderators than everybody can speek and ask whatever he wants and you are the last people on the world that will tell me to shut up!And about the beginner forum.Maybe you guys should stick there and learn something from the newbee guys.

P.S.
That was all.I think there is no need of continuing with this.I have nothing against you and i believe you have nothing against me.Now BSP questions will be asked again so let's just continue with the normal OpenGL work!

JustHanging
03-18-2003, 01:25 AM
Man, did you ever read my first reply? Repeating myself, for each blue pixel set it's new color to the average of it's adjacent, non-blue pixels. If there aren't any, make the pixel black. Guarenteed no blue borders whatsoever. It's been a real pleasure helping you.

-Ilkka

Mihail121
03-18-2003, 02:10 AM
Sorry but i've been so busy with the bull****s that WE'VE been talking so i've mist it!But now we're talking like we shoud.You're way is really good.10x for the help!

SirKnight
03-18-2003, 08:13 AM
This thread has been quite comical to me. http://www.opengl.org/discussion_boards/ubb/biggrin.gif Don't you just love it when you tell someone exactly how to do something and they act like you didn't say anything? I know this just tickles everyone's fancy here. http://www.opengl.org/discussion_boards/ubb/wink.gif

And Mihail, I don't know if you realize it, but it was your own fault this thread turned out the way it did. If all of these people here are jerks and meanies then every thread on here would be full of bashing and scornfull remarks. I have been around on this board for quite a while so I know how the regualrs are and they are NOT stupid by any means. But when 95% of your posts are off-topic and your replies to people trying to help you are scornfull, then what in the hell do you expect to happen? You sir are acting quite childish. Nuff said.

-SirKnight

[This message has been edited by SirKnight (edited 03-18-2003).]

JustHanging
03-18-2003, 08:24 AM
Let's sink this load of ****. Everybody answer one question below this topic, and it should be out of the front page in no time.

-Ilkka

JustHanging
03-18-2003, 08:27 AM
Oh and don't, under any conditions, reply to this thread anymore. (oops, I just did...)

ps. That's some fast censorship!

ToolTech
03-18-2003, 08:36 AM
Micka..

If you are using mip maps you will perhaps sample the "alpha" fixed image after you fix have been applied. This will possibly result in sampling in "blue" contents into the mip maps where the alpha is not fully zero.

Solutions..

1. You need to adjust your sampling algo to take alpha values into account for non "bleeding" sampling

2. or.. You can apply you alpha fix for each sub mipmap after you have created the mipmaps.