Jump to content
Sign in to follow this  
Guest Vorlin

C gauge alpha goofyness.. Bill, you around?

Recommended Posts

Guest Vorlin

Before you say it, I *have* gone over the SDK's, the Alpha tute from Engauged and I've been living and breathing sd2gau17.zip for about four days now. I do read the manuals when I can find them!It's just an oddball issue. The working process:I use a greyscale gradient on a 45 degree angle for my alpha image.Import that image into the new alpha channel of my main image bmp in DXT bmp to make a 32b extended bmp.Port the whole thing over into Imagetool to re-format as an 8b bmp.In the sim, for *this* test, all is fine. Pure black is totally transparent and there is a nice gradient of opacity all the way across until the opposite corner is at 100% Alpha. At that point, I'm thinking that I'm home free...Yea, that's what I get for thinking again...Using the *identical* process with a simple circle of grey surrounded by all 0,0,0 for the alpha image, you would think that I'd get a semi-transparent circle with nothing showing around it as a result because the 0,0,0 should be transparent, exactly as in the gradient test.It's not... the semi-transparent area looks GREAT! But the black is, of all silly things, BLACK.Remind me to borrow Panther's icon of a stick figure pounding it's head on the keyboard... you out there Chris?Both the main image and the alpha image are set to 0,0,0 in this same area (meaning in the edges of the images)... and having black in the alpha on the same place as black in the image doesn't seem to hurt the gradient test one bit.I'm using USE_IMAGE_ALPHA and attempts to add USE_IMAGE_TRANSPARENCY don't seem to make any difference. When I tried to apply a mask to solve the issue, my semi-transparent area showed up all multi-colored... probably a format mismatch somewhere.All I want is to have the semi-transparent area stay just as it is but the black needs go away. Why does it work with a gradient but not with 2 colors, especially when I am NOT using imagetool's gaugealpha command. I'm leaving the alpha alone to make the partial transparency."Any help here would be hot..." Jar-Jar BinksThanks,Scott / Vorlin

Share this post


Link to post
Share on other sites

I'm afraid I'm not going to be much help, as I've never even attempted to create/use alpha shading in a gauge (yet)...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Vorlin

Thanks anyway. Something is odd... like a conflict or something.My landlord was here and I was showing him what I've been up to... so I tried to show him the one with the black box around it. Turned out that I had another attempt in there that looked horrid, so I reverted to the one described above.The #$*!$#$ thing displayed *perfectly* except that it was off center. I didn't understand why but I was a really happy camper... for a few minutes.I stashed a copy of that image on the side to keep it safe, and then edited the working copy.It failed again, same way.So, I copied the working bmp into my res folder and did another build.It failed again, same way. The excat same image that worked ten minutes ago now fails again. I have changed nothing other than the XY for the top-left corner and I edited the bmp, then reverted back to the original bmp. After the first time it failed again, I even set the corner back to where it was... still no help.It's almost as if there is a conflict or something. The alpha channel is 000 for pixels that are already 000 in the original, but it doesn't hurt a gradient alpha test to have it that way.X <-- pound head here.Still looking for any tips that could help. Thanks all.Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest Vorlin

When doing this nonsense, make VERY sure that BOTH of your seperate images (source image and alpha image) are in rgb mode BEFORE you even start DXTBmp.Add another line to my notes... now to find the 409 so I can clean the blood off my desk & forehead.Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest Vorlin

Also, make the main image have 000 for transparency and set the alpha image to pure white in the same areas (telling it to make the 000 full opacity, which is then interpereted as transparent).Yep, that's right, you set it to full opacity in order to get it to display fully transparent.If we don't get to use formats other than bmp in FSX, I may scream. This has got to be the most time-wasteful, counter-intuitive, pain in the neck process I've ever seen.Oh, and DXTBmp now seems to give us no other choice than to use square images, or it makes them square without giving us any choice. Whatever happened to allowing the developer to develop, rather than trapping us in unusual formats and dictating our image dimentions?Time for a break.Scott / Vorlin

Share this post


Link to post
Share on other sites

>When doing this nonsense, make VERY sure that BOTH of your>seperate images (source image and alpha image) are in rgb mode>BEFORE you even start DXTBmp.>>Add another line to my notes... now to find the 409 so I can>clean the blood off my desk & forehead.Just another hint with DXTBMP... Do not, under any circumstances use the "send to editor" or "reload from editor" functions, unless you particularly want to have little green artifacts show up in your bitmaps...Instead, use the 24bit export function to save a converted bitmap, and always, always load a 24-bit image from the command bar. ;)Glad to hear you got it figured out...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Vorlin

