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
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.
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.
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.
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.
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.
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.
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.
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).
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.
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
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.
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.
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.
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.
Quote from: Matt on March 18, 2021, 03:15:36 AMIt 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.
Not surprised after your post that tiling, especially on the poles were frustrating.
This is very good info Matt, thanks. I did fiddle around with warp texture, feeding in a vector, but I concluded that it was again just moving in world space. I will have a crack at your suggestions. They make complete sense. I am 99% sure I know exactly what to do now.
Some good information here in general Matt, thanks for the input. Especially regarding transforming with shaders, though I still think vectors for the transform input shader would make this sort of work really easy.
I'm pleased to report that thanks to Matt's tips, I got this working.
Now I can slide the texture up and down and around the equator.
solution.png
Oh wow, it looks like it's working great. Nice function you got going, this will no doubt be extremely useful for all the super high res planets people have been working on. And it looks pretty clean too, so I think its not hitting render times to much huh?
My new Desktop-Wallpaper ;D !
Thanks very much for posting the solution. Very useful and very good Learning Material as well.
CHeers, Klaus
ps: it would be very nice if this and more similar functions would be implemented in TG either as preset or as building block in the future...
Ok here is my final solve for now.
The pink texture is a separate image file, representing my high resolution patch.
The rest of the globe has a lower resolution image map.
I had a little trouble merging the two and ended up using a white bitmap fed through the same setup to create a mask. I couldn't figure out how to do it any other way.
I have also included the .tgd in case anyone else wants to have a poke at it.
solution2.png
Thanks for sharing. Wish there was an indication for user like you in the forum that says "Advanced" or so ;)
lol I'm not advanced. This is my first time using any nodes besides the default ones that come when you open TG.
I am a Houdini user though, so I am fine with 3D math.
:)
Quote from: KlausK on March 18, 2021, 07:32:00 PMps: it would be very nice if this and more similar functions would be implemented in TG either as preset or as building block in the future...
I agree. Or a way to create shaders from functions, marking scalars etc as a setting with like a flag or something and then it packs it all up as a shader and exposes all the settings flagged in the new shader window, and spits out a plugin into the plugins folder to share.
I'm curious how the SDK works for creating a shader? Maybe Matt could explain to me how I could go about learning how to make shaders
from terragen shaders with the SDK (if I had the SDK) and I could go through the forums and do this with some stuff [with permission] for future TG builds or community shares.
Besides this, I would still love to know if it's possible to inject more noises to the noise type dropdown. Would love to add more noises.