Jump to content
Sign in to follow this  
arno

Transparency with a twist

Recommended Posts

I know transparency has been discussed a number of times here but I couldn't find anything on the following issue:What is currently the best solution for glass? The primary factor will be that aircraft (your own and AI) must be visible trough the glass.1. DXT1: not an option since it only has one aplha bit.2. DXT3: Z buffer problem, engine renders the aircraft after the scenery (I suppose) and therefore the planes vanish behind the glass. Sometimes this seems to work when using very small windows (why?)3. Material opacity: works best it seems, but the planes don't "shade" behind the glass... meaning that while other scenery objects "dim or fade" the aircraft stays at it's full "brightness" when seen trough the glass.4. Combinations of methods 1 2 and 3: tried them, no luck.Any ideas?

Share this post


Link to post
Share on other sites

You are right DXT1 is no option, so you should use DXT3 for your textures. If you object has a complex shape you probably need to control the drawing order manual to make sure no parts dissapear behind it.I don't know where the AI traffic is in the order of display. If the AI traffic is always drawn after the rest of the scenery this will give you some trouble, but I don't know, as I have not yet tested this.The material properties might also work, I have seen that when you use them in GMax the problems with disspearing parts seems to be less.In the end, if I had to choose, I would go for DXT3 with manual controling the drawing order, as that gives you ultimate control.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Thanks Arno.One thing that is strange and makes me believe this Z buffer "issue" in the scenery engine is in fact a "bug" rather than a "limiation" is that when using dxt3 for a window sometimes the aircraft shade according to the glass and sometimes not. It is all just a matter of camera perspective even without any other objects in the background that could be having some influence.About the drawing order, I'm aware of how to do that in SCASM, but in Gmax? Simply naming the bgl files like a_first.bgl and z_last.bgl seems to make a difference in practice but doesn't sound like the edge of technology ;) Any better ideas?

Share this post


Link to post
Share on other sites

I am not sure if it is a bug or not. The drawing order has been the same problem ever since I can remember (Fs5 :)). Since Fs2000 it works fine without specifying the drawing order for non transparant polygons. In Fs2002 we noticed that the DXT1 texture also seem to work correct without specifying the drawing order. Let's hope in one of the future versions that everything will work fine :).It is not possible to determine the drawing order directly in GMax, especially because in general it needs to depend on the position of the aircraft when you are using complex shapes. The best thing you can then do is to change the ASM code manual I think (adding the BGLC equivalant of the SCASM VectorJump command, I have done that once, but I can't remember the name right now :)).


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

After a marathon of experiments, my conclusion is that dxt3 (even with object's opacity at 99%) is not feasible when you look trough multiple windows at one time. It is possible to optimize it towards outside -> inside views, but if you need it both ways forget about it. Naming Gmax BGLs A-Z works in fact... unbelievable ;) The best solution seems to be using a semi-transprent object for the glass (no texture, opacity only) and a copy of this object with a dxt1 texture for the window details. Of course this means double poly-count, extra work, A/C still doesn't shade, but at least most of the scenery shows correctly and you don't get things like clouds hanging inside the building.

Share this post


Link to post
Share on other sites

Ok, good ol scasm command:RGBSColor( E8 20 66 100 )can generate a semitransparent object (Ex = transparency level + RGB). This doesn't result in any Z bias/ordering problems and even aircraft + AI aircraft are shaded according to the glass/tint.So far so good, but since I doubt the RGBSColor command can be replicated in BGLC code (?) the only thing that would make life easier is if there was a way to convert/export the basic gmax geomery into scasm compatible point () format. Is there a way or program that can do this already, maybe dxf format?

Share this post


Link to post
Share on other sites

Hi,BGLC does certainly contain the RGBSColor command, but I don't know the synthax by mind. So I would have to look that up when I get home.But I think the problem with this command is that it does not work together with the floating point commands that are used by GMax (and also FSDS2). So you could only use it together with the old Points and Poly/TexPoly commands.I have a beta tool laying around that can convert a simple GMax object (ASM source) into a SCASM source. Because it is not ready yet, I have not made it public, but if you think it could help you, just let me know. Of course the output SCASM source still uses the floating point commands.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

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...