Night Time

Started by simonoc, March 05, 2014, 01:24:44 PM

Previous topic - Next topic

simonoc

I used the original Terragen program many years ago to create skyboxes for games and I have recently downloaded the latest version 3 and wow it feels like I have stepped into the space shuttle, there is a crazy amount of buttons and menu options to play with! :)

For some reason whenever I look for Terragen 3 tutorials, everything seems to point to Terragen 2, are they similar? Is Terragen 3 so new that there is hardly any tutorials for it? Even the Terragen wiki lists version 2 tutorials?

One thing I have always wanted to do with Terragen is night time skies, I want wispy clouds, a background of stars and a large moon glowing in the sky.

My first problem is trying to create a background of stars. Under the object menu, background object, surface shaders, I create new shader, colour shader, image map shader and finally get to pick my star map. (Wow that is a lot of menu options) Now I assume this is the background image for the whole scene regardless of what direction I look. If I disable the atmosphere I get a black background and no stars. So how does it work? I have the object at 0,0,0 center and when I play with the radius and scale, nothing changes. I tried moving the object around and still get no background image, what type of background image is the default? Ideally I want a sphere with the star map on the inside so it looks different from several angles.

My second problem is trying to create a moon that behaves like the sun and sits in the sky with the relevant elevation and heading. There does not seem to be anyway to substitute an image for the sun. Originally when i created moon lit landscape in Terragen (v1) I rendered a sun and then I added a moon image on top of the final renders. This latest version must have an easier way to create a moon as the primary light source in the sky?

Does Terragen 3 have any macro function to render out a full skybox (6 images)?

If anyone can spare some time to help, I would much appreciate. Thanks
Well he was evil, but he did build a lot of roads. - Gogglor

Kadri

#1
Hi and welcome to the forum.

http://www.planetside.co.uk/forums/index.php/topic,4391.0.html
It is a procedural background


Have you tried to disabling the "Background shader" or bypassing it?
Choose the Projection type "sphere" in the "image map shader" first if you haven't already.

Edit : http://www.planetside.co.uk/forums/index.php/topic,8995.msg96122.html#msg96122

N-drju

If you want a night sky sprinkled with stars I would simply suggest 'procedural night sky' shader by dandelO. It is a clip file that can be used as background. I didn't use that much though. :P When I did however I was happy with results. It can also be used for some orbital shots as well. Good thing about it is that you can tweak the density of each 'star' color as you want.

As far as moon is concerned I'll be working on that soon and I'm (quite literally) in the dark too. :P I would just like to create a planet in the sky but unfortunately it seems there is no possibility to make a light shine through it. A planet object located in front of the sunlight will just cast enormous shadow on the surface and no moonlight at all. I think I might be using simple sphere object to imitate the moon because it can at least be set not to cast shadow! This way I can kill two birds with one stone - the "moon" will be visible on the sky and pass some light too.

Oh, and welcome to Planetside Forums! :D
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

simonoc

@Kadri, thanks that is very cool, but I really want to have a specific background image. I can't get a background image to display on the background object (sphere). I see from the example file you linked that Terragen is using a UDK style shader language. Is there any reference manual/documentation for all the objects/shader commands? I can certainly create different objects but I have got no idea how any of them link together, I just feel like I am stumbling around in the dark! (literally) :)

@N-drju, thanks for the help. I downloaded dandelO file and could not get it to work, luckily the one by moodflow works perfectly. I have tried using a sphere and card object with a moon texture and positioning it infront of the sun but the texture won't show for some reason. The learning curve on this package is like Mount Everest!
Well he was evil, but he did build a lot of roads. - Gogglor

yossam

#4
Try this.............


http://www.terragen.org/index.php?action=tpmod;dl=item486


dandelOs' clip has a small extra step to it. Right click on the node and select internal network. Highlight the node by clicking on the bar at the top. After highlighting type "d" without the quotation marks. Voila.............night and stars.  ;D

Kadri

