Planetside Software Forums

General => Terragen Discussion => Topic started by: PabloMack on August 03, 2010, 04:45:16 PM

Title: Filling space with stars
Post by: PabloMack on August 03, 2010, 04:45:16 PM
Hi All,

Is there a way to fill the surrounding space with stars using some sort of shader? I am not simply wanting a mere static background 2D image to produce a "star field".  This will be animated so that the stars need to stay in their relative respective places when the camera is rotated and moved around.  

Thanks
Title: Re: Filling space with stars
Post by: Sengin on August 04, 2010, 12:19:07 AM
You might be able to create a bunch of lights and stick them far away and pretty bright.  It sounds tedious though.  Perhaps you could use a function node network for a distribution of lights, either as an object imported or light object created within TG2 (maybe a "proof of concept" would be to create a grid of evenly spaced stars or objects so that an object or star gets put every x units and every y units.  After you get that working, work on randomizing the locations with a noise shader/function node so they won't be evenly spaced).
Title: Re: Filling space with stars
Post by: PabloMack on August 04, 2010, 10:36:06 AM
I think this is the best idea.  I created some stars as "Sunlight" with visible disks that are small.  I think this will work well.  Thanks.
Title: Star completely disappears at diameter 0.01
Post by: PabloMack on August 04, 2010, 11:43:07 AM
I have created a star from "Sunlight" with visible disk turned on.  Problem is, the default is too large to be believable as a star and the star completely and suddenly disappears going from 0.011 to 0.01 in diameter.  Even 0.011 is too large to be believable as a star but it totally vanishes if I make it any smaller than that.  Anyone know what can be done about this? I boosted the Detail on render from 0.5 to 0.6 but it did nothing.
Title: Re: Filling space with stars
Post by: cyphyr on August 04, 2010, 11:47:37 AM
If you use a sufficiently large spherical map or even a smaller Camera projected map (just dont use your render camera)  on to your "background sphere" the stars should stay put. You will need to use a large image though, something in the order of 10,000 px across at least!!
:)
Richard

This  (http://forums.planetside.co.uk/index.php?topic=10447.0), posted by BigBen, may help but I guess you've seen it already :)
Title: Re: Star completely disappears at diameter 0.01
Post by: Sengin on August 05, 2010, 02:22:14 PM
Quote from: PabloMack on August 04, 2010, 11:43:07 AMEven 0.011 is too large to be believable as a star but it totally vanishes if I make it any smaller than that.  Anyone know what can be done about this? I boosted the Detail on render from 0.5 to 0.6 but it did nothing.

Try increasing the brightness/strength of each of the lights, that should allow it to be seen from a further distance.
Title: Re: Filling space with stars
Post by: bigben on August 08, 2010, 06:04:28 AM
Also check: Procedural Night Sky - v.2 http://forums.planetside.co.uk/index.php?topic=8995.msg96122 (http://forums.planetside.co.uk/index.php?topic=8995.msg96122)
Title: Re: Filling space with stars
Post by: PabloMack on August 09, 2010, 01:05:29 PM
Interesting.  Where do I plug the output of this node? I have imported the "Clip" and a Background Node shows up with an output and no input.  But I see no stars when I render.  The panel that comes up when I double click the Node looks deceptively simple. Is there a way to control the density of stars? 
Title: Re: Filling space with stars
Post by: bigben on August 10, 2010, 07:32:30 AM
Had a quick play. When I imported the clip all of the nodes in the background's internal network were disabled.  Just enable them all.  From there you  can see there are power fractals nodes called stars. tweaking the settings for these s hould change the density of stars.
Title: Re: Filling space with stars
Post by: dandelO on August 14, 2010, 12:42:44 PM
I should say also, delete, or just disable, the original BG node.
The default settings of my BG node are for 'day'. The simplest way to enable night-mode is to use the new group button in your node network called 'Background - Night/day'. That'll take you straight there. Just highlight the entire group inside by left clicking it, then hit key 'D'. That will disable day mode and enable night mode in one move.

The coverage of the stars is increased by using the 'colour offset' values in each 'stars' fractal. They're highly offset negatively at defaults. Increasing these offsets increases the stars.

* It's still only a 2D background, though. Not plotted stars in 3D space. You could try a scaled down scene, using populations of TG2 'rock' objects on an invisible planet node. Uncheck 'render surface' in this planet to make it invisible. I might have a go at this...
Title: Re: Filling space with stars
Post by: PabloMack on August 16, 2010, 04:15:16 PM
I finally got it to work.  Thank you bigben and dandelO for the help.  It works very well and looks very nice. I think this is the best option when you don't need special star maps.