I am using one of the built in shapes to render a globe with a tessellation enabled material. It looks great until I add grid lines to the globe. How do I fix the distortion?
Thanks
I am using one of the built in shapes to render a globe with a tessellation enabled material. It looks great until I add grid lines to the globe. How do I fix the distortion?
Thanks
If UVs are interpolated linearly across the break lines, that’s what you’ll get. I think you’ll have to proceduarlly generate UVs from object-local space using trigonometry to get a nice, smooth long/lat UV space. I think you have enough data in the shader to do this: Use BoundingBoxBased_0-1_UVW, and implement the atan2 function using a texture look-up. Make UW be the input to the atan2 function, and then use acos(V)/Pi as the latitude coordinate.
Thanks jwatte. I am a bit new to UE, where do I go to implement the shader UV? Blueprints somewhere or in C++? I’m using blueprints for now but I’ve implemented this in openGL before.
You definitely could try what jwatte suggests. I would probably first see how much improvement can be had by adding tessellation since that is really easy to try. My gut says that if you add a decent number of polygons the lines will look straight. I have had to do it before.
Note that I mean tessellation in the low poly mesh (just make a new sphere from max), not using a tessellation shader. This isn’t really a good case for tessellation shaders IMO. Tessellation should be used hand in hand with displacement, it is not really great for smoothing out a flat s
Pretty sure he meant by using a material. To replace the texture coordinate, you would place a texturesample node, and into the “UVs” input, you would connect your custom math equation. Still I’d look into tessellating the base mesh first until trying this.