I got it but I noticed that certain alpha levels (lighter shades of grey in the channel) would work, but then have a nasty reaction to a sky blue texture that was on the image beneth... producing an odd green.It sounds oddly like what you were describing above, but I can't use send to editor at all because Gimp errors out if I pass an image in that way. I use drag & drop instead.There has got to be a better way... I save the hand-crafted image in one program, port it into the Gimp so I can create a second image for the alpha channel and then save both as 24 bit, port those into DXTBmp to combine the images and save the result as 32 bit and then re-port that into Imagetool as 32 bit with alpha just to re-format yet again as 8 bit with alpha.It's a wonder that I can still read the text after so many conversions. Extended bitmaps are supposed to offer us high resolution quality with little loss... and the format itself is good at that but by the time you go through 27 different programs to be able to do all the things you need to do in order to get partial alpha to work in the sim you've lost that resolution and more in all the conversions and resaves.They really have got to either encourage other image manipulation programs to add access to this format, create a tool that can do straight conversions to it from anything from psd and png to tga and xcf... or opne the sim up to formats other than extended bmp.I can live with any of those, I'm easy to please... but if the quality of things written for FSX is ever going to reach it's potential, something has got to give.Scott / VorlinEdit: Yes, I have tried saving as psd and going straight to Image tool. Image tool cannot see the alpha channel even though re-opening the image in Gimp proves it's there and working. It would be a nice thing to be able to do, if I could get it to work.

Share this post


Link to post
Share on other sites
Guest Vorlin

I found a way to get it all straight. I'm stuck between wanting to share and wanting to protect the work I've put into getting this fixed, so I'll point in the right direction:If you work with an image creation program that can export Targa RAW, not what is simply labeled as Targa but Targa RAW, then you can import *directly* into Imagetool and save as 8 bit with alpha.No more need for DXTBmp, no more need to do so many conversions, no more fighting with your image being resized against your wishes.Don't misunderstand, DXTBmp is great for the things it's made for. But that auto-resizing and need to do so many conversions was killing me when it came to doing other things.They key is the Targa RAW format. Imagetool rejects things I export with just Targa, but the RAW version of Targa works like a charm, with the alpha channel perfectly intact.Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest iholrf

My friend Walter Schneider, a retired abstract math professor and my mentor used get very frustraited with me becuase I could not understand a simple concept he kept trying to pound into my weak brain."Write the book."Not really understanding him, I ignored the advice until many years later and then I finally understood.What he meant was, the people who are remembered are the people who "wrote the book". Even if they did not independantly invent the technique or process (there are very few DaVinci's and everything else is build on the knowledge of others), what they did do was record it.If you dont record and share the techinque, others will, and they will be the ones taking credit and you may be the one saying."Hey I came up with that months ago"Write the book.Look at Bill, worst dernned programmer in the world ;), but he "wrote the book" on a few techniques.CheersShad

Share this post


Link to post
Share on other sites

>Look at Bill, worst dernned programmer in the world ;), but he>"wrote the book" on a few techniques.Well gee, thanks so much... ...I think... *:-*


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest iholrf

Heheh, yah know it aint true ;)

Share this post


Link to post
Share on other sites
Guest Vorlin

LOLYea, I've been keeping a ton of notes and some of it is in chapter format. The thing is that I'm still learning at a pace where anytime I'd think that the "book" was ready, I'd have more to add or clarify within 24 hours.When the learning curve on XML starts to slow for you, pick up C++. Getting a good handle on that? Time to shift over to learn more about graphics and what you can get them to do.When that's understood well, time for air files or modeling.The idea isn't to know it all, the idea is to understand what is needed at each stage in order to do the job well. If you're trying to achieve certain effects, they may require certain things to be enabled in the air file so that thay can be used in the gauges. If you don't understand both, you get stuck.What's driving me nuts today is that the gauges I'm making look great in one aircraft, at 200px width, but dropped to 100px width they look nasty. What really confuses me about that is that I made the gauge at 128 so that it wouldn't scale much at all to display at 100.Personally, I'd rather display at 128 and eliminate scaling altogether... but I didn't write the panel and the stupid panel is made for 100. Attempts to author at 100 have proven to be aggrevating... but I'm still working on it.Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest iholrf

Assuming we're talking 2d panel here, why not do what many do and make the gauges 300px. Much easier to work with and they scale well.The panel config can be changed to improve the scaling as well.I use a 2048 bit panel (you can always resize a bitmap) then a scale ratio of 0.5.Nice tight gauges and overall panel quality is terrific, frame rate hit on a semi-modern machine should be negligble.It is really all up to you, everything but the model is changable (and even that is to a limited degree).As for the book, write it like Bill and others, one bit at a time. Every little bit helps. :)

Share this post


Link to post
Share on other sites
Guest Mathias

Yup, am also a fan of the 300pixel variant! And concerning writing a "book" in bits an pieces Dai Griffiths also comes to mind :) He tought me FAR more than MS SDK's ever could!!!

Share this post


Link to post
Share on other sites
Guest Vorlin

2048 came out *sharp*!!! I'll have to try authoring in 300. Thanks!Scott / Vorlin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...