#shader question: I have a sphere, the position on which is represented by a normalized vec3.
How do I split it into roughly equal shaped and sized regions with some kind of coordinate of where I am within the region the current point falls into?
Discussion
#shader question: I have a sphere, the position on which is represented by a normalized vec3.
How do I split it into roughly equal shaped and sized regions with some kind of coordinate of where I am within the region the current point falls into?
@ben Cube mapping or octahedral mapping should fit the bill depending ok what you need it for. (cube is dead simple: compute your position vector relative to the sphere's center and pick a side on an axis aligned cube based on which axis of the vector has the largest absolute value, then project the vector on the plane of that side to get your 2D location on that face)