Planetside Software Forums

Support => Terragen Support => Topic started by: venteras on April 27, 2009, 03:28:21 pm

Title: GI Settings and Cube maps
Post by: venteras on April 27, 2009, 03:28:21 pm
My company got TG2 (today) for creating cube maps for backgrounds in 3D training applications, or serious games if you wish.  I've generated a few test maps but can't seem to get it seamless unless I set the GI settings to 0, which causes lots of detail in my clouds to disappear.

I found a lot of posts on the forum from 2007 and onwards indicating that GI baking will be implemented to get around this problem, however I can't see how to do it in the latest version.

Has this been implemented or is there some other way to get around this issue?  Or am I stuck with the limitation of setting GI to 0?

Any suggetions will be appreciated.
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on April 27, 2009, 04:00:51 pm
The solution for this is to use the ray detail region (padding) feature under the "advanced" tab in the renderer.

If you set up 6 different renders without rendering them in crops you choose to render detail in camera.
If you set up 6 different renders and render them in crops you choose to render detail in region.

The setting is usually from 0 - 1. In this case this setting means that GI and shadows will be calculated inside the camera's frustum or region only when the setting is 0.
When the setting is 1 the GI and shadows will be calculated 1 frustum outside the camera/region.
Especially when rendering cubes this is useful because for rendering one side everything from the other sides will be taken into account when calculating the GI and shadows.

Martin
Title: Re: GI Settings and Cube maps
Post by: venteras on April 27, 2009, 05:52:01 pm

Thanks for the reply, it does seem like the way to get around the problem, however it seems that one should still try and balance the light in your scene? since some of the images are still a lot darker than others (see attached file)

I've tried it with RDR crop as well as camera with RDRP on 1 in both instances but it gives the same results.  The results are marginally better then they were with RDRP on 0.

Do you think one side of my scene is perhaps just too dark?
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on April 27, 2009, 06:04:09 pm
Perhaps, but I'm not entirely sure if you used the RDR(P) correctly. Can you elaborate a bit more on how you used it?
Did you render in two different instances of TG2, did you render the image as a whole or in crops?

Looking at your image another factor might be the detail setting. My guess that this is a render around 0.55 quality or so.
This will affect the accuracy quite some, so I advice to render the image as a whole in higher quality. Also increase atmosphere and cloud-quality.
Set cloud quality to 0.8 and atmosamples to 48 (or a bit more) and render the scene in 0.75-0.8 quality.

It should improve. If it doesn't then please post or mail me the file and I'll take a look at it.

Martin
Title: Re: GI Settings and Cube maps
Post by: Oshyan on April 27, 2009, 11:47:51 pm
I believe it should be on "Camera" and you can use values higher than 1. You may also try higher values of GI Blur Radius - 100-200 perhaps.

- Oshyan
Title: Re: GI Settings and Cube maps
Post by: venteras on April 28, 2009, 04:58:46 am

I've tried all permutations of the settings mentioned above and others that seem relevant but the seams just doesn't wanna go away.

Martin, I've mailed you the file.  Will appreciate if you can have a look.
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on April 28, 2009, 04:52:13 pm
Did take a look at it tonight and saw 2 things:

1) you didn't enable the ray detail region padding feature, enabled it and set it to "in camera" with a value of 2
2) the atmosphere samples were only at 16 and increased that to 64

Then I rendered them at quality 0.8, GI 2/2 and with GI-blur radius @ 8 and this is the result below.

I think when you further increase the ray detail region value >2 and also increase the GI-blur radius up to the levels which Oshyan mentioned (about 100-200 or so) it should work or at least get better.

Also, if there is still a very little seam I suggest to render a small overlap. I think you can do this best by increasing the camera-angle by ~2 degrees. Then you should get some overlap and then in post-pro you can get rid of the seam without too much work.

Hope this all helps you any further.

