Search Unity

Photoshop settings for RAW file export?

Discussion in 'Editor & General Support' started by bigkahuna, Nov 16, 2007.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    When I try to import a Photoshop .RAW file into Unity terrain I get a "mask == 0" error, so I searched the docs and the forum for answers. Unfortunately, I haven't found an answer to this issue and I'm not much of an expert in Photoshop (I mostly use GIMP) so I may be missing something simple.

    What settings should I set in Photoshop for export to Unity?

    I read in one post that you have to "turn off export alpha" in Photoshop. My file is RGB with no alpha (as far as I can tell), is there some other setting I have to change for .RAW files?

    A quick tutorial on this, I think, would be very helpful.
     
  2. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    i've gotten that error with a photoshop raw when i tried to change the bit depth (from 8 to 16) in the unity importer. don't know why that is, but really using photoshop for heigtmaps is next to useless as far as i can see (please somebody correct me if i'm wrong ; )

    i'm still trying with it though - as IMO the bryce interface is the most unusable POS i've ever come across - and i can't seem to get decent size heightmaps out of it anyway.

    anyway, using the defaults in both ps unity will get you something for the terrain - its not pretty requires lots of smoothing but its a start.

    ; )
     
  3. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Thanks, I've given up on Photoshop for now, but am now trying to export a heightmap from Carrara 6 Pro. The first screenshot is my export options in Carrara. The second shot is the result... ouch! I'm not even sure where to start to fix this, any suggestions?
     

    Attached Files:

  4. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    i don't have carrara so someone else will have to help you but just FYI twiddling with photoshop raw i've gotten the same look as well so its not just a carrara issue.
     
  5. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    681
    For successful heightmaps, what I did was to convert to grayscale, not RGB, make sure it's power of 2, make sure terrain size is the same as the image size, and reduce the height variable to a fraction of the width and length variables in the import resolution box.


    I've made fake ones in photoshop, but you can get very nice data at http://seamless.usgs.gov/. I'm sure there are many ways to skin the cat, but I pulled BIL files, converted them to tiffs in Microdem, then converted that to RAW in Photoshop. I'm going to do a video toot on the process, I think - very useful.

    Here's an example file.
     

    Attached Files:

  6. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    hmm - keeping the height to 1/16th the width is pretty restrictive - do you happen to know why that is?

    good info, thanks ; )
     
  7. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Thanks for the help Polytropol, I'll give that a try.

    Regarding Carrara 6, I got it working. Turns out that the 8 bit and 16 bit Intel format .RAW files work fine in Unity. Just to prove it, here's a screenie of the result:
     

    Attached Files:

  8. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    681
    dunno. I don't even know what the correct ratio (height to length/width) should be, I just guessed. Tweaking those parameters is cool for imaginary terrains, but for "accurate" sims it would be good to know what the real ratio is.
     
  9. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    @ Dr J
    Personally I find bryce quie easy to use :p So I'd be keen to hear if anyone has got a pipeline from bryce 5.5 to the terrain engine?

    Using Cheetahs split tool and top down camera you can cut up a Bryce terrain into unity digestable chunks, and I guess Mayas extract tool would do similar.

    But on that note cheetah has a cool terrain machine/heightmap generator too, which I havent played with much.

    The possibilities...
    AC
     
  10. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    if i remember correctly there's two methods i found to get heightmap info out - the simple one is just to hit apple-c while the heightmap editor is open then you can paste it in any image editing app (the drawback is it is only 512 x 512 i think). the other is to use the pulldown menu (arrow icon?) in the heightmap window to export - i got something in there to work - i'm not on my computer so i can't check what the exact settings were.

    sorry for the delay in replying i'm away for thanksgiving right now ; )
     
  11. Unclet

    Unclet

    Joined:
    Apr 12, 2007
    Posts:
    92
    I think I've discovered something.

    I never had a problem using 16bit RAW files from Photoshop before in the Terrain engine -- they just work. However today was at home (snowstorm) so I decided to mess around with Unity. No matter what I tried (it seemed) I got the spikes like bigKahuna's pic.

    My main machine at work is a G5... here at home I have an Intel iMac. For some reason I decided to try importing the RAW file with the opposite machine encoding... and viola. It works. In other words, export from ps as RAW 16b Intel, import into terrain heightmap as RAW 16b PPC.

    I can't try it now to verify, but I'm almost certain it works as expected on the G5 (export from ps as PPC, import into Unity as PPC) -- I've done it many many times -- I'm sure i would've noticed this before.

    I'm on dialup here or I'd post a pic.

    Hope this helps.
     
  12. omarsr

    omarsr

    Joined:
    Dec 22, 2007
    Posts:
    76
    I was under the impression that terrain height was the difference between the highest and lowest points of the geographic area you were making. For example in my Kursk terrain, there is roughly a 200m difference in altitude from highest to lowest point so I set my terrain height to 200 (200m) and got the gently rolling hills that really exist in that area of the world.

    My terrain size is 80,000X80,000 but I need to go larger to encompass a couple of areas of importance. This will make it end up being about 140,000X140,000. My heightmap is 4096X4096 greyscale RAW 16bit.