Sign in to follow this  
arno

Dxt's...Transparency... Drawing Order... (see Pic)

Recommended Posts

Hi all, I'm back againWe were discussing DXT's not that long ago and Arno did a fine Tutorial which we thank him for.Check the image out, the sign is in front of the Hedge which is a DXT1 with alpha. This problem was a DXT3 problem before and changing to DXT1 did resolve a similar problem. The sign is a Library Object with no transparency involved.If this is a drawing order problem could someone explain this in contection with the points/Texpoly that produce this Hedge.

 	Points( 0			   -5	 0	 1	  ; 0			   -5	10	 1	  ; 1				5	10	 1	  ; 2				5	 0	 1	  ; 3			   -5	 0	 0	  ; 4			   -5	10	 0	  ; 5				5	10	 0	  ; 6				5	 0	 0	  ; 7			)	LoadBitmap( 0 0 EF 20 20 20		hedge_01.bmp   )			TexPoly( m 0 32766 0 -100			0	0	 0; 0			1	0   255; 1			2  255   255; 2			3  255	 0; 3	)	TexPoly( m 0 32766 0 -100			4	0	 0; 0			5	0   255; 1			6  255   255; 2			7  255	 0; 3	)

It is fairly simple in terms of what it represents, with view point being from the Front.This Scasm gets stranger or my misunderstanding of it does!!!!Just as a matter of interest, the code which calls the Hedge as a Library Object, is in a seperate Bgl file to the Bgl that produces the Sign Object.Who knows, I lost the plot, I think. Need help......:-hmmmRegardsDave

Share this post


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

>Check the image out, the sign is in front of the Hedge which >is a DXT1 with alpha. This problem was a DXT3 problem before >and changing to DXT1 did resolve a similar problem. The >sign is a Library Object with no transparency involved. >>If this is a drawing order problem could someone explain >this in contection with the points/Texpoly that produce this >Hedge. Hi Dave,I do not understand (even looking at your image) what is the problem. Sorry.However I will add a small comment on the code you post. The code says that FS should represent 2 polygons. One with vertex 0 1 2 and 3 and another with vertex 4 5 6 and 7. Both polygons should be represented when the viewer is in the half 3D space defined by a horizontal plane that is 100 "units of measurement" below the Refpoint. The half 2D space is the upper one.I find strange that the half plane definied by m 0 32766 0 -100 does not contain the points of the polygon.This comment has nothing to do with the visibility problems that you refer. If you have a visibility problem with transparencies and the solution is related to "drawing order", then you will need to bring the 2 competing surfaces to the same Refpoint and sort them with VectorJumps.Regards, Luis>

  Points( 0 >			   -5	 0	 1	  ; 0 >			   -5	10	 1	  ; 1 >				5	10	 1	  ; 2 >				5	 0	 1	  ; 3 >			   -5	 0	 0	  ; 4 >			   -5	10	 0	  ; 5 >				5	10	 0	  ; 6 >				5	 0	 0	  ; 7 >		 ) >> LoadBitmap( 0 0 EF 20 20 20 >  hedge_01.bmp   ) >> TexPoly( m 0 32766 0 -100 >	  0	0	 0; 0 >	  1	0   255; 1 >	  2  255   255; 2 >	  3  255	 0; 3 > ) > TexPoly( m 0 32766 0 -100 >	  4	0	 0; 0 >	  5	0   255; 1 >	  6  255   255; 2 >	  7  255	 0; 3 > )

Share this post


Link to post
Share on other sites

