- Home /
Question by
cod · Aug 18, 2012 at 11:33 AM ·
terrainperformanceterraindata
Terrain setdetaillayer performance
I have a rgba texture and I need to assign detail layer based on this texture's channels(R, G, B, and A), in the editor mode, but I wanted to know if it's better to just have a single texture with RGBA channels and pass them to the float(,,) with setdetaillayer or to process 4 different textures each with just 1 channel?
Comment
Best Answer
Answer by Bunny83 · Aug 18, 2012 at 01:56 PM
It doesn't really matter since you have to convert the values to an int array manually, so you have to iterate through all "pixels" for each channel. It's probably even faster when you have one rgba texture since you only need to use GetPixels once. If you care about performance you might want to use GetPixels32 which returns the colors as bytes instead of floats.