Jump to content
Sign in to follow this  
arno

Day/Night light_nav texture

Recommended Posts

Hi Jim,Why do I get asked this question by everyone :).I am now at work (my traineeship), but I will dig up some code this evening on my PC and remind me to post it here tomorrow :D.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

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
Guest

Thanks Arno!! Jim and I will be most greatfull. Dan

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Dan!I am sorry, maybe it won't be useful but You must test variable 28C about this. In SCASM You could test IfVarAnd( :Skip 28C 6 ) for example. If I remember correctly (from my head, I am not at home right now), 28C can have:1 - day2,4 -dusk, dawn6 - nightMaybe it helps You. Regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Yes, buy we are looking for the BGLC code :), so that is something like:IFIN1, label, 28ch, 1, 1But I'll make a little example this evening (also to be sure the code is correct, as I do it by mind now).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

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

OK, here is the example as I promissed yesterday.I have made a simple cube with on each corner one light. GMax then creates the following code for it:[tt]test_top label BGLCODE BGL_BEGIN 0800h ; version = 8.00 MATERIAL_LIST_BEGIN MATERIAL_DEF 0.603922,0.603922,0.898039,1.000000, 0.603922,0.603922,0.898039, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0 MATERIAL_DEF 1.000000,0.000000,0.000000,1.000000, 1.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 1 MATERIAL_LIST_END VERTEX_LIST_BEGIN VERTEX_DEF -50.000004, 0.000000, 50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 0 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, 50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 1 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 2 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 3 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 4 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 5 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 6 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 7 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 8 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 9 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 10 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 11 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 12 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 13 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 14 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 15 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 16 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 17 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 18 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 19 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 20 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 21 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 22 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 23 part= 1 prim=0 VERTEX_LIST_END; NonAlphatest_NonAlpha label BGLCODE MATERIAL 0 ; <154,154,229,255> DRAW_TRI_BEGIN 0, 24 DRAW_TRI 17, 14, 20 ; poly=7 part=1 DRAW_TRI 12, 15, 4 ; poly=2 part=1 DRAW_TRI 11, 22, 19 ; poly=3 part=1 DRAW_TRI 19, 8, 11 ; poly=4 part=1 DRAW_TRI 5, 16, 21 ; poly=5 part=1 DRAW_TRI 21, 10, 5 ; poly=6 part=1 DRAW_TRI 4, 1, 12 ; poly=1 part=1 DRAW_TRI 20, 23, 17 ; poly=8 part=1 DRAW_TRI 13, 2, 7 ; poly=9 part=1 DRAW_TRI 7, 18, 13 ; poly=10 part=1 DRAW_TRI 0, 3, 9 ; poly=11 part=1 DRAW_TRI 9, 6, 0 ; poly=12 part=1 DRAW_TRI_END; Alphatest_Alpha label BGLCODE BGL_LIGHT LIGHT_NAV, -50.000, 102.000, -50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 13 BGL_LIGHT LIGHT_NAV, -50.000, 102.000, 50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 14 BGL_LIGHT LIGHT_NAV, 50.000, 102.000, 50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 15 BGL_LIGHT LIGHT_NAV, 50.000, 102.000, -50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 16 BGL_END BGL_RETURN[/tt] To turn of the lights during day time we must add a check for the time of day. If the time of day is between dusk/dawn (2) and night (4) the commands following the check will be executed (the lights), otherwise these commands will be skipped and a jump is made to the specified label. The resulting code then becomes:[tt]test_top label BGLCODE BGL_BEGIN 0800h ; version = 8.00 MATERIAL_LIST_BEGIN MATERIAL_DEF 0.603922,0.603922,0.898039,1.000000, 0.603922,0.603922,0.898039, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0 MATERIAL_DEF 1.000000,0.000000,0.000000,1.000000, 1.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 1 MATERIAL_LIST_END VERTEX_LIST_BEGIN VERTEX_DEF -50.000004, 0.000000, 50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 0 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, 50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 1 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 2 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 3 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 4 part= 1 prim=0 VERTEX_DEF -50.000004, 0.000000, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 5 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 6 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 7 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, 50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 8 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 9 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 10 part= 1 prim=0 VERTEX_DEF -50.000004, 100.000008, -50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 11 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 12 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 13 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, 50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 14 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ; 15 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 16 part= 1 prim=0 VERTEX_DEF 50.000004, 0.000000, -50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 17 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ; 18 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 19 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, 50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 20 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ; 21 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ; 22 part= 1 prim=0 VERTEX_DEF 50.000004, 100.000008, -50.000004, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 23 part= 1 prim=0 VERTEX_LIST_END; NonAlphatest_NonAlpha label BGLCODE MATERIAL 0 ; <154,154,229,255> DRAW_TRI_BEGIN 0, 24 DRAW_TRI 17, 14, 20 ; poly=7 part=1 DRAW_TRI 12, 15, 4 ; poly=2 part=1 DRAW_TRI 11, 22, 19 ; poly=3 part=1 DRAW_TRI 19, 8, 11 ; poly=4 part=1 DRAW_TRI 5, 16, 21 ; poly=5 part=1 DRAW_TRI 21, 10, 5 ; poly=6 part=1 DRAW_TRI 4, 1, 12 ; poly=1 part=1 DRAW_TRI 20, 23, 17 ; poly=8 part=1 DRAW_TRI 13, 2, 7 ; poly=9 part=1 DRAW_TRI 7, 18, 13 ; poly=10 part=1 DRAW_TRI 0, 3, 9 ; poly=11 part=1 DRAW_TRI 9, 6, 0 ; poly=12 part=1 DRAW_TRI_END; Alphatest_Alpha label BGLCODE IFIN1 nolights, 28ch, 2, 4 BGL_LIGHT LIGHT_NAV, -50.000, 102.000, -50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 13 BGL_LIGHT LIGHT_NAV, -50.000, 102.000, 50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 14 BGL_LIGHT LIGHT_NAV, 50.000, 102.000, 50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 15 BGL_LIGHT LIGHT_NAV, 50.000, 102.000, -50.000, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 16 nolights label word BGL_END BGL_RETURN[/tt]Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

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