Is it possible to import an external skybox model to replace Terragen's skybox?

Started by noahding1, December 09, 2021, 04:05:52 AM

Previous topic - Next topic

noahding1

Is it possible to import an external skybox model to replace Terragen's skybox?

How do I operate it?

sboerner

Sure. 

Double-click the "+" sign on the Background node to access its internal shading network. (The background node is just a giant sphere with normals pointing inward.) Then replace the Background shader with a Default shader. Set the Default shader's Base colour to zero and Luminosity to 1. 

Then create an Image map shader and import your skybox image. Connect this shader to the Luminosity slot of the Default shader. 

Disable the Enviro light and Sunlight nodes. In the Planet node, disable Render surface and Render Atmosphere.

You can use this setup for image-based lighting as well.

Hannes

I'm not sure (I don't have access to TG atm), but as far as I know you'll have to set the image map's mapping to spherical, right?

sboerner

QuoteI'm not sure (I don't have access to TG atm), but as far as I know you'll have to set the image map's mapping to spherical, right?
Yes, good catch! My omission.

noahding1

Quote from: Hannes on December 09, 2021, 05:17:52 PMI'm not sure (I don't have access to TG atm), but as far as I know you'll have to set the image map's mapping to spherical, right?
Yes, can the SkySphere of UE4 be imported into TG as the SkySphere of TG?

sboerner

Sorry, I'm not familiar with UE4. But unless there is a way to export the SkySphere from UE4 in a format that can be used by Terragen, I don't think it's possible to do this directly. 

Perhaps someone here who has used UE4 may be able to provide a better answer.

WAS

UE4 uses Equirectangular projection for it's skysphere, which ise just a standard equirectangular projection. A standard equirectangular projection is a 1:2 aspect ratio. So a 1000 pixel width map should be 500 pixels in height. You basically want to put the image map into spherical mode, which expects an equirectangular projection based texture. Then you want the location of the image map to be the same as the background sphere. Then it should align up right. You can then use a transform input shader on the image map to apply rotations if you need.

noahding1

Quote from: WAS on December 09, 2021, 11:23:53 PMUE4 uses Equirectangular projection for it's skysphere, which ise just a standard equirectangular projection. A standard equirectangular projection is a 1:2 aspect ratio. So a 1000 pixel width map should be 500 pixels in height. You basically want to put the image map into spherical mode, which expects an equirectangular projection based texture. Then you want the location of the image map to be the same as the background sphere. Then it should align up right. You can then use a transform input shader on the image map to apply rotations if you need.
Ok thanks, but WHAT I want is the alignment of UE4's skyball in TG 3D preview mode

sboerner

Just do as WAS says -- add a transform input shader between the image map and the default shader, then adjust the Y axis to rotate the image on the background sphere.

If you can export the skysphere out of UE4 as an image (exr or radiance works best), then you should be set. (Proportions should be 1:2 as WAS mentioned.) See attached tgd file for an example. Note that you must have one of the following buttons selected to view the background in the 3D preview: Shaders, Water, Atmosphere, Lighting, or Renderers. (The background will not appear if you have RTP selected.)

If I might ask, what are you trying to accomplish here? For what it's worth, Terragen excels at creating atmospheric effects and skyscapes. That's one of the things it's designed to do. Most people would use TG to create skyboxes to be used in other applications, games, and animations. Not the other way around.

You can probably create the skybox you need right in the Terragen itself. If you are new to the program, please take some time to acquaint yourself with it. The wiki is packed with useful information, and there are plenty of good video tutorials (https://planetside.co.uk/terragen-terratuts-tutorials/). And don't hesitate to ask questions here on the forum. (And post renderings when you start to work on projects.)