Jump to content
Sign in to follow this  
Guest GerrishGray

"perspectivecall" against "ADDOBJECT"... BIG FIGHT!"

Recommended Posts

Guest

Hello everybody!I was reading the message "Object Library droping the frame rate below 0!" and I remember then an old discussion we had for FS20002 years ago! Subject was "how to design photorealistic terrain" with Andras Kozma, Misho Katulic, CWright,Martin Wright and others fellows designers: the deal was to find a new method due to the lack of photorealistic scenery capability in FS2k as the MS team forgot about the visibility factor of the old "TexRelief" command...Andras Kozma found then the method AREA type E (coming from CFS1)in combination with "MeshWith1Tex" and something VERY IMPORTANT for the FS2002's designers: FORGET THE PERSPECTIVE ROUTINE that is to say FORGET THE PERPSECTIVECALL routine when you want the best performance!And this is true for every objects you're going to create....We know what we could not do anymore but what is the "best"?When you make a visual scenery, the best is always to structure your code (scasm, asm, masm, whatever..)in 2 files: the library of objects (runways,ground polygons,tiles,objects,etc.) AND an another file which call the library. As Andras Kozma said: "This method has two advantages: first it activates the inbuilt perspective routine hard-coded in g3d.dll, so no perspective command is needed, and the second, that your code (the calling part) will be so short that you never run into size related trouble with the compiler. The library files don't have size limitations as they represent "raw" bgl data."When you look at the *.asm files generated by Gmax, what do you see? 2 files: my_secenery.asm is the "caller" and my_secenery_0.asm is the object called. That's the best way to do it and Gmax do it very well. From 2000 to 2002, designers had to write this but now Gmax do it for you, so don't return to Fs5 structure!Now take a look at the "caller" my_secenery.asm : you'll notice as arno said that commands are very similar between scasm and asm. Nothing special about it because both of them are using the bgl structure. Gmax's optimisation is not in the syntax but in the way it probably activates the routine hardcoded in g3d.dll.Good work and optimize your code !:-sun1

Share this post


Link to post
Share on other sites

This is interesting, but do I understand you correct when you say that it was best to skip the PerspectiveCall? GMax still uses it.We (NL2000 Team) have had some trouble with our forest (the SCASM code is generated by our own scenery tool), you could see the clouds through them while standing on the ground. This was because the person making the tool only had worked with flat polygons before (these don't have a PerspectiveCall, but a LayerCall) and therefore he had forgotten the PerspectiveCall. After we added it everything works fine.So, I would say, for every 3D object you need a PerspectiveCall. If you use a library the PerspectiveCall is not in the library, but in the macro/file that calls the library. But there is always one there. GMax does the same, as you also say, it makes a PerspectiveCall (ADDOBJECT), but it doesn't use a library. The GMax code looks a lot like the FSDS code, the only difference is that it is split into two files (but the first one includes the second file, so basically it is one file and everything goes into one Area).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 GerrishGray

Yes, I can confirm what Arno is saying here. 3D objects that stick up from the ground MUST have a PerspectiveCall() (or ADDOBJECT in BGLC) command. It is an essential 'header' to each object that adds it to the current list of objects to be sorted by z-buffering. Without PerspectiveCall() you will get all sorts of visibility and bleed-through problems.RegardsGerrish

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