Hi!I think I see what Your problem is but I do not know if the bush is nearer towards the viewer or the sign. Anyway, I made a house having DXT1 and DXT3 textures on it in some different ways using FSDS. Which version of FSDS do You have, 1.6 or 2? I think both versions have the option for part "Uses transparent texture" which is allmost mandatory to use if You have DXT3 textures so You will not have those funny transparent effect. Anyway if You ask me, for signs it is much better to be made of two parts: one part, maybe as line to hold the sign and the other a polygon which is the sign. This way You will get rid of this transparency effect. But if You prefer this kind of sign, You can also use 8 bit BMP with transparency on-off and these bitmaps do not exhibit such transparency effect.Luissa, I know that TexPoly( m 32767 0 100...) looks quite strange but as Louis Sinclair (Rundio) some time ago explained, this is the same if You would write TexPoly( a... and if You have TexPoly( m -32767... it is the same as TexPoly( ai.Hope this will help You somehow. Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

So both objects are in a different BGL and thus they each have their own RefPoint? Are all the hedges in the background one object or also two seperate?I guess that one of the RefPoint of the hedges is closer to you then the sign and therefore the sign is covered by it. But it's a bit hard to tell from this picture :)Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

>I think both versions have the option for >part "Uses transparent texture" which is allmost mandatory >to use if You have DXT3 textures so You will not have those >funny transparent effect.Yes, both versions have this option and just for the information, the result of this option is that the part is put at the end of the drawing list, so it influences the drawing order in a crude way (not good enough for complex objects, because you can not assign the exact order of all parts (without editing the source manual of course :)))Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Hi guys, thanks for getting backLuis, the -100 is a further indication of my failure to fully understand the principle of vectors, even though explained and alot of what I do is via experimentation. The visability problem is that the Hedge itself is half concealing the sign when the sign is in front of the hedge.Goran, the sign is nearer to the viewer. I have the first version of FSDS, but this was hand written. I had a similar problem using DXT3 texture with the same library object, see pic below and previous post "Transparency Problem" 6.02.2003... I don't understand what you mean by a line(more explanation, I think), but I take on your point about a 8bit bmp(256), what type would this be in DXTBmp? or would it e Imagetool/Bmp2000!!! I did read Gerrish's explanation, honest!!Arno, yes both have their own refp() and are in seperate bgl's, honest and both are objects in the same Library file. The object that cuts the sign in half, starts at that point and although it is behind the sign it is close. The bush behine the sign that does not obscure that part of the is a seperate object. See pic below from previous post 06.02.2003(This image was DXT3) plus also closer viewHope the above helps clarify whats going on!!!!thanks Dave EDITThe sign on the right of picture does not pocess any of these problems, see code

; -----------------------------------------------------------------------; SIGN MACRO; ----------------------------------------------------------------------- Area( 5 52:37:58.998989 -03:08:58.815438 5 ) ;   Start of library call  IfVarRange( : 346 4 32767) PerspectiveCall( :persp ) Jump( : ):persp;   Perspective :Sign1;--------------Left of Entrance-----------------------------------------   RefPoint( rel :Sign2  .02 52:37:58.675 -03:08:59.169 		V1= 6000 V2= 1200 )       RotatedCall( :objcall 0 0 215 ) ; rotate object to user preset   :Sign2;--------------Right of Entrance-----------------------------------------    RefPoint( rel :EndP 0.02  52:37:59.112 -03:09:0.071 		V1= 9000 V2= 3000 )     RotatedCall( :objcall 0 0 225.057220 ) ; rotate object to user preset    :EndP   Return    :objcall   CallLibObj( 0 0013CC70 0013CC6E 00517344 4D415409 )     Return EndA [code/]Just a thought about the sign on the right, as it is very close to a another object, as I thought this may present problems as the sign on the right, which has problems, is close to the hedge.Cheers Dave

Share this post


Link to post
Share on other sites

>Luissa, I know that TexPoly( m 32767 0 100...) looks quite >strange but as Louis Sinclair (Rundio) some time ago >explained, this is the same if You would write TexPoly( a... >and if You have TexPoly( m -32767... it is the same as >TexPoly( ai. Dear Goran,Just for clarification, the following code:> TexPoly( m 0 32766 0 -100 > 0 0 0 ; 0 > 1 0 255 ; 1 > 2 255 255 ; 2 > 3 255 0 ; 3 is the same as: TexPoly( ai 0 0 0 ; 0 1 0 255 ; 1 2 255 255 ; 2 3 255 0 ; 3 if points 0 1 and 2 were all at the altitude of -100 in relation to the RefPoint() in which case the polygon would be visible if the viewer is at an altitude higher than -100In the same line:- TexPoly( a ... ) will allways produce a positive len in TexPoly( m vx vz vy len )- TexPoly( ai ... ) will allways produce a negative len in TexPoly( m vx vz vy len )SCASM calculates the coordinates of the vector with the first 3 points that follow in TexPoly(). The vector will be perpendicular to the plane defined by those 3 points. The direction will be from the RefPoint to the plane if we use TexPoly( a ... ) or from the plane to the RefPoint() if we use TexPoly( ai ... ). The change from TexPoly( a ... ) to TexPoly( ai ... ) or vice-versa, will reverse all the 4 parameters in TexPoly( m vx vz vy len ... ).I hope I am correct. Regards, Luis

Share this post


Link to post
Share on other sites

Hi Dave,I indeed think that this must mean that the distances to the RefPoints are wrong and therefore the objects are drawn in the wrong order. Let me think if there is an easy way to solve this....Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Dave,with the line I meant that You make sign with 2 parts, one is the table (just a polygon) and a line (okay, in FSDS is 3 point polygon which has two points snapped together and looks like a line) which will act as a holder of a polygon. This way You can still have DXT1/3 texture on a polygon, line does not need a texture. But what visual effect will this have... It's up to You to decide.8 bit bitmaps are best done using Martin Wright's BMP2000 but up to 512x512 pix bitmap!Arno, thank You for explaining what "Uses transparent textures" does; I didn't bother examining new FP code.Best regards to all,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

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