Planetside Software Forums

General => Terragen Discussion => Topic started by: Floating.Point on January 07, 2011, 01:28:04 PM

Title: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Floating.Point on January 07, 2011, 01:28:04 PM
Heya guys,

Just getting my head around all this and would love to know if I'm on the right track.
My wonderful girlfriend bought me 32GB ram for Christmas (who has the best girlfriend in the world!?)

I have a Mac Pro 8-core 2.8ghz, running Windows 7 x64, 32GB Ram  

Am I correct in assuming that:

1)   Each instance of TG2 can use a MAXIMUM of 4GB ram (usually a bit less)?
2)   Maximum threads directly translates to cores (ie. 8 threads = 8 cores)?


Assuming the above is correct, I could for instance:

3)   Set up TG2 to render 8 crop renders using 1 thread (/core) each. (each instance of TG2 will have a total 32GB / 8CORE = 4GB memory)?

     Assuming also that each instance will not actually be able to access the full 4 BG available, it should leave enough memory to keep the OS stable

For a lot of my crop renders, I need to use the "detail in camera" switch (to make sure reflections aren't lost etc.)
How does this affect memory use?

My gut feeling tells me that:

4)   Enabling detail in camera probably requires the same amount of memory regardless of whether it is a crop, or the whole scene?

     (as it needs to calculate everything the camera sees anyway)

The above question might be a bit ambiguous, or perhaps I might be using the wrong terminology- what i hope for is an understanding of how enabling "detail in camera" affects memory use...

5)   because if "detail in camera" needs to calculate the whole scene anyway, perhaps it is not worthwhile doing that calculation 8 times with 8 crop renders.

Anyone's input here would be greatly appreciated :)
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: rcallicotte on January 07, 2011, 01:36:15 PM
I'm not the one to answer, but I will say that your OS is what divides up how RAM is used.  Windows 7 had (has?) memory leak issues, so you need to think about that when doing actual measurements.

http://windows.microsoft.com/en-US/windows7/products/system-requirements


[edit] Just found this - http://msdn.microsoft.com/en-us/library/aa366778%28v=vs.85%29.aspx#physical_memory_limits_windows_7
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Tangled-Universe on January 07, 2011, 03:28:24 PM
0) what a girlfriend ;D
1) correct, in windows I've managed to use 3.5GB at one time...
2) correct, usually cores = threads, unless you have an i7 processor with hyperthreading, then 1 core = 2 threads
3) correct
4) no...it doesn't use more RAM if you keep the value at 0. See 5.
5) since you're rendering crops of a scene you will need the "detail in crop region" instead. Usually you would like to have around 0.5x extra of padding, but you might like 0.75 or 1 to make sure that all crops use overlapping calculated geometry.
This takes a bit longer to render and also uses a bit more RAM. No idea how much, that depends on your scene.
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Floating.Point on January 07, 2011, 03:39:58 PM
Thanks for your feedback guys!

@ TU:
I have found that if I use "detail in crop region", things like shadows and reflections may not be seen between the crops...
For example if I have a large mountain the occupies an upper crop region, and an ocean occupying a lower crop region,
The ocean will not reflect the mountain properly if it is set to "detail in crop region".
Correct me if I am wrong, but the only way around this is to enable "detail in camera"?

So if this is the case,
Questions 4 & 5 I am still unsure about...

Thanks again!!

Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Tangled-Universe on January 07, 2011, 04:30:26 PM
It works the way I described it.
You use "in camera" when rendering full frame image.
If you set a value >0 for padding then the subdivison of geometry outside the camera will be performed by x (x = padding value) times outside the camera frustum.
The actual absolute size of this is determined by image size.
A setting of 0.5 means 0.5x time extra subdivision of geometry outside the frustum. A 500x500 image would have extra 250 pixels on each side calculated.

It works the same for crop region, but then the cropped region acts as camera frustum.

If it didn't work for you then you didn't enter a value for the padding or it was too low.
Reading from your first and last post I'm still not sure if you did use a value at all.
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: jo on January 07, 2011, 06:31:38 PM
Hi,
Quote from: Tangled-Universe on January 07, 2011, 03:28:24 PM
2) correct, usually cores = threads, unless you have an i7 processor with hyperthreading, then 1 core = 2 threads
Mac Pros use Xeon processors which have Hyperthreading. An 8 core Mac Pro can have 16 threads although in my experience 8 is usually faster, sometimes 12 works depending on the scene.

Addressing some others of Floating.Point's questions:

1) On OS X the 32 bit version of TG2 can usually use up to around 3.7 GB of memory before it starts to run into problems.
3) You don't need to worry about managing memory like this - i.e. setting things up so enough remains to keep the OS stable. The OS manages the memory for you. In fact a lot of the time a fair chunk of the memory an application is using is paged out to disk rather than in actual RAM anyway.

Regards,

Jo
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Dune on January 08, 2011, 02:39:05 AM
Quote1)   Each instance of TG2 can use a MAXIMUM of 4GB ram (usually a bit less)
Is it then correct to say that if you run two instances of TG (each perhaps set to its own core), each with a 53% crop render, it would render the total out almost twice as fast, without getting into memory problems?
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Floating.Point on January 08, 2011, 03:03:14 AM
@ Dune, well it wont be twice as fast, because the total processors used to render the whole image remains the same, they are just divided over 2 crop regions.

@TU, Thanks again for your valuable knowledge. I am still uncertain however. I understand how the padding works, but even with a padding of 1 using detail in crop region, there will be circumstances where this still doesn't provide enough data.

Have a look at this diagram... here I am rendering crop region 8. With a padding of 1, data is calculated for the lower 2 thirds of the overall image, but not for the top third. Anywhere where this data might be needed will render inaccurately. For example if there was a big lake occupying crops 7, 8 & 9 and tall mountains occupying crops 1, 2 & 3: the tops of the mountains would not reflect in the lake. :-\ Right?
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Tangled-Universe on January 08, 2011, 05:54:46 AM
In a diagram like that you are always rendering area number 5 when using the padding functions.

But your diagram depicts the area of the image itself. With that in mind it is correct that the padding isn't sufficient for coverage of the top 3 when using a padding value of 0.5 or 1.
A padding value of 2 would work, but that would probably make thing unnecessarily memory-intensive and slow, perhaps.

Since you're rendering crops anyway it would be much smarter to render vertical crops instead of 9 squares.
This way you circumvent the problems of having to pad the top sections into the bottom sections, since everything is already present in the crop itself.
Then using padding of 0.5 should be sufficient to create enough overlap, since it is unlikely things will get reflected from adjacent crops, but still enough padding for shadows.
Title: Re: Cores + Memory + Detail in Camera (do I have this right?)
Post by: Floating.Point on January 08, 2011, 06:36:50 AM
"Since you're rendering crops anyway it would be much smarter to render vertical crops"

:o

derr... who feels like a Dum-Dum now!!! thats right... I do!

That simple (and obvious) advice solves all my worries about crop renders!

Many Thanks TU... for your help, and your patience!