#5

If you haven't any specific thing in your mind there is no need to use another sphere for a background image.
Go in the Background node that is by default there and made the changes i wrote in my first post.

Basically all you have to do is using an image map shader in the background node and disabling the Background shader that is in that Background node.

If you don't know what i am talking about click on the  +  part on the right side of that Background node .
Edit: Or use the method Yossam just wrote above  "Right click on the node and select internal network."
What you will see is the inside of the background node and that is the place i am talking about where you should put the image map shader.

http://www.planetside.co.uk/forums/index.php/board,6.0.html

http://planetside.co.uk/wiki/index.php?title=Main_Page


jo

Hi,

To answer your question about TG2 and TG3, they are very similar. TG3 has a lot of new features but it's essentially an evolution of TG2 and not a whole new application. The user interface is basically the same. TG2 tutorials should apply pretty well to TG3.

Regards,

Jo

simonoc

Quote from: Kadri on March 05, 2014, 03:52:04 PMBasically all you have to do is using an image map shader in the background node and disabling the Background shader that is in that Background node.

If you don't know what i am talking about click on the  +  part on the right side of that Background node .
Edit: Or use the method Yossam just wrote above  "Right click on the node and select internal network."
What you will see is the inside of the background node and that is the place i am talking about where you should put the image map shader.

I start up Terragen 3 from scratch, open the object menu, double click on the background object, double click on the 'background shader' which opens up a new window showing the shader linked to the bottom of the window. I right click in this window, create shader, colour shader, Image map shader, select texture I want as background. Link the new shader to the bottom of the window, tweak the camera/render size and click on the render window and get a default sky/terrain and no change to the background. What I am missing?



@yossam, I have been trying to connect to that site all day and constantly get time out messages. After 3-4 attempts I got link to a moon object and it says 10hrs to download.  :-\ Is there something wrong with the site today?

Well he was evil, but he did build a lot of roads. - Gogglor

yossam

I just got the link from the site and did not have any problems. Strange..........if you keep having problems let me know. I've got one I made a long time ago on an old hard drive (if I can find it).

Kadri


Look at my first post:

"Choose the Projection type "sphere" in the "image map shader" first if you haven't already."

Matt

The background needs to be made luminous. You can do this with a Default Shader, with the Image Map Shader connected to its luminosity function. I've setup an example for you. Copy the code below and paste it directly into the network view (where you see the red shader nodes that you were working with before), then connect the Default Shader instead of the existing shaders.

You will need to point the Image Map Shader to your image file, of course. Or you may be able to connect the Image Map Shader you already created to the Default Shader.


