Planetside Software Forums

General => Image Sharing => Topic started by: KlausK on December 08, 2017, 06:39:18 PM

Title: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 08, 2017, 06:39:18 PM
So...
since that theme comes up every now and then I had a go with the Spotlight and the Light Source objects in TG myself (again).
Main goal is to keep the render time as low as possible yet have a more or less decent visible light.
This 1920x1280px took about 17min with Micropoly Detail at 1, AA at 8, Atmo Quality samples at 32.
A little bit of Cloud Layer v2 involved (Quality for clouds at 1).
Cheers, Klaus

ps: xoio winterpeople and hummer-3 from DMI Free 3D Models site.
pps: btw, what an awesome lot of high quality work posted in the last few days/weeks by many of you guys. Great stuff! A pleasure to look at.  ::)
Title: Re: Spot on! Light objects - my go at visible lights
Post by: luvsmuzik on December 08, 2017, 08:31:29 PM
Nice one! :)
Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 09, 2017, 12:07:55 AM
I like the render time there, gonna take a run at your set up...great testing.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 09, 2017, 01:50:31 AM
That's really good in terms of haze quality and render time, Klaus! Can you explain the blurry dots in the sky? They look like snow, and if so, it looks really good as snow. Procedural?
Title: Re: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 09, 2017, 08:06:24 AM
Thanks everyone!

First off @ Dune: the "snowflakes" are merely a lucky accident  :-[
This is only a background picture projected through camera.
It is a free to use Deep Sky picture of a constellation called Little Dipper. Here is a link:
http://www.deepskycolors.com/archive/2011/05/12/little-Dipper.html
Why it turned out the way it did surely has to do with my incompetence putting it in the background over the atmosphere correctly.

Ok, here is a little illustrated "How to" about the visible beam of light...

Important notice to start with:

- all single pictures in the 'contact sheet' are rendered at 1280x720px.
- AA is always 8
- Micropoly is always 1

So the stages are really comparable. There are some notes in the pictures as well.

When you start out with one spotlight and maybe one cloud layer you have to crank up the quality settings for them
to a degree which is simply not tolerable in terms of render time. Especially when you only want a rather quick result.
If you are going for a 'Masterpiece' then render time is less important, I guess.

So, I noticed that because of the jittering of the samples every frame looks slightly different.
The white dots move around and leave gaps. The graininess I want to get rid off.

The idea is to fill the spaces more and more. Not with higher sampling values but with more graininess.
Add more spotlights on top of each other with different settings the Aperture width, the Falloff power,
for the Inner and Outer Cone Angles, Max Distance, Strength - you name it.
I also separated the lights between surface and atmosphere. What they lit and where they cast shadows.

In the pictures I rendered no spotlight actually added to the initial render time!
I started out with 4m30s and 1 spot, and after adding the next 5 lights render time still was 4m30s!
Adding the Cloud Layer added 2 minutes render time in the examples. Which is ok, I think for the effect it has.
Btw, when using the Cloud Layer the render times vary greatly depending on the Camera position I found.

Since we cannot group or parent anything in TG (hint hint ::)) using this technique is mostly helpful with still images.
Because placing the spots is a tedious work. But the rather low render time it yields is worth the effort for me.

This is the result after a few hours of trial and error. I think, this technique can be enhanced more. Use more spots e.g.

Hope that is useful (and I mentioned everything ?_?).
Cheers, Klaus



Title: Re: Spot on! Light objects - my go at visible lights
Post by: SILENCER on December 09, 2017, 11:33:54 AM
Nice spearheading on the V Light research.
And yes, just what I was thinking...another argument for parenting/grouping.
And maybe even instancing of those parented hierarchies.
And Alembic deformation as well would be a huge win.

Looks great. Might have to take a stab at the close encounters Devil's Tower shot.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 09, 2017, 04:13:04 PM
Well after a few hours(mostly render time)I've figured out one needs your system to produce renders in that time. mine on this AMD average 4x longer than yours and way more than I was getting for my purposes. You know, it'd be really nice if they fixed that shader as it shouldn't be beyond reach as I was getting that smoothness in pre 2000 Imagine3D renders with almost default settings. maybe your experiments will add to the knowledge base for spotlights and trigger an inspiration...I am an optimist.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 10, 2017, 03:02:23 AM
Thanks for your explanation, Klaus. 
Title: Re: Spot on! Light objects - my go at visible lights
Post by: luvsmuzik on December 10, 2017, 08:09:41 AM
Very interesting...thanks! I was about to make a translucent luminous cone object and call it a day.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 11, 2017, 02:54:34 PM
This is very impressive but I'm afraid I'm not following you. :-[ Do you think you could make a tutorial out of this?
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Kadri on December 11, 2017, 03:12:59 PM

Looks good. The use of more then 1 spotlights is nice :)

