Tricks+of+Transparency+on+the+PCX

Posted by Wudpecker, Sunday, November 19, 2006:

=MYSTERIES OF THE TRANSPARENCY=

From Von Beerhofen---introducing the subject in "TRA ANOMOLY" at SimHQ: I can't really explain what is happening with the TRA file but I had this idea to use a 16 bit .RAW instead, which is also used for other purposes in EAW (EAW16.HM). In a hexeditor the output of the file is totally different from a TRA.PCX yet both files look the same in game, even though one is twice as large as a PCX and headerless and the byte order is completely different too. For the TRA.PCX a conversion is done with GPM2WPL or whatever it's called, however the 16 bit RAW works without conversion and only needs renaming. Further experiments with a multicolored PCX showed that the TRA wasn't doing the same thing as it does on a b/w drawing. With colors the pixels were clearly visible whereas using a b/w drawing resulted in smooth transitions on transparency which seems to suggest that the drawing is used as another transparency layer. The combination of both resulting in 256 transparency shades as long as b/w is used in both(16*16). Tests were repeatedly done on the clouds (BNCLOUD0 and BNCLTRA0.TER) and perhaps someone else could verify these findings as I might be going balmy and I no longer trust my own experiments.

Professor Von Beerhofen's researches at EAW "Hogwarts" University may seem a little dry and esoteric. However, the magic does show up when put to the test. Here are some examples--some by another master, Col. Gibbon, and by Ray Otton and I. I can tell you that EAW U. (pronounced Eee-Yuuu by teasing students from other schools while holding their noses) is a tough school. And this is only the 3DZ major. I'm not even close to Grad School. Our many tutors assure us "it's easy"--but never get beyond telling us the basics in "3DZ 101". We are lured into a bizarre and fascinating, sometimes frightening world of 3dz creation. Yes, we do make monsters. All too often. All the little secrets, exceptions and tricks are buried in "Cliff's Notes", Professor VB's old lectures, and other masters' and students' notes, in the archives in SimHQ Library and the Frat House. Gad! Where are you, Hermione! My eyeballs are falling out reading old tomes! To say nothing of required study in advanced PSP, PhotoShop, and use of two different 3dz!Studios that are sometimes booby-trapped for sorcerer's appretices. But I digress. [IMG]http://img.photobucket.com/albums/v113/Wudpecker/3dzstudioTRAWW.jpg[/IMG] A TRA transparency file. The pink shows up as "no color"--in other words, transparent-- while the deep blue marks out areas reserved for real color that will be shown in the full PCX "skin" Try to put any real color in a TRA file and you will get an astounding acid trip full of wild effects.

[IMG]http://img.photobucket.com/albums/v113/Wudpecker/3dzstudio-Gibprop.jpg[/IMG] Col. Gibbon's first attempts to use the TRA transparency file on his "M" 3dz of the C-47 "drop tank" came a-cropper. He marked out an area for the TRA file on his "skin" PCX. He got the black triangle with yellow tip at upper left. A common sight in many planes and cockpits (though the C-47 didn't have a cockpit--so he didn't have to worry). Hmmm. [IMG]http://img.photobucket.com/albums/v113/Wudpecker/3dzstudio-Gibprop2.jpg[/IMG] So the Colonel did the sensible--and unusual thing. He dispensed with normal tranparency and let the props always show themselves. It's the "black stick" put in the pink area where the triangle was. The pink doesn't show in game, remember? In a way it took the place of a normal TRA transparency file. Clever. The props did tend to rotate rather lazily and unrealistically, however. So....

[IMG]http://img.photobucket.com/albums/v113/Wudpecker/3dzstudiopropRayO.jpg[/IMG] ...Rat Otton did exactly what Von B. is talking about above. By manipulating the 3dz numbers, the "prop" can be spread out, seem to be transparent, and resemble the normal EAW props.
 * He used a black and white shaded area for the "prop".**

Like this: [IMG]http://img.photobucket.com/albums/v113/Wudpecker/R-Sprobs--frontview.jpg[/IMG]

I wanted BOTH Col. Gibbon's solid props for viewing before take-off and Ray O's spinning 'transparent' ones. So... [IMG]http://img.photobucket.com/albums/v113/Wudpecker/3dzstudiopropWW.jpg[/IMG] You can see both types of prop now in the upper left pink 'transparency' area. In you check the actual TRA transparency file at top above, you will see both types. (My version of Ray O's B&W prop did not work well. No way I could get a good "blur," just as VB is talking about above). BUT....The pink and blue TRA file itself isn't supposed to work in the "M" medium distance model. The one we are working with. Yet, Ray O. says it shows up about one time out of six in the game, when the transparencies suddenly work as they were supposed to. Damm. Where did I leave my broomstick? - From Von Beerhofen in reply basically tranparency comes from type 6 elements and the filename you use for the 3DZ. It's the filename which has a link in the EXE to it's counter part the TRA. Hence there are two files, the TEX and the TRA. The 3DZ never points to the TRA, it's the link which tells it that transparency is available. In general all models should be able to use the TRA, even ordnance and tmods as long as a TRA linked filename is used. VonOben used this trick to give transparency to TMOD shadows but I never got it to work on my machine. With some smart mapping you can steal or borrow them from other planes, a shared TRA so to say. A 3DZ could even point to the cloudlayers and borrow it's transparency but obviously you'd see the drawing of the model in the sky. If this trick works or not may well lie in used drivers or the Direct X version or OS in use. But there is another problem which may prevent it from working properly which is the file allocation in memory. When too much space is used for mods the texture memory starts to use area's which have other functions and weird things happen. For one the B29 cockpit is now causing the game to trigger the 'can't comply' file as soon as the game is entered. It's a kind of a garbled cockpit problem but what weird things happens depends on the programming which comes after the allocated memory area. Tests showed that these areas are also influenced by programs running in the background which also use allocated memory areas. Even switching off such programs may not allways free memory, only a reboot does. EAW normally starts from cache memory, once it is created (faster start then the cold start), unless it sees something vital has changed, even changes to files in the EAW folder don't allways seem to be recognised. So there are plenty of problems to take into account when things start going weird. Bugger, I see now what happens. A change to the exe told the cloudtransparency to take infro from the texture and for both texture and transparency the BNCLOUD file was used and the BNCLTRA wasn't read at all. So no matter what filetype you make it things seemed to be working fine untill you'd change the texture itself. A colored texture doesn't work as a TRA but a 256 shades b/w texture can work both as a TRA and as texture. Just totally forgot I used this trick a while back to save memory. Sorry guys, geez do I feel stupid.

Reply from Wudpecker:

quote: A colored texture doesn't work as a TRA but a 256 shades b/w texture can work both as a TRA and as texture.

Yes, I believe this is what we are illustrating above. VB's point of being unable to make it a True TRA by blurring and shading colors seems correct. Has to be black and white. quote:

In general all models should be able to use the TRA, even ordnance and tmods as long as a TRA linked filename is used. VonOben used this trick to give transparency to TMOD shadows but I never got it to work on my machine.

Since we will face the "shadow" problem next, any info on TRA linking is welcome.

As for forgotten tricks, that's normal. It's the frustration of lost magic only found in dusty archives--after long search.