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

MSFS20 [SOLVED] Is it possible for a scenery object to reference a texture from separate location/material library?

RicherSims

Resource contributor
Messages
574
Country
dominica
In FSX/P3D/XP11 I use a lot of shared textures across multiple sceneries (for example one texture sheet with painted taxiway numbers/markings) which I place in one "common" folder.
I then reference these textures from outside this common folder as the sim usually loads the textures at run time. Therefore I can release airports without duplicating these resources.
In XP11 you can use library.txt files and in FSX/P3D you can simply include them in a scenery package or use texture fallbacks in CFGs via SODE.

I have had success in creating a package that contains only a MaterialLib in MSFS, and I can successfully reference these textures for aprons/lines.
But how can I tell a GLTF scenery object to look elsewhere for a texture? It does not seem that the objects are aware of any materials outside of its immediate texture folder.

I have tried editing the GLTF with ModelConverterX and placing a relative path before the texture name (example: "..\..\..\richersimulations-rs-common\materiallibs\rs-common-materials\textures\".
This works within MCX, but on export the path is stripped out. I found the option in MCX to save paths with texture names but this does not seem to make any difference within MSFS.
I have also tried editing the GLTF manually with a text editor and placing this relative path in the Textures and/or Images section, but either way, the MSFS SDK Package builder throws a "
tinygltf: Root element is not a JSON object" error when attempting to build the package. According to the MCX export, the path goes in the "uri" under the "Images" section of the GLTF, but again MSFS seems to ignore this.

Is this possible at all, or will I have to duplicate my textures across multiple packages?
Any ideas are welcome.
 
Last edited:
I think for this to work you need to create a dummy airport under which you would stack your objects and then compile. After that you should be able to find them from within other projects together with the textures.
 
I think for this to work you need to create a dummy airport under which you would stack your objects and then compile. After that you should be able to find them from within other projects together with the textures.
I think I follow what you mean and I think that would work if you are reusing multiple identical objects, say for example a firetruck or a light pole.
However, in my use case the objects change, but they may still share a texture sheet.
For example, a projected mesh of taxi-lines and markings, or a large fence object for an entire airport. The object geometry will change from airport to airport, but the textures themselves are fundamentally the same.
 
Look in the default scenery. Onestore/Asobo-airport-lpma-madeira/scenery/madere and there is a texture.cfg which sets up fallback folders. It looks like most sceneries use fallback textures. I don't know where Asobo_Buildings is located though.

[fltsim]
fallback.1=scenery\madere\texture
fallback.2=Asobo_Buildings\Texture
 
Look in the default scenery. Onestore/Asobo-airport-lpma-madeira/scenery/madere and there is a texture.cfg which sets up fallback folders. It looks like most sceneries use fallback textures. I don't know where Asobo_Buildings is located though.

[fltsim]
fallback.1=scenery\madere\texture
fallback.2=Asobo_Buildings\Texture
Exactly what I needed! Thanks!
Nice to know fallbacks are still supported for sceneries.
Now I just need to know whether the paths are virtual, relative or absolute so I can test it.
 
Hello:

I immediately found the "absolute" path cited above: Asobo_Buildings\Texture ...by using it as a query string in the "Everything" search utility:

Asobo_Buildings\Texture

Hi Rob:

Here is an excellent fast application that may help; I have used it for years to search NTFS (and now other) file system formatted storage drives on local / networked computers: :idea:


"Regardless of the file system used on the indexed drives and folders, Everything searches its index for file names matching a user search expression, which may be a fragment of the target file name or a regular expression,[9] displaying intermediate and immediate results as the search term is entered. "





If you enter some or all 'Type' names you listed above as query strings, you may find some interesting MSFS-2020 related file / folder paths. ;)

I hope this might prove useful. :)

GaryGB

I hope this info proves useful to all who are interested in better understanding the (under-documented) structure and function of MSFS-2020. :)

GaryGB
 
Last edited:
I think the paths can be relative, absolute or virtual. Try them all and let us know.
 
I think the paths can be relative, absolute or virtual. Try them all and let us know.

For the benefit of others reading this thread that are less familiar with Windows path 'type' terminology, see: :pushpin:





IMHO, a related consideration includes file naming and path of ModelLib files: :idea:



GaryGB
 
Last edited:
Here are the results of my investigations:

Absolute paths do not seem to work.
I have tried:
C:\Install Packages\Community\richersimulations-rs-common\MaterialLibs\rs-common-materials\Textures
and
C:\\Install Packages\\Community\\richersimulations-rs-common\\MaterialLibs\\rs-common-materials\\Textures

Neither do relative:
I have tried:
..\..\..\richersimulations-rs-common\materiallibs\rs-common-materials\textures
and
..\\..\\..\\richersimulations-rs-common\\materiallibs\\rs-common-materials\\textures

