Level of detail creation (ASM tweak)

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#3
Hi,

Why do you want to do this manually? This Wiki article was written in the days of FS2002, so unless you are making scenery for FS2002 there should be easier ways to do this.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#5
Hi,

I haven't tried that before :). I guess you could try to tweak the ASM code in a similar way as you do with multiple layers in one BGL file. By adding a condition around the code that calls the different _0.asm file I think it should work.
 
#6
Hi Arno,
I found this portion of code on avsim forum:

Code:
VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
IFIN1 model_shadow, SHADOW_FLAG,0,0
IFSIZEV LOD_1, 301,1000 ; lod = 150.000000

LOD_0 label BGLCODE
BGL_JUMP_32 LOD_0L
LOD_1 label BGLCODE
BGL_JUMP_32 LOD_1L

model_inside label BGLCODE
BGL_RETURN
model_shadow label BGLCODE
IFSIZEV SHADOW_1, 301,1000 ; lod = 150.000000

SHADOW_0 label BGLCODE
BGL_JUMP_32 LOD_1L
SHADOW_1 label BGLCODE
BGL_JUMP_32 LOD_1L

LOD_0L label BGLCODE
include D:\EFHK-scenery\scenery\portti_0.asm
LOD_1L label BGLCODE
include D:\EFHK-scenery\scenery\portti_1.asm
Looks fine for me, I tryied to implement but strangely my object no more appear. What's wrong here?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#7
Hi,

That code looks a little weird to me, it seems to be playing tricks with the shadow. I would expect something more simple, like this:

Code:
OBJECT_0_SCALE label    BGLCODE
    SCALE_AGL   OBJECT_0_RETURN, 10000, 252, 131072, 0006E38BEh, 01C72h, 00E38E38Eh, 038E4h, 0, 0
    BGL_CALL        OBJECT_0_BEGIN
OBJECT_0_RETURN label word
    BGL_RETURN

OBJECT_0_BEGIN label word

IFSIZEV LOD_1, 301,1000 ; lod = 150.000000

LOD_0 label BGLCODE
BGL_JUMP_32 LOD_0L
LOD_1 label BGLCODE
BGL_JUMP_32 LOD_1L

LOD_0L label BGLCODE
include D:\EFHK-scenery\scenery\portti_0.asm
LOD_1L label BGLCODE
include D:\EFHK-scenery\scenery\portti_1.asm
 
#8
Thanks for reply Arno, now is more clear also to me, but I would ask you an advice: in my case I have lots of centerline made with loft obj and for save fps, while exporting, I sed 2000m as visibility range; this means that above that distance my loft won't appear.
In this situation would be reasonable to apply also LOD? for example the most detailed version could be visibile under 1000m, from 1000 to 2000m a less detailed version and above 2000m nothing.

thanks!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#9
Hi,

Using the v1 distance is also a sort of LOD of course. In the Amsterdam Schiphol scenery I worked on before I used only the v1 distance to determine when something shows. If you just want to show something or not that is fine. I guess you only need LODs when you want to show a simpler version instead of nothing.
 
Top