Sign in to follow this  
arno

Transparency and textures

Recommended Posts

Hi,Using "old-style" transparency (via e.g. FSDS) my textures with transparency start to flicker a lot in the simulator. When I use DXT with alpha channel (importing the alpha via DxtBmp), I get rid of the flickering completely, but there is a nasty side effect: the colour I've given transparency to, replaces the transparency in the sim at a certain distance (not very long distance), and a fence can e.g. become solid and black, instead of transparent as I want it. Is there a way to go around this matter? This issue does not seem to depend on the amount of transparency, it's there regardless of me having 10% or 100% transparency.Grateful for help.../Sebastian

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hello Sebastian!If You use transparent texture for fences then I would suggest to you, that You actually make two parts (fences) in FSDS. One with texture that has condition distance from 0 to 200, and the second one, which does not have a texture but put a material on it, let say gray RGB 200 200 200 with alpha let say 70-100. I had a similar problem with my fences and this is the best way to doeal with them.If You have windows, that is another problem. There is difference on applying DTX1 and DXT3 textures to part. I made a test house just to see what will happen if I have three parallel parts, the innermost as nontransparent, the other two walls from transparent or opaque material. And wow, the "house" had 8 different paintings on it... If You are interested in this, I can send You the API and 2 textures to see what is going on :)Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I guess you can keep the api, Goran. :) Sounds like FS is playing you tricks on that one!So far I've been using the "old-style" transparency which flickers, but I've also been using a part that is transparent and gray, and together they look quite good, from far and close distance. However, getting a "perfect" fence would be even better. :)Thanks, I'll try to test it and see what it looks like...

Share this post


Link to post
Share on other sites

Hi Sebastian,I would advise not to use the FSDS editor to make a texture transparant. I don't exactly know what kind of textures it produces, but ImageTool can usually not read them, so it's a bit of a weird format I guess.I use DXT textures all the time, without problem. I just make them by adding the alpha channel in the paint program already (and saving in a format that ImageTool knows), that's also a much faster way to make them in my opinion.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

What's the difference between DXT1 transparent and DXT3 transparent? I just don't seem to get it...

Share this post


Link to post
Share on other sites

DXT1 has a 1 bit alpha channel and DXT3 a 4 bit. That means that with DXT1 you can only have black or white in the alpha channel and thus only fully transparant or not. With DXT3 you have 32 colors to use, so different levels of gray also and that means you can have levels of transparancy.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

I noticed that DXT3 + alpha does not create that strange solidness that I earlier experienced with DXT1 + alpha. Could that be something for you Goran?/Sebastian

Share this post


Link to post
Share on other sites

Hi Sebastian!I use DXT3 primarly for making nice semi transparent effects on windows. But to put DXT3 texture on object You must set "Part uses transparent textures" otherwise You'll get very very interesting effects. I have enclosed API, that I mentioned earlier. To use it, You must prepare two bitmaps, named DXT1TST.BMP and DXT3TST.API. I made two completely different bitmaps with windows and DXT1 has completely transparent windows while the other one has semi-transparent window. Look to the second picture, what has come out in FS: one side of house, 4 different things! The last picture shows, how each poly is defined and which texture it has. Take a look, download the API and try it.But I must mention also this. If You have two walls where the outside has DXT3 bitmap, the inner must have DXT1 texture. I don't remember when but on some occasions, the inner walls completely dissapeared when using DXT3 texture on outside wall.Using textures has become now very interesting... :)Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hey, that must be what happens to me too. On one spot (normally it seems not to happen) the building behind disappears when it is hidden behind the transparent texture, but only from certain directions. Quite strange. Earlier problems like this have been fixed by placing the transparent part last in the drawing list, but then that was in FSDS and when parts in the same macro started to disappear. Now the building behind is a macro in itself, and it doesn't help to place the fence last in Airport's 3d-object list. So you mean I can get rid of this feature by telling the object to be a "Uses transparent textures"-object? Must try that out then.../Sebastian

