Planetside Software Forums

General => Terragen Discussion => Topic started by: james adamson on March 02, 2020, 04:43:10 AM

Title: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 04:43:10 AM
Hi all.
I have just rendered a test frame with some alphas. The alphas do not look as expected. The cloud alpha looks fine and the atmos I can use. I would just expect them all to have no colour information.
Any ideas anyone? I have posted stills. Also how would I go about getting a separate alpha for the population?
Cheers.
James.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 05:50:15 AM
That was unhelpful. I have renamed the files incorrectly. The one named surf alpha is the atmos and the atmos is the surface.
Title: Re: Strange alphas from render elements
Post by: Hetzen on March 02, 2020, 09:19:39 AM
Digitalguru put together this very good tutorial on how to render and composite elements here https://www.youtube.com/watch?v=ihY_kp2rzxg&feature=youtu.be

In a nutshell, TG renders these elements into linear colour space. The alphas are 3 channel to allow for light transmission, which you tend to invert and Multiply blend over an image, to then Add blend your other elements on top.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 10:13:15 AM
Hi Hetzen. Thanks for your response. I am comping in Nuke so everything is linear and I have rendered exr's from Terragen so did not expect the alphas to look the way they do and yep that elements guide is the one I followed so I must have missed a trick.
I will take another look at digital gurus guide.
Cheers.
James.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 10:33:03 AM
As the guy said in the thread I have just read. OOPS. I had atmos visible in the render layer so I reckon thats what is giving me strange alphas. And like the previous guy Im gonna blame lack of sleep!
Title: Re: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 02:42:03 PM
Nope, that did not work. It turned atmos off for main render.
Title: Re: Strange alphas from render elements
Post by: digitalguru on March 02, 2020, 03:22:44 PM
Matt posted a very comprehensive post about TG's alphas here:

https://planetside.co.uk/forums/index.php/topic,23724.msg239993.html#msg239993
Title: Re: Strange alphas from render elements
Post by: james adamson on March 02, 2020, 04:25:37 PM
Awesome. Thanks.
Title: Re: Strange alphas from render elements
Post by: Matt on March 03, 2020, 04:30:17 AM
In tgSurfAlpha the sky should be black. Do you have an object in the background or is it just the default background sphere? The background sphere in the default scene uses a Constant Shader, and the Constant Shader has its alpha set to 0. If you replace this with another shader you may have reset its alpha to 1.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 10:38:32 AM
Hi matt. I have a starfield image.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 10:51:08 AM
I have used an image map connected to a default shader. Default shader settings are diffuse o luminsity 2. ( i think its its 2.) 
Where would I change the alpha?
Cheers.
James.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 10:52:33 AM
There is no sphere in the background. Have I deleted it by accident?
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 11:02:04 AM
So I am not sure what to do about the alpha issue there are no obvious inputs or settings on the default shader. Also I will be replacing the background with an updated version of the same image so have unchecked atmos/cloud on background.
Title: Re: Strange alphas from render elements
Post by: Matt on March 03, 2020, 01:16:51 PM
Unchecking "Atmo/cloud on background" will have no effect if the background has an alpha of 1. "Background" means any pixels with 0 alpha. With your image map shader connected to the background, this is now a surface just like any other, and the renderer does not know that it's meant to be the background. It may be possible to set the alpha to 0 by chaining a Constant Shader before the Image Map Shader but I forget whether this works. I'll try it later.

Since you're replacing the background, isn't it better to disable this object/shader anyway?
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 02:40:33 PM
Its a place holder. I am using it for lighting and reflections. So the image map by default creates an alpha whereas before it was just black with a constant colour? How comes the constant does not also create an alpha?
Title: Re: Strange alphas from render elements
Post by: Matt on March 03, 2020, 03:26:30 PM
Quote from: james adamson on March 03, 2020, 02:40:33 PMSo the image map by default creates an alpha whereas before it was just black with a constant colour? How comes the constant does not also create an alpha?

The Constant Shader has a parameter called "alpha" which you can set to 0. It's the only shader that can do this at the moment. The only other way to render an object with 0 alpha is to set its render mode to Holdout (or use a Render Layer to do the same thing), but Holdout also makes the object black so that's not useful here.

QuoteIts a place holder. I am using it for lighting and reflections.

Ah, in that case you could change its render mode to Invisible while keeping "Visible to other rays" enabled for reflections and lighting.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 03:42:06 PM
Wonderfull. And I would set that up in my render layer? And I will now get a proper surface alpha?
Will my render be any quicker?
 I think I know the answer to that one!
Cheers.
James.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 03:51:11 PM
On the almost the same subject how would I get an alpha for my tree population? Do I do the above and this in the render layer node?
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 04:01:29 PM
Group 1 has the background sphere node in it. Will this do what I am after?


render options.pngrender options.png
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 04:02:06 PM
oops uploaded same png twice.
Title: Re: Strange alphas from render elements
Post by: Matt on March 03, 2020, 04:03:27 PM
If you already have an object group set up for the background, yes that will work.

But there's a simpler way. You don't need Render Layers, you can do it in the object itself.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 03, 2020, 04:32:57 PM
There I go again! Complicating things. Like i'ts not complicated enough already.
Thanks Matt.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 04, 2020, 06:27:54 AM
Last post on this honest!
So if I am comping a new sky but I want tgs atmos and I need my tg clouds over the surface and over the background I need to check 
atmos/cloud over background on?

I now have the correct alpha for the surface almost. It still has faint colour in the very far distance but I can isolate and grade that out.

Got my render times down from 135 mins a frame (no noise) to 60 but with some noise that I guess I can deal with layer by layer in the comp.
4 layers v3 clouds at 0.5 march. Voxel scattering 150  AA10  1/64 first samples PNT .02  Atmos AA 16  resolution 960/540 for test.
Final will be 1920/1080.
Title: Re: Strange alphas from render elements
Post by: Matt on March 04, 2020, 01:21:30 PM
Quote from: james adamson on March 04, 2020, 06:27:54 AMSo if I am comping a new sky but I want tgs atmos and I need my tg clouds over the surface and over the background I need to check
atmos/cloud over background on?

If you want clouds and atmosphere to be in the sky, then yes. If you turn this off you'll get a hard line at the edge of the landscape. The only reason TG gives you the option to turn this off is so you can render more than one Terragen layer (e.g. terrain and sky in one layer, trees in another layer) and comp them together without doubling up the atmosphere. You'd turn this option off for the trees layer so that everything that's not a tree is black. But if you only have one Terragen render, you probably want atmosphere to be included.
Title: Re: Strange alphas from render elements
Post by: james adamson on March 04, 2020, 01:57:23 PM
Great. 
Thanks again.