As for virtual paths; my material libraries do not seem to get registered in MSFS's virtual file system, but sceneries do. Thus I cannot seem to access a texture through the VFS without first creating an object which uses said texture in a "scenery" package.
My last idea is to create dummy cubes with the textures applied to it's sides and see if I can access the textures that way.


In the mean time if anyone else has successfully used absolute/relative texture fallbacks for their scenery objects please let me know.
 
It seems that Asobo has made some changes in the most recent update or maybe I just missed it earlier. Either way, if they happened to have read this thread. THANK YOU ASOBO!
Material Libraries are (now?) registered in the Virtual File System and you no longer need to duplicate textures across packages.
As of SDK v0.10.0, the console also notifies you when it looks for, and fails to find, a texture using a callback. (It will also notify you when the texture isn't found in the first texture folder, even if it finds it in the 2nd fallback, but that is of no consequence.)

The proper way to utilize callbacks is as follows:

Code:
[fltsim]
fallback.1=scenery\RicherSimulations\texture
fallback.2=materiallibs\rs-common-materials\textures

Fallback 2 is a virtual path.

Currently, the only downside is that each one of your textures will have to be manually added, one by one, to your material library (but looking at the contents of the files generated, it looks pretty straight forward, and I'm sure someone will come up with a tool to do all that work for you in a flash, very soon).
 
...
Code:
[fltsim]
fallback.1=scenery\RicherSimulations\texture
fallback.2=materiallibs\rs-common-materials\textures
...
I am not sure to understand where do you put this texture.cfg file.
Could you precise please?
 
And how do i reference it in the gltf?

Lets say i want to give a simobject a texture out of the modelib/texture folder (because the texture used for the simbject is shared for multiple objects, its a full 4k substancepainter texture used for a handful of objects). How would i reference it with above mentioned way.
 
@Senchay There is no special/additional work required. Simply enter the texture name as if it were in the modellib/texture folder. No path is necessary. If the sim does not find it there, it automatically checks the next fallback in the texture.cfg.
 
Still confused, sorry. Ive read the post above but somehow i dont get it...

Just to make sure, i mean i have the textures in the modellib folder but the object that needs a fallback is a simobject (not a scenery object in the modellib folder), and therefore in a whole other folder. When i enter the texture name as if it were in the modellib/texture folder i would have to do ../../xxxx and that gives me a compiler error. Probably some symbols like the / have to be escaped? Anyway, if its not important what is in the gltf and i go for fallback only the below is whats happening

Also, i guess this texture.cfg fallback in my case goes into the folder of the simobject, not the modellib folder of the scenery objects?

Certainly im doing something wrong because the texture isnt shown.


This is the layout of my project

1619481244913.png


And the simobject in the last folder has a texture that is in the modellib/texture folder of the simobjects. That would be ../../modelLib/texture/xxx.png

Ive put this as fallback

[fltsim]
fallback.1=scenery\Senchay\TEXTURE

and placed it first try into the modellib folder next to the texture folder, as you posted above. That didnt work.

Second time ive placed it into the the texture folder of the simobject, didnt work too. The structure of my simobject ive got out of the sample windsock.

So it looks like this:

1619482638664.png


If i place the textures in this TEXTURE folder in simobjects, everything works but then the texture would be one time here and one time in modellib, because as said, other scenery objects share the same texture (its a texture calatogue kind of texture).

I dont see anything in the sim if i delete thr textures out of the simobjects//xxx/texture/ folder and place a fallback into modelib, nor if its in simobjects/xxx/.

1619482733101.png



Edit, can it be i have to put it here in my case? Thats the sim.cfg of the simbject.

[fltsim.0]
title=EDMI-Sonnenschirm
model=
texture=

Really annoying to troubleshoot this if the sim need 10 mins to start...
 
Last edited:
../../xxxx and that gives me a compiler error
You do not need ../../xxxx.png. You only need xxxx.png.
The texture entry takes no paths. The sim will determine which paths to look in automatically.


[fltsim]
fallback.1=scenery\Senchay\TEXTURE
Correct. That uses the VFS to reference the scenery package, assuming that inside your scenery folder is a folder called SENCHAY when your package is built and placed in the community folder.
Also, i guess this texture.cfg fallback in my case goes into the folder of the simobject, not the modellib folder of the scenery objects?
For your case, that seems correct, but your edit below...

Edit, can it be i have to put it here in my case? Thats the sim.cfg of the simbject.

[fltsim.0]
title=EDMI-Sonnenschirm
model=
texture=
...is worth trying and seems like a very good idea. This just might be able to take a VFS reference. Perhaps a person who works with aircraft and simobjects can confirm as I have not tested this on my simobject.

Really annoying to troubleshoot this if the sim need 10 mins to start...
I know right! There is a fast start shortcut somewhere on this forum. A google search should help you find it. At least your startup time will now be 7 minutes instead of 10. :D
 
Thanks for your time mousy! Very appreciated. I will look into it again and report back. Maybe not in the next 1 or 2 days but when I found the solution i will get back here.

Thanks again.
 
Back
Top