Planetside Software Forums

General => Terragen Discussion => Topic started by: balteus on October 24, 2018, 04:26:30 PM

Title: Exporting image map for planet
Post by: balteus on October 24, 2018, 04:26:30 PM
Hi all,
I was wondering if there is any method for creating an image map for the planet in terragen so that the map can be used on a sphere in another application. I have been searching this forum for the same and have not been able to find a good solution.
If there is no direct way of achieving this then I was thinking of maybe using several cameras to render the planet surface and stitching together the rendered images in Mari. Has anyone here tried that before?
Any suggestions are welcome.

Thanks.
Title: Re: Exporting image map for planet
Post by: sboerner on October 24, 2018, 04:56:34 PM
Do you need displacement or just the diffuse color?

What if you put a spherical camera at the center of the planet? (Thinking out loud here.)
Title: Re: Exporting image map for planet
Post by: balteus on October 24, 2018, 05:06:15 PM
@sboerner: thanks for the reply
I just need the diffuse colour although being able to get displacement map would be handy as well.
Camera in the center of the planet doesn't work.
Title: Re: Exporting image map for planet
Post by: Oshyan on October 24, 2018, 05:09:38 PM
This is not officially a supported function. But one possibility would be to put your camera *inside* the planet (good call sboerner!), give the planet a negative radius, and render a spherical image. The trick is giving it a negative radius (equal to its original radius; just put a - at the beginning of the radius value you had, after you put the camera inside).

For displacement it's a bit more complicated than that, you need to disable GI and other lighting and turn the height values of the planet into color values (black to white). You also would ideally remap the black and white point values so you get a more manageable ramp of height values you can use. Then render out spherical and save to 32 bit EXR. I've attached an example project file which shows a basic setup. Note that the Color Adjust values need to be changed to reflect the minimum and maximum displacement values of your terrain for the color adjustment/remap to work right. And you'll need to fiddle with this in your other app(s) to get the height remapped correctly. If you take it into Photoshop for example, it will appear all black, but increase Exposure by a good amount and you'll see the height values.

- Oshyan
Title: Re: Exporting image map for planet
Post by: sboerner on October 24, 2018, 05:18:46 PM
Negative radius – of course. The background shader uses one, and I used a sphere with a negative radius a while back for a starfield. It reverses the surface?
Title: Re: Exporting image map for planet
Post by: Oshyan on October 24, 2018, 05:20:07 PM
Apparently, yes. :D

- Oshyan
Title: Re: Exporting image map for planet
Post by: WAS on October 24, 2018, 05:39:20 PM
Makes sense from a mathematical perspective (really shocked I can comprehend that). As 0 would be folded on itself, thus, negative values would be that fold continuing, thus reverse faces.
Title: Re: Exporting image map for planet
Post by: Oshyan on October 24, 2018, 05:44:41 PM
Sorry, forgot to make the surface luminous. This should help get the values into a viewable range out of the box. :D New TGD attached.

- Oshyan
Title: Re: Exporting image map for planet
Post by: balteus on October 24, 2018, 06:02:07 PM
Negative radius! did not think of that. I was wondering if there was a way to flip normals for the planet to render it from the center. This is so cool. Thanks oshyan   ;D ;D
Can this method do atmosphere and clouds?
Title: Re: Exporting image map for planet
Post by: Oshyan on October 24, 2018, 06:39:18 PM
You could disable surface rendering and put the camera in the center of the planet to export a full spherical atmosphere, but you'd be looking at the haze bottom-up, which would strongly affect things, and I don't really know how you'd apply that in any other application anyway. If you mean to export something like a cloud shape/density mask, you might be able to fake this by disabling both terrain and atmosphere with a *non*-inverted planet and having the camera at the center...

- Oshyan
Title: Re: Exporting image map for planet
Post by: ajcgi on October 25, 2018, 06:39:22 AM
Ah man, how did I never think of this!?
Negative radius has been staring me in the face all this time.   :-\
Title: Re: Exporting image map for planet
Post by: balteus on October 25, 2018, 11:20:30 AM
Well the intention behind getting a map for the entire planet with the clouds was to map that on a sphere in maya for my previz. Getting the layers for the surface and clouds separately would have helped in the comp stage if I needed to tweak the layers as I wanted.
Title: Re: Exporting image map for planet
Post by: sboerner on October 25, 2018, 11:27:42 AM
Can you let us know how this all works out? Who knows, I may need to do something like this some day.
Title: Re: Exporting image map for planet
Post by: balteus on October 29, 2018, 11:00:58 AM
UPDATE:
Ended up rendering a bunch of camera angles for the planet and stitching the renders together in Mari. This gave me the most control but at the expense of time since it takes some time to set up everything. I have 6 cameras at the moment but for higher res I might end up with 24 or more cameras and writing a python script for Mari to project and bake the images from the respective cameras.
The other method discussed in this thread for keeping the camera in the center of the planet was really useful for doing maps for moons. Since I have a lot of moons and they do not have any clouds or atmosphere, generating a diffuse and heightmap works well especially for the far away shots. Heightmap for the planet would also work well with this method.

I need to figure out atmosphere for the planet now. I already have maps for the surface diffuse, cloud diffuse and cloud alpha. I would prefer a volume out of Houdini or Maya but I know they wont handle a volume of planet scale, if only I could get the atmosphere as a sphere out of terragen. Is vdb gonna be an option in the future for terragen? How about using GPU for rendering (would be so useful at production level).
Title: Re: Exporting image map for planet
Post by: ajcgi on October 29, 2018, 12:14:55 PM
Ah now the 6 cameras method is something I've done with a Nuke compositor in the past. That I recognise.
VDB is slowly in development and we're regularly mentioning GPUs just in case Matt suddenly finds 24 hour working days to be attactive.
My answer to atmospherics has been to fake it in the comp sometimes. Even when I render out of TG and comp in Nuke I'll often manipulate the atmosphere or create one from scratch using the depth channel as a way of knocking out some detail for mountains etc.
Title: Re: Exporting image map for planet
Post by: balteus on October 29, 2018, 06:44:08 PM
GPU rendering and VDB would be great additions for terragen.
For the atmosphere I have a couple of solutions when it comes to faking it. Doing it in comp is quick but when I have a moving camera and the planet is not static in frame I need to either track it or place the planet on a card and so on... extra work. The other way is an old method of using a ramp in Maya or any other 3d application to control the opacity of the faces in relation to their angle to the camera.
Title: Re: Exporting image map for planet
Post by: Oshyan on October 29, 2018, 11:09:08 PM
VDB is coming. Not sure that an entire export would be possible though. And it will only be for clouds, not atmosphere. GPU is an unknown, no definite plans at this time.

- Oshyan