- Home /
Splatmap and Corresponding Textures to 1 final Texture
Is there a program or something that converts a splatmap and its corresponding RGBA textures into 1 final texture?
Answer by tanoshimi · Jun 22, 2015 at 06:19 AM
It would certainly be possible to write such a script, since the logic is pretty clearly-defined: go through each pixel of the splatmap and use the RGBA component values to determine the blend weight of each of 4 splat texture tiles at that point. Then just loop through each row/column of the control texture to build up your final image. Note that if you use this somewhat naive implementation with a control texture of 1024x1024px and each pixel representing a blend of 256x256px terrain textures, you'll end up with a final texture that is 262144x262144px = 68.7 billion pixels :)
That's why Unity doesn't actually ever create this texture in its entireity - rather it generates the base texture dynamically at a given point, with consideration to the camera draw distance etc.
A simpler way to create a usable (say, 1024x1024px) texture is simply to create an overhead orthographic camera looking directly down on your terrain, and render the output of that to a texture, first suggested by Eric5h5 here: http://answers.unity3d.com/questions/15707/is-there-a-way-to-export-a-terrain-texture.html
The reason for the splatmap is NOT for the built in Unity terrain. Its for my own custom models/textures. I can write the script, but it would be great if there is a link to a script already made that I can just download and use without having to write squat.
If I manage to finish the script, I will post it here.
Your answer
Follow this Question
Related Questions
GUI texture to change texture when hovered over or clicked? 2 Answers
Converting a NPOT Texture2D at runtime with SetPixel problem 1 Answer
Can Unity utilize textures created by a plugin? 1 Answer
Is a texture visible 1 Answer
What is the best way to reset textures in the editor after SetPixels? 1 Answer