Problems with a Custom Terrain Material Using Vertex Color to Blend up to 4 Textures on Mobile
I need help trying to get this material setup to be mobile (android) friendly (if possible).
I am attempting to achieve vertex color blending of up tp 4 textures using heightmaps to define the transition between the different textures, for the terrains I want in my game. I am using the HeightLerp node for this. Besides the color textures, there will be normal textures and just flat values or colors to define the metal, specular, roughness and emission. I am targeting Open GLES 3.1 and above. I have 15 of the 16 allowed texture samplers in use.
I am also attempting to do UV tiling through the Custom UV pins in the material. I am using up to 6 as I need to tile the 4 textures, the heightmaps for blending and a Flow map which I may use optionally or not through a switch. So I have each UV channel plugged into the Custom UV pin, as well as into each texture parameter to define it's UV channel and associate it with the corresponding Custom UV pin (except for the one that is to be in UV Channel 0 which is the default). I understand that is how it's done, although I wonder if the "Const Coordinate" value in the Texture Parameters can be used instead of texture coordinate nodes to achieve the same effect (tell the material which texture gets tiled by which Custom UV coordinate).
The thing is that the material currently kills my framerate and is currently unusable, so I need your help to point out what I can or should do to get it to work with a decent performance. Is it killing my framerate because the Custom UV is not implemented correctly? Would I be better off ignoring any kind of UV tiling and just scale up the mesh UVs and reimport? Am I expecting too much by trying to blend 4 textures? Is using the HeightLerp node too expensive for mobile and should I just set up Lerp nodes with Heightmaps in the alpha to control the blend transition? Is it something else?
Thanks in advance!
asked Oct 21 '18 at 10:55 AM in Rendering
Follow this question
Once you sign in you will be able to subscribe for any updates here