black mesh on mobile

I am using a spline to create a underground tunnel “in game”. I am using one box mask so above the level is transparent, during the level is coloured and below the level is transparent. This works fine in editor and when deployed to IOS.

I wanted to add a second background below the first one with the spline colour transitioning at the same point as the new background. I added another box mask and this works fine in the editor though the mesh is black when deployed to IOS.

I have been stuck on this for weeks. Any suggestions - please help!

I do not think it is exactly clear what are you trying to achieve and what you are getting instead. Isn’t it the same question as here?

yes similar, that was also my question :slight_smile: I though I would try and make it clearer but I think I have failed. The 2nd example above is exactly what I’m looking for but when I deploy to ios, the mesh is black. The first one is also adequate, it works on IOS but it means I cannot change the background when I go deeper underground. I’m not sure why the first one works on IOS and the 2nd is black. Maybe you cannot have two masks on IOS?

So, do you want to just fill the tunnel with red color below ground and black color above ground?

Hi, In the second diagram to the right is how I wanted it to look like.Transparent above ground, brown below ground until you get to a specific point when the material changes color inline with the background (harder rock) (grey). Then to maintain this color until you get to end of the background at which point the mesh will be transparent again. It is working as I wanted in the editor which is illustrated in the 2nd diagram with the material set up and game editor illustration. The problem is when I deploy to IOS the mesh is rendered completely black.

thanks for your help


For simplicity, you could just check position on one axis to get the effect, instead of using box mask.

Regarding it rendering black, meanwhile you wait for someone keen on iOS to drop by this question,you could try removing parts of your material graph one by one and localize the part, that is causing the issue. I bet it has something to do with WS position node inside the box mask. Might be also worth to check the logs.

Thanks for your comments. I am happy to use any method that gets the same effect. Could you expand a bit more on your first suggestion? How would I go about checking the position on an axis and applying the effect?

thanks loads

It gives you horizontal black and white mask, with sharp transition at specified height.

Thanks loads for you help. I managed to get it working on mobile with the set up you gave. I was still drawn back to using a mask to make the areas above ground translucent but it works.

thanks loads again

It still would be nice to know the root cause of the issue, why it was rendering black on iOS. Just for anyone, who might look up this post with the same problem.

Also, you can use the same graph for opacity of areas above ground. Just duplicate it, change the height value, and if you need to invert the mask, you can use “One Minus” node, before plugging it in the opacity slot. The whole reason for hassle around not using box mask is because it performs extra operations, that you do not need. It is not critical, but just slightly better.
Anyway, if you consider your problem solved, feel free to upvote the answer and mark your question as resolved. :slight_smile:

I thought about using the same set up for the opacity on the way to work this morning. I will give it a try later. many thanks again, very much appreciated your help.