Sign in to follow this  
arno

GMAX ground polygon flickering - layering

Recommended Posts

Gurus,Wanted to run a question by you. By adding z-bias to the ground material in GMAX one stops the flickering. Question: How does one place one polygon on top of the other without them flickering? What z-bias settings are needed. I looked at the MakeMDL SDK and it states a setting of zbias_##. How does this work (if it does?)? Is it the same as FSDS?ThanksShez

Share this post


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

I would not advise using the z-bias, but I would replace the PerspectiveCall command with a LayerCall command. You can then use the layer number to order different polygons.This also has the benefit that you get the shadow of your aircraft back.Here is a tip I wrote about it:http://www.scenerydesign.org/modules.php?n...=article&sid=54PS. For FSDS the same applies, there it is also better to replace the command. That is discussed in this tip:http://www.scenerydesign.org/modules.php?n...=article&sid=49

Share this post


Link to post
Share on other sites

Thanks Arno, as usual you are the resource for a successful solution. I remember you stated this solution last time I wrote about this issue.RegardsShez

Share this post


Link to post
Share on other sites

Is raising the ground polygons a fraction of a meter a possible solution to flickering sometimes?

Share this post


Link to post
Share on other sites

Well, that would also cure the visual problems of course, but it does not remove the cause of the problems. You it might be a solution, but I prefer to replace the source with decent source instead.

Share this post


Link to post
Share on other sites

Actually already tried that but it causes the wheels to appear embedded in concrete. :) Shez

Share this post


Link to post
Share on other sites

Of course, but many ground polygons were never made for taxiing on...unless you are REALLY lost. .:-halo A parking lot near the airport for example. No doubt Arno's got a much better approach but sometimes you want to see how it looks before you invest more time.

Share this post


Link to post
Share on other sites

Arno,This does not appear to work. A few questions,1) I am using two different asm files sourced from two different GMAX source files (only ground tiles). Does this work or do the tiles have to be in the same project?2) I am using the Plane object to create a plane and then texturing it to make it like a ground polygon. Is this the correct method?3) When I used your LayerCall solution it appears to be only one entry per asm file? Is this correct?ThanksShez

Share this post


Link to post
Share on other sites

Hi Shez,Yes, it does work if you have multiple files, but you will only be able to place one LayerCall command per file. So if you have polygons that need to end up on different layers you can better export them as two BGL files with export selected from GMAx.

Share this post


Link to post
Share on other sites

Arno,I made a simple Plane and exported it to FSRegen and added it to my library file. Here is relevant asm code after making the change as per your advice.;compile with BGLC /BGL E:FS2002SCENEDB2004scenerytest1.asmheader label word dw 0001 ; 00 World set number dd 00050D929H ; 02 North bound dd 00050D405H ; 06 South bound dd 0C1E7362DH ; 10 East bound dd 0C1E7362BH ; 14 West bound dw 20 dup(0) dd (offset OBJECT_DATA) - (offset header) dw 33 dup(0) OBJECT_DATA label word db 21 ;;LATBAND_REL dw 0286Ah ;;lat min (inclusive) 512M units dw 0286Dh ;;lat max (exclusive) dd (offset OBJECT_0) - (offset OBJECT_DATA) db 0 ;;EOL OBJECT_0 label BGLCODE db 12 ; NEAR_FAR_HUGE_OBJECT_HEADER dd 00050D697h,0C1E7362Ch ; latitude,longitude db 100 ; image power dd (offset OBJECT_0_END) - (offset OBJECT_0) OBJECT_0_START label word IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767 ADDCAT OBJECT_0_SCALE, 8 OBJECT_0_FAIL label BGLCODE BGL_JUMP_32 OBJECT_0_END OBJECT_0_SCALE label BGLCODE SCALE_AGL OBJECT_0_RETURN, 10000, 658, 131072, 00050D697h, 0D82Eh, 0C1E7362Ch, 06375h, 0, 0 BGL_CALL OBJECT_0_BEGINOBJECT_0_RETURN label word BGL_RETURNOBJECT_0_BEGIN label wordmodel_outside label BGLCODE BGL_CALL model_crashmodel_shadow label BGLCODELOD_0 label BGLCODE BGL_JUMP_32 LOD_0Lmodel_inside label BGLCODE BGL_RETURNmodel_crash label BGLCODENow I compile the library via BGLC and the flickering is still there. I use AFW2.60 to place the api first then compile scenery.Thanks for your help.Shez

Share this post


Link to post
Share on other sites

Curious about this issue, I went back and re-read the MAKEMDL SDK and on page 19 it appears that Microsoft may have anticipated this whole issue, by adding z-bias to textures that have certain prefixes in the texture name. If so, this is a very simple fix.

Share this post


Link to post
Share on other sites

Yes this was the exact problem I began this thread with actually but there are two problems in this method,1) No shadows2) The main issue, overlapping tiles where one tile tends to flicker in the overlap area (even if it has z-bias named). My question on this was going back to the way FSDS worked, you could set different layers in the z-bias by numbering the z-bias. In the MakeMDL doc there is a mention of a z-bias# which I would like to understand a bit more about. Is this the same FSDS layer number?RegardsShez

Share this post


Link to post
Share on other sites

For building the z-bias option is perfect. You can use it to let a small polygon with a logo display correct on a building or so. It then works the same as in FSDS. That is probably how MS also meant that option, but GMax/MakeMDL has never been meant to make a complete ground scenery with (the same goes for FSDS). If you look at the source code it produces that is very clear. That is why for ground sceneries the tweak suggested above are better.

Share this post


Link to post
Share on other sites

Arno,Fantastic! That last trick about the apis dealt a final blow to that annoying issue! Thanks a million as usual. They should name this forum after you. :-)One other development on the api, I had to set a V2 value with the apis produced by your method. With no V2 value I was getting polygons disappearing from different angle views.Regards and thanks again!Shez

Share this post


Link to post
Share on other sites

Arno,A related issue I have discovered. If you view the buildings and aircraft from the ground level the scenery is fine, however if you raise your spot view higher the buildings and aircraft (all 3d objects) tend to 'sink' into the ground. The LayerCall is set to 8. Appears to me to be an issue with the ground polygons not sitting on the surrounding ground altitude. Wonder why this is as the 3d objects are fine...Sorry to keep picking your brains on this...ThanksShez

Share this post


Link to post
Share on other sites

This should not happen :).Do you have a separate library object for your ground polygon or do you have buildings and ground polygons mixed in one object?And are you sure that the correct altitude has been set when you placed the API?

Share this post


Link to post
Share on other sites

The building and the ramp polygon which it aligns with are in the same GMAX file but exported separately and then put into one api as separate GUIDs. The main ground polygon which is the base of the scenery is a separate api and gmax file. The altitude is correct.ThanksShez

Share this post


Link to post
Share on other sites

Hi Shez,That all sounds correct, so I would expect that it should work fine.Can you maybe post the API you used for the ground polygons here? Maybe something is wrong there.

Share this post


Link to post
Share on other sites

Arno,Here is the ground polygon api,; --- Created by FsRegen v0.31bmif (0)Area( 5 %1 %2 1 )RotatedCall( :symbol 0 0 %5 )Jump( :endsymbl ):symbolRefPoint( 7 : 0.5 %1 %2 )Points( 0-2784 0 -2858-2784 0 30121901 0 30121901 0 -2858-441 0 77)Poly( a 0 1 2 3 )Poly( a 0 4 3 )Return:endsymblEndAmifendArea( 5 %1 %2 22 ) LayerCall( :OBJ 6 ) Jump( : ) :OBJ mif( %11 ) refpoint( 2 :END %4 %1 %2 E= %11 v1= %10 V2= 750 ) melse refpoint( 7 :END %4 %1 %2 v1= %10 V2= 750 ) mifend RotatedCall( :ROT 0 0 %5 ) Return :ROTcallLibobj( 0 9F3B301B 4E797CCB D04EACAB B164C59B ):ENDreturnEndAHere is the multi-object api,; --- Created by FsRegen v0.31bmif (0)Area( 5 %1 %2 1 )RotatedCall( :symbol 0 0 %5 )Jump( :endsymbl ):symbolRefPoint( 7 : 0.5 %1 %2 )Points( 0-1928 0 -325-1928 0 1251894 0 1251894 0 -325-17 0 -100)Poly( a 0 1 2 3 )Poly( a 0 4 3 )Return:endsymblEndAmifendArea( 5 %1 %2 22 ) PerspectiveCall( :OBJ ) ShadowCall( :OBJ )LayerCall( :OBJ2 8 )Jump( : ) :OBJ mif( %11 ) refpoint( 2 :END %4 %1 %2 E= %11 v1= %10 V2= 750 ) melse refpoint( 7 :END %4 %1 %2 v1= %10 V2= 750 ) mifend RotatedCall( :ROT 0 0 %5 ) Return :ROT CallLibObj( 0 9F3B3019 4E797CCB D04EACAB B164C59B ) Return :OBJ2 mif( %11 ) refpoint( 2 :END %4 %1 %2 E= %11 v1= %10 V2= 750 ) melse refpoint( 7 :END %4 %1 %2 v1= %10 V2= 750 ) mifend RotatedCall( :ROT2 0 0 %5 ) Return One thing that may be wrong is that all the materials are named zbias_ground?ThanksShez

Share this post


Link to post
Share on other sites

This code all looks correct (only the last part of the multi object macro seems to be missing, I expect the library call is still below there, as well as the Return and EndA.I don't expect that the zbias_ would influence the scenery in such a way, but you might want to try that as well.Do you have a flatten at your airport btw? Otherwise that might also be a reason for the altitude problems.

Share this post


Link to post
Share on other sites

Hi,If you used a 'flatten'ed area in APW, it could be the problem.Basically you get 2 ground levels when the flattened level is at some point(s) above the original one. Both work in some way, so that you may look at the underside of the flattened level when you slew from outside the flattened area into the flatened area.Not sure if that's your problem, but I've had it many times, making a grounded plane only partly visible when partly under the flattened level.Hope it makes sense and helps.voscon.

Share this post


Link to post
Share on other sites

I have tried this with and without the flatten area. Reducing the flatten area altitude setting does eliminate the problem but causes other (commonly noticed) problems with non-flattened areas.RegardsShez

Share this post


Link to post
Share on other sites

Voscon,I think you mean that there might be a flatten area on a different level than the base ground? AFW actually calculates the level based on the altitude of the main scenery so have not changed that.ThanksShez

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