Jump to content
boformer

Custom Ground Textures and other interesting prop shader tricks.

93 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

That might only work on flat terrain, and accurate prop placement can be very iffy.

Best bet would be a very large subdivided plane you could plop on the other side of Shrooms assets, they would just slide underneath like a doormat and you could zone or build on top / underneath.

Guess yes if you switch to fence shader. But I wouldn't want to try and align 20 line props. :P

I don't know if it is the fence shader.it looks like the prop is really painted on the ground.

From what I've seen (I can't be certain!) it's the same one used for anything that follows the ground, road markings, hedges, Jap garden, tunnel, road and bridge meshes etc. If there's another one I would love to find it :thumb:

Edit: Assuming the game uses legacy shaders from Unity 4 I believe all of those are based on http://docs.unity3d.com/Manual/shader-TransCutBumpedSpecular.html

As far as I know there's no other technique for supplying heightbased d+s+n+a...

Sorry lol really going offtopic technical XD

Ok, here is the answer:

Decal Shaders:

The shader name is

  • "Custom/Props/Decal/Blend" for road arrows, parking spaces, tiles, old asphalt
  • "Custom/Props/Decal/Solid" for manholes

Both props use a simple box as a mesh, and a diffuse + alpha texture.

This stuff could probably be used to create custom ground textures (e.g. for plazas, or flowerbeds, or a crime scene). It opens up so many possibilities.

Fence shader:

The prop hedges and industrial fence use the "Custom/Props/Prop/Fence" shader, which is quite self-explaining. It makes the prop follow the terrain.

Default Shader:

"Custom/Props/Prop/Default"

Script to change the shaders:

https://gist.github.com/boformer/38d97d663779d48a21ed
(Important: Read the comments and modify the script before you run it!)

Use the Mod Tools console to run the script.

Here is a test result using a simple cube and the script run with the set vakzes. I don't understand completely how it scales the texture:

It seems like the UV map of the cube is ignored.

avOHRtC.jpg

 


  Edited by boformer  
  • Like 7

Share this post


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

Interesting! Super useful I will definitely try this. Do you know if these can be used for asset or props only?

Share this post


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

    Interesting! Super useful I will definitely try this. Do you know if these can be used for asset or props only?

    The shader was definitely made for props. You could modify the underground building texture script to apply the shader to a building.

     


      Edited by boformer  
    • Like 1

    Share this post


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

    So far it looks like every texture is rendered as a 4x4m decal. I wonder how we can influence the size. Maybe with the prop scaling options?

    Share this post


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

    CO uses the same technique for their volleyball and the tennis field. There are 2 hidden props for that.

    The problem is that I don't know how to create decal props with a size larger than 8x8m. You can already use this feature for your buildings if you only want to cover small surfaces.

    The other way would be to use the fence shader for your building (the one that allows underground textures).

    The landfill uses a different feature: multiple meshes (displayed depending on used capacity) using the "fence" shader. This feature can not be used by asset creators because the serialization is missing (just like light props).

    Share this post


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

     

    The other way would be to use the fence shader for your building (the one that allows underground textures).

     

    The fence shader allows for a perfectly flat ground, is that the trick ? So you can use a flat surface as a base ?

    SHroom told me about this shader when I asked how he made his parking lot... but I have zero idea how it works... and won't it cause trouble if the building tries to grow on a sloped terrain ? (Yeah I really have NO idea ;) ) 

    Share this post


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

    The shader is used by the japanese garden and the cemetery and the metro entrance

    y=0 is always on the terrain if you use that shader.

    It will deform your buildings if the terrain is too steep.

    Share this post


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

    Lol, that's awesome! (in a morbid way).

    Love the fallen leafs as well: they are props, right? Kind of surprised that they seem to follow the 'terrain' in the same way as the street/pavement textures (becoming distorted/stretched) - I thought props were plopped onto the underground, not fused with it... (note that I have zero idea how things work under the hood...)

    Share this post


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

    Lol, that's awesome! (in a morbid way).

    Love the fallen leafs as well: they are props, right? Kind of surprised that they seem to follow the 'terrain' in the same way as the street/pavement textures (becoming distorted/stretched) - I thought props were plopped onto the underground, not fused with it... (note that I have zero idea how things work under the hood...)

    That's because it uses the "decal" shader. The arrows on the roads and the manholes are also props.

    • Like 1

    Share this post


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

    Lol, that's awesome! (in a morbid way).

    Love the fallen leafs as well: they are props, right? Kind of surprised that they seem to follow the 'terrain' in the same way as the street/pavement textures (becoming distorted/stretched) - I thought props were plopped onto the underground, not fused with it... (note that I have zero idea how things work under the hood...)

    That's because it uses the "decal" shader. The arrows on the roads and the manholes are also props.

    TIL ;) 

    Share this post


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

    Ok... then not usable :/

    Only solution left is the decals like the tiled floors or the parking space marker in the asset editor

    With the new sub-buildings mod, this is definetely usable. You have to create 2 assets:

    The main building using the default shader, and the ground mesh using the fence shader. Then just overlay them.

    If the mod is not installed, only the main building will be displayed as a fallback.

    • Like 1

    Share this post


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

    Yes. Though right now the size is limited to 8x8m.

     

    • Like 3

    Share this post


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

    Just added 2 new textures:

    dOeZXC6.jpg

    • Like 5

    Share this post


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

    Love it, the more textures the better :) Have you figured out the scaling on this? Is it a 4x4m tile?

    Share this post


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

    It is still 8x8m. no time to find out today.

    Share this post


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

    problem i have creating ground tiles ( i really like this option for citybuilding) is that normal maps not used right. Even you can giv one to the tiletexture if you drop it to the ground it blends in the normal map of the underlaying texture. Used blend shader.

    Share this post


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

    that's right. It is a limitation of the blend shader.

    btw, here is how to make these decals:

    Create a cube in origin. Size: 8x8x8

    Import the prop with the desired texture (diffuse + alpha)

    Run this script: https://gist.github.com/boformer/eead42035bac7862081f

    it will also change prop category and priority.


      Edited by boformer  
    • Like 2

    Share this post


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

    is there anyway get that normal map shown up?

    Share this post


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

    is there anyway get that normal map shown up?

    no. In that case you have to create a "fence" prop (plane 10cm above y=0).

    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