Martin
Title: Re: GI Settings and Cube maps
Post by: venteras on May 04, 2009, 05:19:33 pm
Thanks a lot for having a look and the response, I've tried your recommendations and got much better results!
Title: Re: GI Settings and Cube maps
Post by: venteras on May 13, 2009, 01:51:45 pm
Ok, just one question, I started a new project and need to confirm where and how I enable the ray detail region padding feature? 

I did a few renders and thought I had it enabled but apparently not!
Title: Re: GI Settings and Cube maps
Post by: domdib on May 13, 2009, 04:36:59 pm
In the renderer, go to the Advanced Settings, Set Ray Detail Region to Detail in Camera, then set Ray detail Region padding to 2.
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on May 13, 2009, 05:04:13 pm
Quote from: domdib on May 13, 2009, 04:36:59 pm
In the renderer, go to the Advanced Settings, Set Ray Detail Region to Detail in Camera, then set Ray detail Region padding to 2.


Yes that's what I explained and already have tested for him about 2 weeks ago. Still working on it though in the meantime. There are still some problems with (minor) seams even when using the RDR feature with settings >2 and also combined with GI blur radius of >100...

I guess this part of the renderer still needs some work, so in the meantime I'm working on a nice fill light setup.
Title: Re: GI Settings and Cube maps
Post by: domdib on May 14, 2009, 05:48:23 am
I know this may sound counter-intuitive, but I wonder if setting the RDR > 2 is the wrong way to go - because presumably, you only want the GI info from the next crop or image, not necessarily from the next and the next but one (which is what I imagine setting the value to 2 would do). But correct me if I'm wrong TU - have you experimented with values < 2? Perhaps Oshyan can weigh in? And if I'm right, does that mean that ideally, you would want to be able to set the direction from which the GI is being received? (I think that this discussion would probably benefit from some diagrams of how the feature works  :))
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on May 14, 2009, 12:52:51 pm
Quote from: domdib on May 14, 2009, 05:48:23 am
I know this may sound counter-intuitive, but I wonder if setting the RDR > 2 is the wrong way to go - because presumably, you only want the GI info from the next crop or image, not necessarily from the next and the next but one (which is what I imagine setting the value to 2 would do). But correct me if I'm wrong TU - have you experimented with values < 2? Perhaps Oshyan can weigh in? And if I'm right, does that mean that ideally, you would want to be able to set the direction from which the GI is being received? (I think that this discussion would probably benefit from some diagrams of how the feature works  :))


Thanks for thinking along. You are right that values >2 might give worse results. I indeed tried values <2 of course....0.5 and simply 1 for example.

The GI pass samples within the camera's frustum. With the RDR you can increase the size of frustum where GI is being sampled in. If I'm correct, and here's the critical part, a value of 1 represents an increase of 100% of the frustum in all directions. So 800x600 will be sampled at 2400x1800.
Title: Re: GI Settings and Cube maps
Post by: venteras on May 15, 2009, 07:17:19 pm
Hello again

In my opinion the RDR feature is not working properly (not for creating cube maps anyway).  Whether I put it to camera or crop and whether I make it 0, 1 or 100, it doesn't make a difference with regard to the seams.  The images get darker and lighter but the amount of seam pretty much stays the same.  It works fine for light couds but storm clouds have a seam no matter what you do. 