Share this post


Link to post
Share on other sites

Hi Goran,I think this has nothing to do with the type of textures you use. What you see there is the effect of the drawing order. Basically the idea is that the z-buffeting of FS does not display a polygon when it is drawn behind another polygon (to prevent bleed through). That's why transparant textures only work correct if the inner ones are drawn first (otherwise they would dissapear). For complex objects this means that there is not one drawing order that works fine and then you need to use a different drawing order for different angles.Unfortunately most design programs don't handle this drawing order very well and that is the reason of all those transparancy problems that pop up here so often :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arno!If that what You say is allways true... Unfortunatelly it is not. Download the API and try it. On the picture You see only what is happening on a texture applied to a poly Which "uses transparent polygons". Take a look on another side.... Funny things happen. And not to mention, wall 2 and 3 (inner walls of course) do not have any texture applied, if it has texture then even more strange things happen!Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I downloaded it and have a look at it this evening.The only thing the option "has transparant textures" does is to place the particular object at the end of the drawing order.Well, I'll first have a look and then probably have more comments :D.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi efva2002,I had exactly the same problem with multi-level transparent textures 'masking' objects behind and I fixed it thanks to help from my good friend Gary Summons. Here is the reason for the problem, and the solution.FS draws objects by their ref point location (the centre of the FSDS area when using FSDS), not by the object's actual location.So, if you have 2 objects from diff FSDS files, with one in front of the other, the ref-points may actually be the opposite way around. FS will draw the furthest ref-point objects first, not the visually furthest objects first. It's know of a complex situation to explain.I suggest you split your single FSDS file into seperate ones, if they are not, and then have in each file, the object exactly in the centre of the FSDS area, and adjust the project locations accoringly, and output as seperate bgl files. It fixed the problem for me. I doubted it at first but then found Gary to be exactly right.hope this helps.Regards,

Share this post


Link to post
Share on other sites

Thanks OliMinch, I understood that very well. The ref.points are actually the way you told, parts not centered etc. etc.

Share this post


Link to post
Share on other sites

Hi efva2002.If Oil's solution is right, this might be an application for TransformCall ( BGLC'c POINT_VICALL ), that we had discussed using for preserving the autogen. Perhaps the drawing order could be established by the 'temporary' offset of the refpoints.You might be able to take them up to 32000 meters, and then N-S, E-W as much as you need to establish the drawing order. The high altitude wouldn't disturb anything else on the ground, maybe?Or maybe that's just a silly complication? :)Dick

Share this post


Link to post
Share on other sites

In such problems I suggest to put everything in one project and then use VectorJump commands to control the drawing order. I used that to make the terminal at Schiphol and it works fine.But indeed the problem is the z-buffeting as I indicated above (and OliMinch said the same in different words). But to add to this, for complex objects it can also happen in one single object. Then it has nothing to do with the reference point (as there is only one), but it is the drawing order of the different object.To come back to Gorans macro.I had a look at it last evening, and after changing the drawing order a bit, here is the result:http://home.wanadoo.nl/arno.gerretsen/pics/goran1.jpghttp://home.wanadoo.nl/arno.gerretsen/pics/goran2.jpgI changed the gray color of the middle section to blue so you can see the result better. The red texture is DXT1, with two quadrants transparant and the green texture is DXT3 with each quadrant a different level of transparancy.I think everything works fine now (I don't see any strange effect left). The different look of some of the textures is because they are applied to a transparant material and therefore get a greater level of transparancy.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Just had another thought about the TransformCall. I think it makes it more complicated. Because the RefPoint is then at a different place then the object. So it might solve the problem from one point of view, but from another point it will have probably gotten worse, as the object is not at its RefPoint anymore.So the best thing is to try to put the RefPoint always near the middle of the object. For really complexed objects where this is not enought, the drawing order needs to be controlled, but this means that the different objects must be in one Area block.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

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