I am trying to implement tri-planar mapping but when sampling from a texture the texture seems way too small.
heres a picture(testing it out on one axis- z-axis). and closer look:
The Radius of my sphere is 32 units.
And heres my shader code so far,
void main() {
// Triplaner UVs
// .5 to center
vec2 uvX = vWorldPos.zy + .5; // x facing plane
vec2 uvY = vWorldPos.xz + .5; // y facing plane
vec2 uvZ = (vWorldPos.xy + .5); // z facing plane
// Albedo door texture map
vec4 doorX = texture2D(uDoorImg, uvX);
vec4 doorY = texture2D(uDoorImg, uvY);
vec4 doorZ = texture2D(uDoorImg, uvZ);
gl_FragColor = vec4(doorZ.rgb, 1.0);
}
When lowering the radius it gets bigger but need the sphere to be large so any help would be appreciated