Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

TerrainData is missing splat texture n (tx name) - read/write required?

Discussion in '2017.3 Beta' started by sstrong, Nov 2, 2017.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    In U2017.3.0b7, when attempting to set terraindata.splatPrototypes it requires the textures to be read/write. This wasn't required in previous versions. What's changed?


    TerrainData is missing splat texture 0(tex name), make sure it is marked for read/write in the importer.
    UnityEngine.TerrainData:set_splatPrototypes(SplatPrototype[])

    upload_2017-11-2_16-46-24.png
     
  2. Jack-Unity

    Jack-Unity

    Unity Technologies

    Joined:
    May 21, 2013
    Posts:
    34
    Hi Stephen,

    So just to check a couple of things - are you doing this procedurally? When are you seeing the message?

    The honest answer is that a splat texture has always been required to be read/write enabled, it's just that the build process was setting this at build time it when it found terrain textures, the latest change was to fix issues when the textures could be assigned in other ways and to generally warn that this setting was required.
     
  3. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    Yes, it is part of our Landscape Builder asset - so it needs to support multiple versions of Unity. It is always being set in code. To be honest, it has always been an issue updating the Read/Write status as it seems to behave differently in different versions. Some versions require you to first set the TextureImporterType to Advanced or the Read/Write status doesn't "stick". Just setting isReadable is often not enough.
    We do have a lot of error checking in the editor and at runtime but obviously not enough. Is there a preferred method for making a Texture2D read/write (in the asset database) that always works from U5.4 onwards?
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Could you please file a bug report with a minimal reproduction case for this issue and reply in here with the case #? There's nothing related logged yet.
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
  6. mostlyhuman

    mostlyhuman

    Joined:
    Mar 16, 2013
    Posts:
    53
    Im getting the error as well in 2017.2.0p1 for splat map 0 in the terrain
     
  7. Tigremtz

    Tigremtz

    Joined:
    Oct 29, 2017
    Posts:
    2
    Me too 2017.2.0p1
     
  8. Jack-Unity

    Jack-Unity

    Unity Technologies

    Joined:
    May 21, 2013
    Posts:
    34
    Hi,

    As mentioned in the other thread, the editor error is being removed and will hopefully be gone for the next patch. However, I would like to re-iterate; the only thing that has changed under the hood is preventing a crash which could occur when calculating the basemap if a non-read/write texture was assigned to the terrain procedurally or from an asset bundle. If Unity knows the texture is going to be on the terrain at build time, it will mark the texture as readable then. The addition of the message in the editor was supposed to alert you to that but it has caused a lot of noise and worry. Additionally, because Unity will still set the texture readable, even if you don't, this means the error is no longer present at runtime in the built player which is adding to the confusion. So we've decided to keep all the error reporting in the players only and to update the docs to explain the editor behaviour.

    If you are able, I would recommend rolling back to the version of Unity you were on before and wait for the next patch if you need the patch release.
     
    Claytonious and sstrong like this.
  9. xGeorgeV

    xGeorgeV

    Joined:
    Aug 8, 2013
    Posts:
    65
    Me too 2017.2.0p1.
    I can't use this version.
     
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    #metoo
     
  11. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    I'm not sure why it isn't being raised as a warning. Happy for Unity to alert people to the issue, but IMHO, for this scenario an Error seems a little extreme. We tend to only raise errors when something is broken. If a user needs to change something, we'd typically raise only a warning.
     
    AndersMalmgren likes this.
  12. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    This is happening when loading a scene in the editor, nothing to do with being set procedurally. I had to set all the textures read/write that were used on terrains.
     
    JamesArndt and AndersMalmgren like this.
  13. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Is this required, that these textures must be readable during run-time?

    I'm asking, because according to the documentation, readable textures consume more memory:
     
  14. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah, same here. But it does not triogger error in editor, I need to play the scene
     
  15. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I was also facing similar error when I play the game in editor.
    Any kind of solution exist for this?

    Screen Shot 2017-11-12 at 4.24.45 PM.png
     
  16. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    Okay I manage to solve this problem, by making enable Read/Write for texture as like this:

    Screen Shot 2017-11-12 at 4.32.00 PM.png