I’ve tried to import an 8-bit Photoshop Raw file every which way I can think of and keep getting either noise or the entire texture is offset (e.g. the center of the texture is on the edge of the terrain). This documentation sheds very little light on the situation.
The docs say “These will be set for you”…not sure what this is suppose to be doing since it always seems to be set to Depth:Bit16, Width:1, Height:1, Byte Order:Mac. Is there actual documentation that explains what settings to use to import a file?
Some questions I have about the Import Heightmap settings:
What is Width and Height? Is this suppose to be manually set to the resolution of the height map? How does this relate to the Heightmap Resolution in “Set Heightmap Resolution”?
What does Terrain Size do? How does this relate to the Terrain Width, Height and Length in “Set Heightmap Resolution”? Should they be set manually to be identical? What if they aren’t?
Here’s an example of a weird result. Left is the displacement map, and right is the resulting displacement. It appears the map was cropped to half the res and then inverted top to bottom and left to right and then overlapped! You can see the F and G overlapping one another.
Use the settings that the file was saved with. Raw files have no formatting info so Unity can’t really determine them; it’s up to you.
Yes, although Unity can try to guess these based on the number of bytes in the file. It assumes 16 bit and won’t generate any useful guesses for 8 bit. If you’re not using power of two plus one, Unity won’t be able to use them correctly anyway.
It’s the same thing.
It’s the same thing.
Yes. If they aren’t then the terrain will be scaled differently.
Thanks for the help. I’m now not sure I’m creating the map correctly in photoshop. Can you shed any light on saving maps out of photoshop? My 16 bit, Greyscale (2049x2049) TIFF still creates inversions and offsets when mapped to the terrain tile…
Thanks man, got it working. Now I’m confused about the 8 bit / 16 bit thing out of Photoshop. Seems like RAW only gets saved to 8 bit…guess I need a different terrain gen app to make 16 bit RAW?
Yep, doing that for the PSD, then I save the Photoshop RAW out of CS4 the save options say:
File Type: PRAW (Greyed Out)
File Creator: 8BIM (Greyed Out)
Header: 0
Byte Order: IBM PC
When I import it into Unity as16 bit, PC Byte Order it works. But when I open the same RAW file in Photoshop and set it to be 16-bit it says “Specified image is larger than file”. When I switch it to 8-bit the file successfully opens…
I can get my files out from Photoshop as 16bit grayscale RAW and imported great into Unity. And it seems like I can get the height map exported from Unity to a 16bit grayscale RAW ( I assume, because if I reimport the Unity exported height map it looks exactly the same) but I can’t seem to open the exported height map back into Photoshop. The best I can seem to manage is to get a 8bit alpha? Which I can convert to 16bit grayscale in Photoshop, but there is some unacceptable loss of quality. . .