Klaus have you tried to use render layers? In case you haven't this is a fast and easy method too.

Make a new group and put the spotlight in there.
Then make a render layer node and go to the "Lights" tab and choose your newly made group with the spotlight in it.
You can render your spotlight with surface lighting or atmo lighting separately if you like (the atmo is the most grainy looking part mostly).
Then render only the lighting with the render layer node attached to the render node.
Blur this noisy render the way you want in post.

After this de-attach the render layer and render the full scene only with the ground lighting of the spotlight or without the spotlight however you choose (only surface lighting and-or atmo lighting) before.

Now just comp those two renders together in a photo editor you use.

This is very useful for animation but even on a single image you can get much more control on the spotlight strength and colour for example without rerendering the scene.

Below are crude examples from the default scene , with an added spotlight that is blurred in post (the atmo lighting part) and the original full Terragen render. Another example is with the same spotlight part blurred and duplicated 5 times in post.
I added this basic scene below too.

There are much more possibilities probably within the render layers node.

Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 11, 2017, 04:37:36 PM
@ Kadri...very nice results...noted for future possible use
Title: Re: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 11, 2017, 05:56:06 PM
@N-drju: can you be a little bit more specific about what it is you cannot follow? (perhaps this is something for Twitch TV  ::))

@Kadri: I haven`t used Render Layers very often so far and not at all in the way you show. Gonna try that too. Thx for your example.
What I have done instead was rendering different frames of the project with all the same setting for that 1 or 2 spotlights
and combined those in post. This works as well because of the sample jittering in the different frames.
Here I was after a solution to not use post effect outside of Terragen.

On the other hand since Blackmagic Design gives away Fusion for free I actually might be doing this sort of light effect
completely outside of Terragen - if it was a bigger scene with lots of different light cones. And I would surely try to get it done
in post when it comes to animation in Terragen.
Cheers, Klaus
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 12, 2017, 02:27:21 PM
Well, well... I tried to reproduce your "stack of lights" solution for creating "god rays" and it was successful too! It works the same way - the more suns you have in a scene, the smoother the rays and shadows will be. Here are my attempts:

[attach=1]

So it indeed looks great. You just need to remember that you have to divide the sunlight power between all sun objects or you'll end up with ever brightening light source (that's why the third image turned out a bit overexposed ;)).

Unfortunately, each added sunlight also adds render time. I don't know why. :-[ In your examples you said that all renders took exactly the same amount of time to complete. I couldn't accomplish it (yet). But maybe what works for the spotlights, does not necessarily have to work for the sunlight(s)?

Anyway, sunlight divided by four gives quite a decent effect and it's well worth the time if you ask me. Your idea is a good solution for the god ray sharpness as well, which also tends to be one of the most problematic features that we struggle against.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: luvsmuzik on December 12, 2017, 03:24:03 PM
Now there is an idea! What did that do to your bluesky color? This will be something fun to try! Thanks for sharing N-drju!
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 12, 2017, 04:15:46 PM
Well, I'm not entirely proud of it, because, as I said, the render time increased considerably with quadrupled sun. :-\ Completely different behavior from what Klaus achieved.

I think there is no significant change in the bluesky, because the light is simply equally shared between all light sources. :)

For example, if your planned light strength is 4.5 and you want to get smoother god rays, all you need to do is to create, say, five suns with light strength 0.9 each. The overall brightness effect will equal your planned 4.5, but the shadow / light ray sharpness will gain. :)

Hm, for now however, I can't seem to reproduce Klaus' achievement of having same render time for increasing number of light sources.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Oshyan on December 12, 2017, 06:04:05 PM
The light beam rendering quality issue is pretty specific to localized light sources, particularly the spotlight. While you can get noise in "godrays", it is almost always easily solved by increasing atmosphere samples a bit, especially when Defer Atmo is enabled. So I don't think it's really useful to use the multi-light workaround for that situation.

- Oshyan
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 13, 2017, 03:01:52 AM
Hmmm, sorry Oshyan but I'm not really sure if it works. Just this weekend I finished rendering a scene with a sun peaking over the mountain, casting a simple shadow down the valley. Atmosphere samples were set at 62 with haze at 0.82 and the edge of the shadow was grainy nonetheless. ::) Sure, it was better than the test value of 14 but still not quite there...

Maybe combining samples, deferred atmosphere and duplicated sunlight can yield better result.

I am still waiting on Klaus' comment though. The idea with spotlights seems like something one would invent early on in TG. But most of us don't really have time to just experiment. So we create things and only then try to solve problems on the go. I'm glad he discovered it!
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 13, 2017, 03:04:48 AM
Oh, I should probably also mention that turning off the soft shadows in the duplicated sunlights reduced render time by about 28% but also slightly increased graininess. I have yet to see how it affects object shadows...
Title: Re: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 13, 2017, 07:29:35 AM
Hi N-drju
"... the render time increased considerably with quadrupled sun. :-\ Completely different behavior from what Klaus achieved."
"But maybe what works for the spotlights, does not necessarily have to work for the sunlight(s)?"

I think that might be the case.
I do not know how TG calculates the Lightsource objects compared to the Sun Light Object but I can imagine that it is because
of the vastly different dimension in terms of which factors (other scene relevant calculations) are influenced by the light
makes a significant difference in render time. The spotlights on the other hand cover only such a small percentage of scene overall
- perhaps to small to add to rendertime even with multiple sources. Perhaps a programmers insight could shed some light on this?

And remember that the non-increasing render time thing was only true as long as the spotlights only lit "Atmosphere and Clouds",
had "Glow in Atmosphere" turned on and "Cast shadows" turned off. As soon as I introduced the Cloud Layer render time went up.

Your example looks really good from top to bottom.
Even if render time adds up with each added sun light the question would be how these render times compare to the common 1 sun approach.
I doubt you would achieve such a good result just by increasing samples or Quality settings alone. Btw. even carefully placed spotlights in the sky
can help to produce sharper god rays.
Cheers, Klaus

ps: the technique of stacking spotlights is something that stems from the days when Global Illumination was not part of a 3D program.
So, I merely adapted the idea to my TG workflow. It is nice that it worked out so well in this case.


Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 13, 2017, 02:39:02 PM
If you like the previous set Klaus, I guess you should see this. The third image that combines all quality augmenters and tweaks speaks VOLUMES. A great, great set of variables for final renders (obviously too heavy for testing).

[attach=1]

The third image is incomplete, because I did it at my sister's and had limited time window. ;)

So let's break it down a bit... I believe that, in case of sunlight, if you want very detailed and impressive results a combination of factors will do wonders. However, be ready for a quite heavy render time. The third image took more than two hours to complete... But the result... wow. Note that the number of atmo samples is also much lower than in an image using only single sun!

I also admit that Oshyan was right that increasing number of atmo samples and deferring atmosphere may improve the quality of god rays, as the second image shows. This method is a tad less effective than sun duplication but the difference is not that great. Hence, increasing samples plus checking the deffer atmo parameter should be good for most uses. While experimenting, I also found out that increased number of atmosphere samples does not influence the render time as much as I feared it does. I rendered several tests ranging from 32 samples to even 112 and the time difference was quite acceptable in fact. :)

To summarize - just as with your spotlights Klaus, god ray shadows will also gain if cast by multiple suns. The combination of factors in the third image will yield FANTASTIC sharpness and final result but should perhaps be used as a very final render. I.e. after you are happy with the placement and direction of light, clouds and whatnot.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 13, 2017, 06:37:56 PM
I have a file I use often from chornor, RIP, that uses 128 atmo samples and the scene renders as swiftly as most of mine do(well as fast as my computer will do), that's often a consideration as well.

and looking at your images I notice AA3...well for finals I often use 6 and sometimes 8 when there's detailed atmo involved.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 14, 2017, 01:48:10 AM
Quote from: bobbystahr on December 13, 2017, 06:37:56 PM
and looking at your images I notice AA3...well for finals I often use 6 and sometimes 8 when there's detailed atmo involved.

Yes, that's the point - if it looks THAT good with this AA value and with this small resolution, imagine how these options would play out with "final" values!

I guess the lightsource object is what remains to be explored now, once spotlight and sun are covered. :)
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 14, 2017, 02:35:10 AM
Interesting. It would be easiest if TG could mix/jitter the sample jitter of one sun in maybe a few slightly different computations of the light, but I guess that would increase render time the same way.
So, how much does in influence render time, is that a few percents (I guess so)?
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 14, 2017, 04:41:17 AM
Which feature do you mean Ulco?

More atmo samples renders faster than duplicated sun influence if that's what you ask. With the latter solution being slightly better in quality terms though.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 14, 2017, 11:48:07 AM
It's not a feature, just a wish, an idea that came up. May not be feasible or practic at all.

Thanks, yes, slower is usually better quality. Lets invert that!  :P
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Oshyan on December 15, 2017, 12:06:40 AM
The increase of atmo samples probably has such little effect because the max samples per pixel is *limited* by your AA (with Defer Atmo enabled). So with AA at only 3, you are basically just making everything take max samples *for the chosen AA level* by increasing atmo samples so high. It does not mean 128 actual samples will be taken. The same is not true when Defer Atmo is of - in that case you are directly influencing number of atmo samples with that setting.

So I would suggest, rather than increase atmo samples beyond, say, 16 or 24, instead increase AA to just 4 and see what happens. In theory your multiple suns solution should not (I think) ever be more effective than just using "ideal"/best sampling settings with a single sun. I think you just are not using optimal settings. If you send me scene files to test I can probably suggest something better... Ultimately our goal is to never have to use such "hacks" just to get good quality, and as far as I know we already do not have to (although there are always difficult cases that take longer to render).

- Oshyan
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 15, 2017, 01:54:51 AM
Quote from: Dune on December 14, 2017, 02:35:10 AM
So, how much does in influence render time, is that a few percents (I guess so)?

@ Dune - I meant this question.

@ Oshyan - I'm sorry but I'm just not buying it... Whenever I increase the atmosphere sampling the result is better even at the same AA level... A fact. :-\

I consider Klaus' idea with spotlights and this analogical one with sunlight to be more effective than the "standard" solution. Actually I also like some workarounds much better than standard ideas. I consider them to be "that extra effort", finishing touch if you will, that makes render perfect.

For example, I still prefer to use ancient dandelO's solution for creating cloud masses, because localized cloud shading and lighting is complete nonsense to me. I don't get quite as much problems using this solution compared to the "standard" way...

Also, I have no need to send any files because I do not have a problem with that. ??? And I guess I'm ready to wait one hour longer for the final. No biggie.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 15, 2017, 02:32:39 AM
Ah; I meant having 2 or 4 suns instead of one. But it's not important, so never mind.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: N-drju on December 15, 2017, 08:24:59 AM
I don't remember the numbers actually, but each sun adds about 50% to the render time unfortunately. :-\ This sucks, I know. But I still think I will use it for finals. As a point in case, consult the image below. My last one (for now) as far as this discussion is concerned and not half bad if I may say so myself:

[attach=1]

Atmo samples = 256 (!)
Sunlights = 2 (1.8 each)

Detail = 0.55
AA = 3
Defer atmo = on

GI cache det. = 2.75
GI sample q. = 2.75
+ supersample prepass

_______________________________________________________

@ KlausK - Klaus, sorry for hijacking your thread like this, but I find your solution very insightful (as you can obviously see.) The look of your light beams is really nice to look at, so it just gives a nice, good kick to pursue for the same in sunlight objects.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 15, 2017, 10:52:00 AM
No problem for me as such.
The problem is that your findings are now burried in this thread.
Maybe you should open a new thread like "God rays with multiple sun lights and put also a link to this thread in there?
That would surely help to let people notice your technique more directly. On the other hand I named my thread rather unspecific.
So if someone tries to find information about "visible lights" this thread surely will show up.
Hm, whatever...hehehe
CHeers, Klaus
Title: Re: Spot on! Light objects - my go at visible lights
Post by: luvsmuzik on December 15, 2017, 11:35:42 AM
I know it is a tedious job and hindsight is always 20/20....but it would be nice if the various libraries from File Sharing had directories as well, so that topics could be made separately there. Searches often yield the result we want, but few fail to look at the source beyond immediate result I fear. Not a case of, "some people are never happy", just a thought. :)
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Dune on December 16, 2017, 03:32:55 AM
50% is quite much, indeed. Didn't expect that. But AA3 is very low, even for defer atmo. With AA 6-8, and one sun, you might get faster, better results, I don't know.
Title: Re: Spot on! Light objects - my go at visible lights
Post by: Oshyan on December 16, 2017, 02:46:05 PM
It's fine to disagree, but we can only know the truth if you share your scene files so others can replicate your tests, as well as try alternate methods of optimization. :)

- Oshyan
Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 17, 2017, 11:38:58 AM
Quote from: Oshyan on December 16, 2017, 02:46:05 PM
It's fine to disagree, but we can only know the truth if you share your scene files so others can replicate your tests, as well as try alternate methods of optimization. :)

- Oshyan

Hear! Hear!
Title: Re: Spot on! Light objects - my go at visible lights
Post by: KlausK on December 22, 2017, 08:14:14 PM
hi, this is done with the help of spotlights and low sample settings mainly.
Lensflare in Photoshop, Santa on sleigh with reindeer is a free model from something like "artist3d.com".
I forgot. Too long ago that I downloaded this.
Anyways, Merry Christmas everybody (or whatever these upcoming days are called in your neighborhood ;))
See ya all next year!
Cheers, Klaus
Title: Re: Spot on! Light objects - my go at visible lights
Post by: bobbystahr on December 29, 2017, 07:02:49 PM
Good one Klaus and a belated Merry Christmas to you...and a Happy Newt's Ear heh heh heh
Title: Re: Spot on! Light objects - my go at visible lights
Post by: luvsmuzik on December 29, 2017, 08:58:29 PM
Awww I missed this one! Between welcome visitors and cooking for an early Christmas......
Very very nice. :)
Title: Re: Spot on! Light objects - my go at visible lights
Post by: icarus51 on January 09, 2018, 11:07:30 PM
Quote from: KlausK on December 09, 2017, 08:06:24 AM
Thanks everyone!

First off @ Dune: the "snowflakes" are merely a lucky accident  :-[
This is only a background picture projected through camera.
It is a free to use Deep Sky picture of a constellation called Little Dipper. Here is a link:
http://www.deepskycolors.com/archive/2011/05/12/little-Dipper.html
Why it turned out the way it did surely has to do with my incompetence putting it in the background over the atmosphere correctly.

Ok, here is a little illustrated "How to" about the visible beam of light...

Important notice to start with:

- all single pictures in the 'contact sheet' are rendered at 1280x720px.
- AA is always 8
- Micropoly is always 1

So the stages are really comparable. There are some notes in the pictures as well.

When you start out with one spotlight and maybe one cloud layer you have to crank up the quality settings for them
to a degree which is simply not tolerable in terms of render time. Especially when you only want a rather quick result.
If you are going for a 'Masterpiece' then render time is less important, I guess.

So, I noticed that because of the jittering of the samples every frame looks slightly different.
The white dots move around and leave gaps. The graininess I want to get rid off.

The idea is to fill the spaces more and more. Not with higher sampling values but with more graininess.
Add more spotlights on top of each other with different settings the Aperture width, the Falloff power,
for the Inner and Outer Cone Angles, Max Distance, Strength - you name it.
I also separated the lights between surface and atmosphere. What they lit and where they cast shadows.

In the pictures I rendered no spotlight actually added to the initial render time!
I started out with 4m30s and 1 spot, and after adding the next 5 lights render time still was 4m30s!
Adding the Cloud Layer added 2 minutes render time in the examples. Which is ok, I think for the effect it has.
Btw, when using the Cloud Layer the render times vary greatly depending on the Camera position I found.

Since we cannot group or parent anything in TG (hint hint ::)) using this technique is mostly helpful with still images.
Because placing the spots is a tedious work. But the rather low render time it yields is worth the effort for me.

This is the result after a few hours of trial and error. I think, this technique can be enhanced more. Use more spots e.g.

Hope that is useful (and I mentioned everything ?_?).
Cheers, Klaus

Hi Klaus.
Beautiful, this is the issue that got me crazy for months. :'( .And now i see this! Incredible idea, the only solution that i didn't imagine.
Many Thanks, and i will try your method.