Oshyan and TU, your recommendations of using a higher blur radius and number of samples for atmosphere and higher detail made a significant difference, but unfortunately not enough to remove the seams (I've tried several different projects now).

Are there perhaps some other settings one can manipulate to resolve this?

Title: Re: GI Settings and Cube maps
Post by: jo on May 15, 2009, 09:20:38 pm
Hi,

RDR is not intended to remove these GI seams for cube maps. This is from the change log:


Two new render settings on the Advanced tab which control the region in which ray traced polygons are fully subdivided. Outside of this region the ray traced polygons are only coarsely subdivided. Previously this region was the frustum seen by the rendered image or crop region, but now you can also choose to have no detail or to have detail everywhere within the camera frustum regardless of crop settings. "Ray detail region padding" can be used to enlarge (or shrink) the region. A value of 0 means no padding. A value of 1 adds a border to each side of the frustum which is equivalent to the width or height of the image or crop region, which makes the frustum 3 times as wide and 3 times as tall.


It could help for multiple images taken in the same direction and stitched together sideways to make a long pano ( or for when you're stitching crops together ), but not for a cube map where the images are at such dramatic angles to each other. I'm not sure it's practical to calculate a stable GI solution for a complete location so you can look in all directions and not have issues, but it's not my area of expertise.

My instinct is that you are going to have to avoid using GI for now. I have seen very good results from enviro light setups.

I'll get Matt to check in and make sure I'm not talking nonsense :-).

Regards,

Jo
Title: Re: GI Settings and Cube maps
Post by: luke on July 02, 2009, 06:59:19 am
I also purchased terragen 2 exclusivly for making skyboxes. Firstly I was pretty frustrated that there wasn't a built in way to automat the export of sky boxes, especially when creating sky boxes and light probes is a highlighed feature in the marketing.

Anyway, being a coder, I was happy to notice the .tgd format is easily editable xml, so I wrote a quick tool to automated the process for me.

However, then this seems problem appeared with a sky box with a low sun above think clouds. Interestingly it is only the bottom of the box that has seems. No idea why. Then I read that the best way to fix seems is to turn GI off. That didn't really seem acceptable to me. I'm glad I found this thread so I to stop me spending ages messing with settings to try fix the issue.

Anyway, I didn't want to compmarise on GI if I could avoid it so I decided to leave GI on, so I tried a method to smooth out the seems. I doubled my render out resolution for each face and set the field of view to 126.86989 degrees (calculated from arctan(2.0) if you know your trig). Texture coordinats 0.25 to 0.75 then gives the box face. The texture outside that is the border used to smooth the seems. I just render each face of the skycube in opengl one by one adding the border, alpha blending from 1 at the center to 0 the edges. The results look good to me. I havn't noticed any seems or artifacts. Now I just need to render out and save each direction then I have a normal seemless sky cube.

The only problem is, I had to double the resolution in my terragen renders, which I assume it means it will be 4 times slower to render. Lucky I only need fairly low res images. I really don't want to complicate my export pipeline like this, if a fix apears, I will be happy, however my current work around looks like it will work for me.
Title: Re: GI Settings and Cube maps
Post by: neuspadrin on July 02, 2009, 07:20:33 am
This would be the kinda feature that would be made with a plugin or something probably. It would be interesting to see if someone could make a cube map plugin once they get that out.
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on July 02, 2009, 11:06:34 am
Thanks for the headsup on this Luke. Seems time-consuming, but at least it's a workaround. I'll try this myself soon.

Cheers,
Martin
Title: Re: GI Settings and Cube maps
Post by: Falcon on July 03, 2009, 04:14:41 am
If it's any help, I use the attached clip to render cubemaps, and so far I'm fairly free of seams. I've had two cases but I suspect that in both the mistake was on my side (not updating all camera settings after moving the camera a tiny bit).
Title: Re: GI Settings and Cube maps
Post by: Tangled-Universe on July 03, 2009, 09:01:10 am
Thanks a bunch Falcon!

Cheers,
Martin
Title: Re: GI Settings and Cube maps
Post by: luke on July 03, 2009, 10:01:50 am
It wouldn't be too hard to make and release a little program to do this, but personally, I'm not quite generous enough to donoate my time for that. My quick and dirty code is working well enough for me now and is integrated into my tool chain. Don't mind providing some code to anybody else who wants to try... but really its not that hard.

Would be nice if somebody did it and spend a bit of time working out the minimum amount of overlap nesessary (Not just doubling the images and hoping for the best like me). Don't even need to render every image double sized because you only need to overlap in one direction. Need to put a bit more effort then just stopping at the first thing that worked like I did. Also maybe make it configurable so you can reduce overlap for seems that arn't so bad. Maybe even add super sampling options. Make it work with all image formats. But it ends up being a lot of work after all that.

But ideally terragen 2 would just have an output cube map option that worked with GI.