• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Need Help with SHAM

gadgets

Resource contributor
Messages
9,388
Country
ca-britishcolumbia
I'm working on a new feature for SAMM2. What I'm trying to do is create a shadow for the static models using the lowest LOD (normally LOD5 for aircraft) so as to avoid the overhead of the sim computing the shadow based on the rendered model. Things aren't going so well!

For FSX, I presume this is what the SHAM section of the model file is for. (I'll worry about FS9 later.) According to the FSX .mdl format described in the Wiki, the SHAM section is to contain the same sections as the MDLD section. So, other than textures and materials which I presume are not needed for a shadow, I have copied the following sections from the rendered model into the SHAM section:
  • INDE (unmodified),
  • TRAN with transforms modifed to reflect the "pose" specified by the user,
  • a VERB section header followed by the VERT buffer of interest, with empty buffers for the others to preserve indexing,
  • AMAP (unmodified)
  • SCEN (unmodified)
  • SGAL (all -1s)
  • SGVL (all -1s)
  • SGJC (unmodified)
  • SGBR (unmodifed)
  • ANIB (empty save for the header)
  • LODT containing only the LODE section for the lowest LOD
all in a RIFF wraapper. (Where I mention modifications, I mean modifed from the original section from the aircraft. It is identical to the section used in the static model.

So, it seems the simple presence of a SHAM section with these contents is not enough.

Any help appreciated.

Don
 
There is precious little information "out there" on the SHAM block in the FSX .mdl file format. But, from what I found since my initial post, it is intended to be used for shadow mapping ON the aircraft, i.e., the aircraft throwing shadows on itself, and it is only implemented when in the virtual cockpit mode - which isn't a lot of use in static models.

So, I have abandoned that approach.

If anyone has information to the contrary, please let me know.

Don
 
Hi Don,

If we can confirm your findings we should update the Wiki. I never tried to use the SHAM section myself.

I would only expect that you would need a MATE section, since a model part always references a material. I think only the texture is optional and of course not needed for the shadow.

If I find some time in the next days, I will give it a short try.
 
Just a quick update. Following some investigation by Arno that confirmed that the SHAM section can indeed be used to cast shadows on the ground, I'm pleased to report I now have the feature (i.e., shadow generation from lower LODs) working in SAMM 2.

We'll document how to use this section later.
Don
 
Hi,

I already emailed this to Don (was travelling for work, so I had no access to the forum). But I got the SHAM section to work. It turned out that the SHAM section needs to be inside the MDLD section of the MDL file.

I have updated the Wiki as well now.

I got it working with a hex editor and some tweaking. But am going to check if I can get this functionality in ModelConverterX as well in the future.

Below is a screenshot that shows two models with the same external model, but a different shadow model.
 

Attachments

  • Image2012-02-07 1916.24.749.jpg
    Image2012-02-07 1916.24.749.jpg
    33 KB · Views: 445
Back
Top