Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jwbwork |
So I’m trying to use these shaders, but I’m getting different results on android than I am on my PC. I think I found the source of the issue, the function below which is meant to map the UV to a sphere
vec2 spherify(vec2 uv) {
vec2 centered= uv *2.0-1.0;
float z = sqrt(1.0 - dot(centered.xy, centered.xy));
vec2 sphere = centered/(z + 1.0);
return sphere * 0.5+0.
}
When I change the COLOR assignment to show the results of this on the UV I get these results. On PC it looks like it maps properly and areas outside of the sphere are dropped.
But on android I can see the results are mapped to a sphere, but regions beyond the sphere are kept.
I know mobile devices can have issues with shaders. I’ve tried changing the project settings with not luck. Does anyone know why this function is producing different results or have any ideas on how it can be fixed?