PDA

View Full Version : SketchUp Alpha Channel..., or lack there-of...


CARex
08-22-2006, 03:32 AM
Forum,

Anyone experiencing difficulty in obtaining a ‘clear’ (read see-through) alpha channel in a SketchUp model?

According to the Google SketchUp User’s Group and the GSU Users Guide (Windows), SU supports Alpha Channel. And neither source suggests any special or unique process required to achieve the effect.

With the model in Paul’s Shape Viewer I can see through the chain link fence. However, with the model in the Sim,… I can not see through the chain link fence , just solid black (would-be) holes.

I’m at a loss. Any comments will be appreciated. Have a sparkling evening.
Bob

inflammable
08-22-2006, 12:52 PM
I'd like to start out with, I don't know anything about Sketchup.

Shape viewer shows you the alpha, because it sees that the ACE has an alpha, and applies it.

MSTS doesn't show the alpha, because the shape file doesn't tell it to look for an alpha.

It could be that the steadily up and coming MSTS plugin for Sketchup doesn't support that yet.

But you can manually change the shape file to allow alpha.

If you uncompress the shape file, and open it in your favorite text editor, the tell it to Find 'prim_states' without the quotes.

The prim_states parameter will be followed by an opening parenthesis, and a number. The number refers to the number of textureable parts.

This next part will be easier if you back up, and go back to Sketchup. If it allows you to, then make everything that you want to have the alpha have the same part name. I don't know if this is allowed or not. Then go through and export the shape.

Going back to the uncompressed file in the editor, look for the 'prim_state partname'. Under it will be 'tex_idxs ( 1 0 ) 0 0 0 0 1 ).
Looking at the final 5 digits, the first two is the two digit part number, that the shape uses to keep things straight. the next three have to do with the transparency. Like I wrote it there, the part will be not transparent. If you change it to ( 1 0 ) 0 0 1 0 1 ), the middle digit to a 1, then it will be transparent.

Then load the shape back into MSTS, and that part should show the alpha.

If you want, then just change all the parts to alpha-able, and it may be easier than trying to figure out which one you actually want to change.

I hope this is understandable, and somewhat helpful.

James

CARex
08-22-2006, 02:41 PM
Hi James,

Meanwhile I had sent Paul an eMail requesting his input. And he responded this morning. He asked that I post him the basic files and would check it out. However, he mentioned .TGA files in his response. That set me to thinking. So I went back, created a .TGA file from the original .ace file, imported the .TGA into the SU shape/model (saw immediate results), saved it, created a new .S, inserted it to the shape folder…, did not do anything to the texture folder. Fired up the RE… low and behold… I could see through the chain link fence.

‘Course I haven’t viewed it in the Sim yet, so I hope this enthusiasm isn’t premature. But if I’m seeing thru the fence in two out of the three… I presume it will be OK.

Up til now, I have been creating ‘basic’ solid shapes/models. And doing so with Jpg textures. Being sure to create an .ace file for the MSTS texture folder. And everything has been working. Actually, I may have added an extra step to my routine this way…, but “if it ain’t broke, don’t fix it”.

All that I’ve ever used in any work was .ace files. Never gave a thought to .TGA files. And I’ve always achieved my desired result. But I’ve never modeled until now (read SketchUp).

Thanx for your input and have a sparkling day,
Bob

Zendude
08-22-2006, 03:21 PM
I had the opposite problem using acleantrack1.ace to texture the top of a bridge endpier berm. I had to save the .tga as a .jpg stripping the alpha channel out so that one could not see through the berm.

decapod
08-23-2006, 05:10 AM
The way it works is that a texture file ending in ".tga" is used to trigger the use of a shader "BlendATexDiff"
Other texture file names use "TexDiff" only - the opacity value of the material detaermines the prim state alpha test value.

The plugin is a script file you can read with notepad. If there are any programmers out there who want to get some clues as to what features it supports.

Hack
08-23-2006, 09:18 AM
>I had the opposite problem using acleantrack1.ace to texture
>the top of a bridge endpier berm. I had to save the .tga as a
>.jpg stripping the alpha channel out so that one could not see
>through the berm.

Why not set the berm as a terrain object? Doing so would prevent the track from disappearing.

Cheers!
Marc - 3DTrains
http://www.3dtrains.com

[link:www.3dtrains.com/products/index.shtml|http://www.3dtrains.com/images/pro_funit_atsfmain.jpg]

Pro Series v4.0 SuperPacks

Zendude
08-23-2006, 01:04 PM
By setting the end piers as terrain objects the trackbed would also overlay the end wall. As you can see from this view one end of the bridge is a ballasted deck girder while the other 2 spans are open deck. This caused some odd things to happen visually.

http://forums.flightsim.com/vbts/up1/109754.jpg

The other pier isn't finished yet, still looking for a cut stone wall in good light without stuff growing all over it. If you see a nut with a digital camera tromping around some right-of-way it's just me.

Hack
08-23-2006, 09:25 PM
If the bridge were to rest upon the abutment (as it's supposed to), you wouldn't have this issue. ;)

Kidding aside, there are so many quirks with this sim, that finding a solution for one thing, always seems to cause a problem elsewhere. I suppose it comes down to which glitch bothers you less.

Cheers!
Marc - 3DTrains
http://www.3dtrains.com

[link:www.3dtrains.com/products/index.shtml|http://www.3dtrains.com/images/pro_funit_atsfmain.jpg]

Pro Series v4.0 SuperPacks