1
$\begingroup$

Maybe I'm going about this the wrong way, but I'm trying to model a huge area (up to 200 km or more) mainly as background to an area about 3 km long and 2 km wide, supposedly on the surface of an Earthlike planet. There is a river just off-center, curving south past the area of interest. There are bluffs about 5-9 km apart on either side of the river valley. The river branches just north of the area of interest. There is a small hill at the northern extreme. (I haven't even started modeling the thing I want to model. This is just the setting I want to place it in.)

The reason for the huge model is that I might want to do aerial renders of the final model (as if from a drone 500-2000 meters up), and at that altitude, if the camera view includes the horizon, the curvature of the Earth will have a noticeable effect. (A flat or infinite plain will look different.)

To mimic the curvature, I used Geometry Nodes to distort a series of grids. The first grid is a 6-km square. The second is a 12-km square with a 6-km square hole in the center. The third is a 24-km square with a 12-km square hole in it. Etc. The number of vetices per grid is adjustable, independent for each grid.

To create the curvature of a grid, I take the x and y position of each vertex, calculate (from the sine) the angle it forms relative to (0,0,0) and (0,0,-6378,000), then use 1-cosine times 6378,000 to calculate the z displacement (always a negative number, except at 0,0,0). I enforce shade smooth on the bent grid from within Geometry Nodes.

Here's my problem: at certain angles, the renders of even mildly reflective areas of the grid produce artifacts that appear as curved lines. This happens even on the center grid, the smallest of them all. Increasing the number of vertices makes the lines sharper and more obvious. Decreasing the number of vertices spreads the artifact out, making them less obvious, but does not get rid of them. They're still there.

I don't understand why I'm seeing these artifacts. They appear in the same place regardless of how much or little I subdivide the grid.

The following examples show renders using 901 or 201 subdivisions per side. The artifacts are less obvious with fewer subdivisions, but still present, and more jagged, with linear edges that clearly look unnatural. Also, they're in the same place, as if the only thing that matters is the distance to the center point. Changing the sun's position can hide the artifacts on areas like the "grass," but they almost always show up on the water. Looking at the model at a larger scale, I can sometimes see a series of these artifacts, like concentric rings.

Any ideas as to what is causing these artifacts or how to eliminate them?

Examples:

901 subdivisions

901 subdivisions annotated

201 subdivisions

Edit:

So, my bad. Rendering is not the issue. The problem is with the mesh. My Geometry Node solution to bending a flat grid into a region of a sphere is not producing a smoothly curving surface. It is instead producing a series of concentric horizontal surfaces that move downward at discrete intervals. (Each vertical adjustment is 0.380 meters.)

I'm guessing that my math calculations are being truncated. Math precision in Blender is limited to about 7 decimal places, and my calculations are probably running up against that limitation.

The following rendering shows how the concentric rings are being caused by tiny but abrupt changes in elevation, which show up in the proper lighting.

elevation rings

So back to the original issue, how to produce a mesh with a very small but smooth curvature.

$\endgroup$
3
  • $\begingroup$ I'll look deeper into a solution for your main problem, but in the mean time, may I ask whether this may not be better accomplished with some "hackery", rather than attempting to use real-world scales. Blender is not amazing at floating point operations, and loses precision as you move away from the world origin - at a distance of 5km from the world origin, precision drops to .5mm and it only gets worse from there. Given this, might it be better to make a smaller scale scene, and gain the "atmospheric/earthly curvature" by manipulating the focal length of the camera instead? $\endgroup$ Mar 12, 2023 at 18:20
  • $\begingroup$ The main problem with using "hackery" is that I don't know any to use. In any case, I believe your comment about Blender not being amazing at floating point operations is at the heart of my problem. I'm going to see if I can edit my original question to ass additional information. $\endgroup$ Mar 12, 2023 at 20:04
  • $\begingroup$ Best advice I can give for the "hackery" part is to use Cycles engine, which gives you access to all the Fisheye types of Panoramic camera. From there, it's a matter of choosing the right values to fit your needs (easier said than done, I know). $\endgroup$ Mar 12, 2023 at 20:11

1 Answer 1

0
$\begingroup$

It turns out that the curvature of a "small" area of a very large sphere can be approximated using a simple function: the -z displacement for each vertex of the grid = a constant times the radius squared (x squared plus y squared). The constant is 7.839 X 10^-8 for a sphere with a radius of 6378 km. According to a spreadsheet I put together, the error from this simple equation increases at larger distances from the center, but is still off by only 1 meter at a radius of 200 km, which for my purposes is negligible. No more lines.

Addendum: It turns out that the constant = 1/2R, where R is the radius of the sphere (e.g., 1/2*6378000 = 7.839 X 10^-8).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .