Jump to content

3 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

I'm experimenting with ModTools scripts and I'm having trouble replacing the LOD of a road texture, I'm using a modified version of this code snippet

var networkName = "Basic Road"; // replace with the one you want to edit

var lodMaterial = PrefabCollection <NetInfo>.FindLoaded(networkName).m_segments[0].m_lodMaterial;
Texture2D lodtexture2D;

if (File.Exists("tt/" + "lodtest.png")) {
 lodtexture2D = new Texture2D(1, 1);
 lodtexture2D.LoadImage(File.ReadAllBytes("tt/" + "lodtest.png"));
 //lodtexture2D.anisoLevel = 16;

 lodMaterial.SetTexture("_MainTex", lodtexture2D);
}

In ModTools, the lod texture seems to be replaced when the script above is run, but in game the road doesn't update

modtools-screenshot.png.b77976b1f78a8d07cf487a1148893986.png

Does anyone have any ideas on how to make this work?

Thanks

lodtest.png

lodtest.png

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

When the game loads, for each type of prefab, LOD textures are combined into one big texture called an atlas. So it's not possible to change the LOD texture ingame, unless you can figure out how to edit/recalculate this atlas.


Ronyx rhymes with electronics...  

Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Is it possible to disable the loading of the lod entirely? Setting the m_lodRenderDistance value to a arbitrary high number doesn't stop showing the lod

    • No 1

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections