High resolution Planet textures

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

Previous topic - Next topic

Kadri

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.

Dubbie

#16
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.

WAS

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.

Dubbie

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

WAS

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?

KlausK

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...
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

Dubbie

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

Kadri

Thanks for sharing. Wish there was an indication for user like you in the forum that says "Advanced" or so ;)

Dubbie

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.


WAS

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.