- Home /
Question by
smtabatabaie · Apr 01, 2016 at 04:04 PM ·
texturescreenshotheightmapraw
Saving texture as raw
Hi, I wanted to capture the screenshot of a camera and then use it as a terrain's heightmap. I wanted to ask how can I do it and if there are any ways to save it in raw to be able to use it as terrain's heightmap.
Thanks
Comment
Answer by Dave-Carlile · Apr 01, 2016 at 04:30 PM
You can use Texture2D.GetPixels to get the color data into an array. You'll need to convert that into an array of floats, then use TerrainData.SetHeights to use it as a heightmap.
Your answer
Follow this Question
Related Questions
Resizing a screenshot (mobile) 1 Answer
why heightmap flips in terrain import raw(certain case)? 0 Answers
Memory issues when taking Screenshots ? 1 Answer
Terrain Layers- Colormaps, and Textures. 1 Answer
Unity Terrain Texture Resolutions 1 Answer