<terragen_clip>
<default_shader
name = "Default shader 01"
gui_use_node_pos = "1"
gui_node_pos = "-2020 920 0"
gui_group = ""
enable = "1"
input_node = ""
gui_use_preview_patch_size = "0"
gui_preview_patch_size = "1000 1000"
diffuse_colour = "0 0 0"
colour_image = ""
colour_function = ""
translucency = "0 0 0"
translucency_image = ""
translucency_function = ""
luminosity = "1 1 1"
luminosity_image = ""
luminosity_function = "Image map shader 01"
reflectivity = "0 0 0"
reflectivity_image = ""
reflectivity_function = ""
reflection_tint = "1 1 1"
index_of_refraction = "1.5"
specular_roughness = "0.2"
specular_roughness_image = ""
invert_specular_roughness_image = "0"
specular_roughness_function = ""
displacement_direction = "1"
displacement_multiplier = "0.01"
displacement_image = ""
displacement_function = ""
displacement_offset = "0"
opacity = "1 1 1"
opacity_image = ""
use_alpha_channel = "0"
invert_opacity_image = "0"
opacity_function = ""
alpha_from_colour = "0"
alpha_key = "0 0 0"
key_tolerance = "0.1"
image_projection = "4"
projection_camera = ""
unpremultiply_colour = "1"
unpremultiply_translucency = "0"
unpremultiply_luminosity = "0"
unpremultiply_reflectivity = "0"
unpremultiply_specular_roughness = "0"
>
</default_shader>
<image_map_shader
name = "Image map shader 01"
gui_use_node_pos = "1"
gui_node_pos = "-1960 1020 0"
gui_group = ""
enable = "1"
input_node = ""
gui_use_preview_patch_size = "0"
gui_preview_patch_size = "1000 1000"
image_filename = ""
projection_type = "3"
projection_camera = ""
position_center = "0"
position_lower_left = "1"
position = "0 0 0"
size = "1 1"
lock_size_to_image_aspect_ratio = "1"
flip_x = "0"
flip_y = "0"
repeat_x = "0"
repeat_y = "0"
apply_colour = "1"
smooth_interpolation = "1"
unpremultiply = "1"
convert_to_linear = "1"
data_is_linear = "0"
conversion_gamma = "2.2"
multiply_RGB = "0"
RGB_multiplier = "1 1 1"
offset_RGB = "0"
RGB_offset_value = "0 0 0"
apply_displacement = "0"
displacement_amplitude = "1"
displacement_offset = "0"
smooth_disp_interpolation = "1"
convert_disp_to_linear = "0"
disp_data_is_linear = "1"
disp_conversion_gamma = "2.2"
has_disp_param_bug = "0"
alpha_as_opacity = "0"
alpha_as_colour = "0"
create_transparency = "0"
transparency_key = "0 0 0"
key_tolerance = "0.1"
invert_alpha = "0"
use_alpha_directly = "0"
translucent = "0"
translucency_amount = "1"
translucency_tint = "1 1 1"
border_blending = "0"
blend_by_shader = "0"
blending_shader = ""
fit_blendshader_to_this = "1"
invert_blendshader = "0"
>
</image_map_shader>
</terragen_clip>


Matt
Just because milk is white doesn't mean that clouds are made of milk.

simonoc

Quote from: Kadri on March 05, 2014, 05:01:52 PMLook at my first post:
"Choose the Projection type "sphere" in the "image map shader" first if you haven't already."

Unfortunately it did not make any difference, in the end I switched to a different shader, "Default Shader" and it worked straight away. I am not sure what is wrong with Image Map Shader in Terragen v3.0 but it is not working as you say it is.



After much tweaking with sun values, cloud layers and a moon image on a card object I finally got the first stage of my night skybox sorted. I still need to setup a nice chunk of terrain because I am just using the default terrain fractal setup. Thanks everyone for all your help, at least now I have a better understanding of the process and can now start creating some different projects.

@Matt, thank you, I will test that tomorrow on a new skybox.
Well he was evil, but he did build a lot of roads. - Gogglor

Kadri

#12

I tested it ones more and i think it worked for me because my sun was at " Heading 180 ".
The background image saw the sunlight directly (?).
The best approach is of course what Matt said.

The image looks nice by the way :)

Markal

I don't know if this will help you or not but....I also use Moodflows starfield background in most of my images. The attached clip file is how I attach a background image map, such as a hubble image. Attaching it to all three inputs of the dust breakup, amount and color seems to add more detail in the map. If you attach the image map to just the color it also works well. When you double click the image map you can go to color and adjust the conversion gamma....lower numbers are brighter and higher numbers are darker. You have to play with the settings for how much image map and how much starfield background you want. Check out my space art images....almost all of them use this technique.... Hope this helps!
Mark

simonoc

If I had known that Terragen 3 was a visual (node) shader language it would have been easier to understand at the beginning. Really nice interface, reminds me of UDK and Cryengine scripting languages with the visual nodes and connections. I still not sure what the function nodes do, they have no parameters, which is very odd because I wanted to use them like programing variables to inject into other nodes.

I really wish there was an easy way to see what each parameters does, at the moment it just feels like guess work.

My night time sky progress so far ...
Well he was evil, but he did build a lot of roads. - Gogglor