High resolution Planet textures

Started by Dubbie, March 17, 2021, 06:39:26 PM

Previous topic - Next topic

Dubbie

I have some high resolution earth textures. They are too large to load as a texture in one go, so I would like to set up some sort of tiling, so that I don't have to map the entire planet in high resolution just to render one little patch.

My first plan was to take my high res global texture maps, dice them up into 4x4 tiles, and then load one tile in and tile it 4x.

I can sort of get this to work by adjusting the "size" in the image map shader - setting it to 0.25 and turning on tiling.
The problem is,  I get an 0.5 offset in Y meaning that my map lands in the wrong latitude.

I can't find any node that will let me slide my texture down so that the top of the map lies on the north pole.

Can anyone give me some hints here?

mapping.png

WAS

Transform Input Shader, use the Translate settings, but it's in meters so it's more of guess work, it's not exponential based on scale.

Dubbie

#2
Transform input seems to move the texture in world space, not in UV space. It's effectively the same as moving the center in the image map shader.

WAS

How are you even doing "UV" when the planet doesn't have UV, and uses XYZ? You'd need a sphere to UV wrap. Transform Input Shader is not World Space/Final Space unless checked. It's texture space.

If I use UV based textures on the planet, it's all a mess and streaks at 0,0,0, though that may be by design as it's polar center.

Always thought best way to wrap a planet is just spherical maps for a sphere, no UV. So you can translate them just fine.

Dubbie

I do have spherical maps. And I am using the image map shader in spherical mode.
But I can't use the entire map because it is too large to load and crashes terragen.
I wanted a way to load just the one tile I care about, but I can't figure out how to do that and have it appear in the correct place on the globe.

I thought the geog map shader would work, but the lat-long settings don't appear to do anything at all.

WAS

Hmm. I'm honestly not sure. You could try the same resolution images, but cut off the top/bottom, and then with the second image half the opposite side visible, and load both images masked together at Y:0 (with planet at 0,0,0 of course). TG may be able to load both images with half the data, and then display them mixed together.

Dubbie

Well thanks for trying.
Yeah my last ditch hack will be to prepare my maps with an offset baked in. Thats a ridiculous workaround though and I hope it doesn't come to that.

I really wish terragen was better at handling planet scale image texturing.
Even if I could feed my own coords to the image shader then at least I could calculate them myself based on worldspace shading position.

Kadri

I might have misunderstood your problem but have you tried to use a big sphere object,
where you UV mapped the parts in another software and use it here in Terragen?

Using a high poly sphere could bring other problems but that depends on what you want to do. Just speaking out loud.

Or maybe you could use a software like Qgis were you map those images correctly to world space and export them as geotifs with location data in them (that is totally out of my league) and use them in Terragen.

If you can export your project with reasonable small images and post it here maybe someone could help too.

Kadri

#8

And one more thing...If only one part of the image is important just put it on the default  zero point and use that.
It isn't important if you don't show the planet with all the other image parts at one time together, as it is relative .

Like using the north pole on the planet to show something that is on the south pole.
It doesn't matter at all were you render. Could be the equator even.

But from a software point actually more you go further away from the default place more you can get errors (as it is in most software).

Kadri


Not sure if this helps but you could try camera projection too by the way.
In this way you can put the image where you want much more easily.

Kadri

#10
Instead of talking i just got a world texture and cropped it to 9 parts and tried this myself.
I will share the file when finished. I just use brute force, trying and whatnot and an ugly fast working style.
Curious if this will help you in the end. Just rendering an animation now to see it better.

The image is this:
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73580/world.topo.bathy.200401.3x5400x2700.jpg
I resized this to 6000x3000 and cropped it to 9x 2000x1000 parts

Dubbie

I have thought of that Kadri, but I don't have the maps in the correct projection for that. And I don't have any software that will handle such a large file as input to remap.
There is probably some GIS software that will do what I want, but I don't know how to use any.

What you are doing in your last post is along the lines of what I am trying to do.

Thanks,

Rhys.

Kadri

#12

Ok i kinda got it to work. But the scales were wrong and in the poles are pinched.
The scales could be made better with a little work but i could not make the poles work better and thus didn't liked the result.

I tried to stretch the crops but that didn't work either.

Then i tried just to crop horizontally (i tried it with just 3 crops) but the poles were still bad.

But when i cropped the image vertically into 3 parts that worked.

So not sure if this will help you but if you crop your big image into vertical parts only, you could get it to work.

Kadri

#13
This is the TGD file. Nothing major. The point was actually just cropping vertically.
This is with the same image i mentioned above. Resized to 6000x3000 and then cropped to 3 x 2000x3000 parts.
You could use many parts this way.

I am sure someone could make this work better but this is what i got. Hope this helps.

Matt

#14
It is theoretically possible to do this but it involves some maths which need to be done with function nodes. I have not tried this yet, otherwise I would give you an example project.

I will describe the idea here in the hopes that you, or some of the node wizards here, can have a crack at it.

The general idea is to treat this as a transform of the texture space, where the texture space is in 3D coordinates. It's easier if the planet's centre is at 0,0,0. Transforming texture space in arbitrary ways can be done with a Warp Input Shader, a Vector Displacement Shader and some function nodes to do the necessary maths. For each point on the planet that you want to render (e.g. within your tile), the Vector Displacement Shader needs to produce a 3D vector which is the difference between the 3D point on the planet (within your tile) and the desired point in the whole spherical map (again in 3D) which the image map thinks it's using when you use the spherical projection mode. You'd use a Get Position in Texture node, do some maths, and subtract the original position from the output of your maths to get a displacement vector. For example, if you only wanted to shift the longitude of the map you could use a Rotate Y function node and then subtract the input from the output to get the difference (displacement), and plug that into the Vector Displacement Shader. To stretch the map over a different range of longitudes, or change latitude, it's more complex but I think it should be possible.

I might be able to try it later this week but I hope someone succeeds and posts an example before I do.
Just because milk is white doesn't mean that clouds are made of milk.