FS8-Style Ground Polys / Autogen Suppression / Shadow Flickering

gadgets

Resource contributor
#1
Based on my work on ADE_GP (ground polys), I think I have found a definitive method for avoiding both flickering shadows and autogen suppression when using FS8-style ground polys with FS9 or FSX that I wanted to share.

Autogen suppression by ground polys is unavoidable! But, it is controllable.

There are (at least) two types of autogen suppression by ground polys.

  1. The first and easiest to understand is suppression within the bounding box. Whenever a scenery object is placed in FlightSim, autogen is suppressed within its bounding box, that is, the smallest rectangle - oriented in the cardinal directions - that can contain the object. In this context, the object is one or more ground polys. Obviously, if your ground polys are not oriented in cardinal directions, the bounding box will be larger than if they were and extra autogen will be suppressed. To minimize this type of autogen suppression, subdivide your ground polys into groups covering smaller areas - thus creating several much smaller bounding boxes. These groups may be placed in separate files (probably easiest if you are hand-placing the ground polys using FS8 MakeMdl) or by having multiple groups within each layer in the same file.

  2. The other type of autogen suppression is less well understood. It can result in wide swaths of missing autogen in areas not even bordered by ground polys. But it is definitely caused by the ground polys; remove the ground polys and the autogen returns. This type of autogen suppression can be avoided with the judicious use of the "dummy Scale" command, i.e., a SCALE_AGL command with all its fields set to 0. (For further information on dummy Scale commands and some history on the topic, please refer to this thread. To avoid this type of autogen suppression, a dummy Scale command should be placed at the end of the code block called by each ADDCAT command, just before the BGL_RETURN statement. Unfortunately, use of dummy scale commands can lead to flickering of ground shadows. To avoid flickering, add a block of data and code as you would to place additional ground polys. The associated latitude and longitude references should reflect the entire area covered by ground polys. The layer argument of the ADDCAT command must be a number higher than any layer used by the ground polys. (This implies 62 as the maximum useable GP layer.) The code block called by the ADDCAT command should contain nothing but a BGL_RETURN statement, i.e., no dummy scale command. This autogen suppression prevention block may be placed in the same file as the ground polys or in a separate file. What's important is that it specify a layer number higher than any used by the ground polys.
Hope this helps someone.

Don
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi Don,

I'll try the last bit of the extra layer to prevent flickering. The ground polygon wizard doesn't have that yet.

You place that one in a separate area call?
 

gadgets

Resource contributor
#3
You place that one in a separate area call?
Here's the code my routine generates for what I assume you mean by a "call":

LAYER_63 label word
db 12 ;NEAR/FAR HUGE BYTE OBJ
dd 0005fb9c1h, 0FDD6E7F7H ;Latitude, Longitude
db 100 ;image power
dd (offset LAYER_63_END) - (offset LAYER_63)
LAYER_63_START label word
IFIN1 LAYER_63_JUMP_END, image_complex, 2, 32767
ADDCAT LAYER_63_SCALE, 63
LAYER_63_JUMP_END label word
BGL_JUMP_32 LAYER_63_END

LAYER_63_SCALE label word
SCALE_AGL LAYER_63_JUMP_END, 10000, 10, 020000h, 0005FB9C1h, 04821h, 0FDD6E7F7H, 07256H, 0, 0
;Vis. Rad. Scale Latitude(48) Longitude(48) Alt. (0)
BGL_RETURN

LAYER_63_END label word

It is inserted at the end of the file containing all the ground polys, just before the EOF.

The "10" for radius is a minimum value inserted by my code. It doesn't seem to matter what that value is. The reference lat and lon are my airport's ARP. I haven't bothered to experiment as to whether these are critical. Also, I don't know whether the image-complexity value in the layer 63 entry is critical. All GPs for ADE_GP are handled as NORMAL, hence the value 2 in this case. I'd be inclined to set that value to the lowest scenery-complexity used by the ground polys.

For anyone hand-tweaking, I'd suggest:
  • create a file with GMax containing a single ground poly covering all other ground polys (to ensure the "dummy" file is active for when all other ground poly files are active),
  • generate the .asm files with FS8 MakeMdl (image-complexity equal to or lower than the lowest level used by any GP),
  • tweak as usual (layer 63) AND
  • replace the "include ... _0.asm" statement near the bottom of the .asm file with "BGL_RETURN". (The ... _0.asm file can be discarded.)
Don
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Hi Don,

Thanks. Yes, sorry, I'm using the SCASM terms. From your code I indeed see you make a new area call for this tweak. I'll give that a try in the GPW as well.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#5
Hi Don,

Thanks for sharing the info, I have added this code to the GPW output as well now.
 

jtanabodee

Resource contributor
#6
Is it applicable to FSX? I once tried that (you can see in that thread#31) it has a reverse effect. All my autogen has gone quite far surround that ground poly!
 

gadgets

Resource contributor
#7
Tic, not sure what "IT" is. All I can tell you is that addressing both types of autogen suppression as discussed in my initial post works for me for all versions of FlightSim and no ADE_GP users have reported that it doesn't.

Don
 

jtanabodee

Resource contributor
#8
Hi gadgets,
If I understand it right, you put tweaked SCALE_AGL.... to every layer. Then add a topmost layer 63 and tweak to get "include ... _0.asm" out and replace with BGL_RETURN. Am I right? Quite confused since I don't know the meaning of the code and I'm sure that lots of us don't know either.

Could you provide the code before and after tweaked for me to get more understanding?
Thanks,
 

gadgets

Resource contributor
#9
The associated ADE_GP code is machine generated on-the-fly in one file. There's no hand tweaking involved and, hence, no before and after.

Basically, all you need do is add an additional, higher layer that does not include the dummy SCALE_AGL command.

If you are hand tweaking, do what you've always done (i.e, tweak the ADDOBJ command and add a "dummy" SCALE_AGL command for each layer). Then, make another .asm file containing a single poly covering the entire area of the other polys, tweak it for layer 63 (or any layer number higher than you have used) but, instead of adding a dummy SCALE_AGL command following the BGL_CALL, delete the BGL_CALL command. The _0.asm file can be discarded.

I'm not sure the (new) highest layer need cover the entire area of the GPs but I know that works for me. If you want to experiment, instead of creating that final .asm file, make a copy of any of the other original .asm files, tweak it for Layer 63 and delete the BGL_CALL. It will probably work - but no guarantees.

Hope this helps,
Don
 
Top