Jump to content
Sign in to follow this  
arno

Gmax question re: Shadows

Recommended Posts

Guest Simpit

I do not have the answer to your question, but I have a similar one (inversley :-roll )... If I'm using GMax to lay down the tarmac for an airport, how do I get shadows to show up on it?Derek

Share this post


Link to post
Share on other sites

I don't know the way to do it directly from GMax, but I do know two ways to do it otherwise :).First, I use FsRegen to make a library of my objects (to place them with the current tools). In the macro that calls the library object I can add the ShadowCall if I want it (or leave it out if I don't want a shadow).Second, I took a little look at the GMax BGLC code. I found the following piece in the test.asm file (where my object was called test of course):[tt] ADDOBJ OBJECT_0_SCALE SHADOW_CALL OBJECT_0_SCALEOBJECT_0_FAIL label BGLCODE[/tt]By simpely making a comment of the Shadow_Call you can also remove the shadow:[tt] ADDOBJ OBJECT_0_SCALE ;SHADOW_CALL OBJECT_0_SCALEOBJECT_0_FAIL label BGLCODE[/tt]I would be easier if we had a way to do it from GMax, but I haven't found that, I am afraid the exporter always gives shadow to a scenery object.ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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

You don't see a Shadow from other objects on your tarmac?I think this is because the code GMax generates is for objects (buildings) and not for flat ground surfaces. This is similiar to aprons created with FSDS for example, these also have problems.I think you can best try to make these parts of your scenery with a GroundMaker or Airport, these programs generate better code for that purpose.I am also not sure if the new way for drawing polygons (as GMax does and the latest SCASM supports) also works correct for ground surfaces. I still need to test that.ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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

Hi Dan,Just check the "keep files" box in the exporter. Then the asm files will not be deleted by MakeMDL. They are placed in the same folder as the BGL file you create.After that you can just edit them with any texteditor (notepad for example). I use the BGLC that came with the effects SDK to recompile the BGL afterwards.ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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 Simpit

Thanks for the input...I wonder if you can use the "edit BGLC" trick to change the type of surface that is generated...Derek

Share this post


Link to post
Share on other sites

Hi Derek,I think it should be possible (but I haven't figured it out). You should then remove the PerspectiveCall and ShadowCall (these are the SCASM commands, but you need the equivalent BGLC commands of course) and replace it with a LayerCall. I think I am going to try that soon, because I would like to see if the new commands also give better performance for ground polygons. When I have found something I'll let you know :).ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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

I have tried your idea and a new BGL is created only nothing shows upin flight sim.I have however figured out how to place a thin flat model on the ground and not show a shadow. Answer, don't stick any part into the ground. What a dummy I am. Days spent screwin' around and all I had to do is raise it out of the ground :-)Now, to start playing with the two forms of LODs to stop a damn transparent object from going grey at a certain distance.There is always, one more thing............http://members.rogers.com/jkanold/jimlogo.gifhttp://members.rogers.com/eelvish/flyurl.gif

Share this post


Link to post
Share on other sites

Hi Biber,Reminds me of a problem I have had before. It that case transparant textures were not transparant but black. This was caused by a ShadowCall in the object (and it only happened when people had the scenery shadows turned on).So you could test if this is the case by turning the shadows on and off and see if something happens. If that is the case, the solution is easy, just remove the ShadowCall from your object (ground polygons don't need a ShadowCall anyway).ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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 Simpit

More confusion...I went into the .asm file and deleted the shadowcall line for the ground textures, then compiled the file. Yay!, I thought - my aircraft shadow showed up where it did not before! My theory is that anything casting a shadow cannot have shadows on it.Then I went taxying over to some of the buildings, and noticed the shadows falling on the default ground, but dissappearing when on my added tarmac. Even more interesting, when I taxied into one of the hangars, my aircraft shadow dissappeared!I wonder if this now has to do with layering?Derek

Share this post


Link to post
Share on other sites

Yes, it does Derek. I just did some testing and I found it :).Try to do this. Find this piece of code in your asm file:[tt]OBJECT_0_START label word IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767 ADDOBJ OBJECT_0_SCALE SHADOW_CALL OBJECT_0_SCALEOBJECT_0_FAIL label BGLCODE[/tt]And replace it with this:[tt]OBJECT_0_START label word IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767 ADDCAT OBJECT_0_SCALE, 8OBJECT_0_FAIL label BGLCODE[/tt]The parameter 8 is the layer number, I tested it with 8 and that worked fine. This way I can place a polygon at a height of 0 without the mesh scenery flickering through it and it also has a shadow on it.ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen


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 Simpit

Yes, that did it...great!I already had a zbias on so they didn't flicker anyway, but at least the shadows now look okay...The next two problems are surface type- looking through the 2000 scenery SDK it seems like this would be best done with a big area covering the tarmac area instead of adding it to the individual polygons, and taxiway lines - and here there is aome code around that has been posted lately that I'm going to be looking at.Another thought - I presently have separate files for the buildings and the tarmac, which create separate bgls - do you think you could just grab all the .asm files and put them into one file and compile it into one bgl?Thanks for all the help - this is what makes this community great!Derek

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