Planetside Software Forums

Support => Terragen Support => Topic started by: domdib on June 15, 2009, 08:06:01 AM

Title: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: domdib on June 15, 2009, 08:06:01 AM
There seems to me to be a bug in the "Ray traced shadows" setting of the renderer. Attached are three images of a terrain I'm working on, a DEM. In the first image, a heighfield erode has been applied, and these very dark shadows on the terrain showed up when I switched on ray traced shadows (in order to get the tree shadows). I removed the erode, but the shadows remain(#2). Finally, removed all surface layers and objects (#3). Still there.

I could understand that the terrain would cast shadows on itself, which is what I presume is happening. What I can't fathom is why the shadows are so dark. Even when I ramp up GI on surfaces to the absurdly unrealistic 10.5, they are still visible (#4).

Does anyone have a clue what's happening here? These shadows spoil the scene, so I'm keen to resolve it. I haven't attached a TGD, as the terrain is an 8MB DEM, but I can email it to PS or others if it's needed for diagnosis.
Title: Re: Ray traced shadows problem
Post by: Henry Blewer on June 15, 2009, 08:31:01 AM
It's hard to say. The images are too small for me to really tell what is going on. Try a render of number 3 at 800 x 600. I think detail quality of the render at 0.4 would be sufficient so the render time would not be too long.
Title: Re: Ray traced shadows problem
Post by: domdib on June 15, 2009, 09:01:40 AM
I don't quite understand your suggestion njeneb. Why would re-rendering at a larger size help? I thought my explanation was pretty clear - v v dark shadows that look unrealistic, presumably coming from the terrain shadowing itself. Aren't the dark patches on the images obvious?

I should add that I've tried pretty much everything to see what's inside the shadow, short of actually moving the sun, which I don't want to do as its position is a feature of the scene when the clouds are enabled.
Title: Re: Ray traced shadows problem
Post by: Tangled-Universe on June 15, 2009, 09:40:53 AM
To me it looks like the displacements are messed up.
Njeneb asked for higher resolution and quality because TG2 generates more accurate results when you do that, guess so.

Martin
Title: Re: Ray traced shadows problem
Post by: domdib on June 15, 2009, 11:39:26 AM
If the displacements are messed up, that's a big shame, as the third image is showing a plain .ter from a DEM, with no added displacements.

I will render a close-up of the shadowed area soon.
Title: Re: Ray traced shadows problem
Post by: domdib on June 15, 2009, 04:58:11 PM
Well, I guess there is just a flaw in this .ter, and I've been unlucky enough to focus on this spot. Attached are some renders: one bigger, as suggested by njeneb, and two closer in - the last one has no ray traced shadows, to see the terrain for reference. Is there any way of fixing this? Or if not, of covering it up?? I just ran through most of the heightfield operators, but no matter  how I tortured the original terrain, these patches kept showing up.
Title: Re: Ray traced shadows problem
Post by: Tangled-Universe on June 15, 2009, 05:10:26 PM
Can you post this terrain and tgd over here? Hopefully it is not too big.
I have 3 ideas what it might be and would like to test it.

Martin
Title: Re: Ray traced shadows problem
Post by: domdib on June 15, 2009, 05:31:52 PM
The tgd is attached - sorry, the node graph is rather messy. The Medium Quality render has the camera focused on one of the problem areas - patch2-new. Unfortunately, the .ter is 8MB. I tried to upload it at terragen.org under the title "Mountain terrain for TU" but I'm not sure if there's an approval process there - I can't see it. If you have any other suggestions on how I might get it to you, I'm happy to send it - I believe Gmail will accept attachments up to 10 MB.
Title: Re: Ray traced shadows problem
Post by: Tangled-Universe on June 15, 2009, 05:49:39 PM
Thanks, you can find my e-mail in my profile.
I'll look into it asap.
Regarding terragen.org: if I'm correct you'll have to wait for approval, so that could take a day maybe.

Martin
Title: Re: Ray traced shadows problem
Post by: Henry Blewer on June 15, 2009, 10:59:35 PM
I would check your settings in the various color tabs. This may be a contrast problem. It may be set too high (?)
Title: Re: Ray traced shadows problem
Post by: Oshyan on June 16, 2009, 02:16:55 AM
Looks like a DEM with some "holes"/corruption in it. What's the source/area of the DEM? I'd suggest running it through a 3rd party terrain editor, selecting those areas and smoothing them, or using a dedicated hole filling filter. There's one available in 3DEM if you still have that (should be mirrored on Terragen.org soon).

- Oshyan
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: domdib on June 16, 2009, 07:52:53 AM
I think Oshyan is right, and the data itself is slightly corrupt. I came up with a potential workaround: a displacement shader with a painted shader for blending - you can just paint a displacement on top of the hole in the terrain. The two images below give a before and after, and it works, kind of. Unfortunately, it also sends the render time too far north, :( possibly because there is also a Compute Normal in there to ensure the displacement was Lateral normalised
I'm going to try something else as a cover - perhaps some hero rocks. The problem with trying to fix the .ter itself is that it is very large, so finding just this particular patch would most likely be troublesome.

@TU - I tried emailing the terrain but it bounced. If you still want to play with it, I can put it in a public file directory I have on Dropbox. Just let me know, and I can email the location.
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: Henry Blewer on June 16, 2009, 07:58:49 AM
Thanks Oshyan. That never occurred to me. If I remember correctly, Terragen 0.9 would interpolate between the data points. Then, it may have been VistaPro 3, which I used back in the 90's.
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: Matt on June 16, 2009, 07:49:34 PM
TG2 also interpolates between the data points, but that doesn't mean ignoring any of them. 'Holes' in the terrain are usually just bad values (maybe with an elevation of 0), but the interpolator doesn't know that they are bad.

Matt
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: Oshyan on June 16, 2009, 10:34:15 PM
There are apps out there like GlobalMapper that can patch holes automatically, so no need to find them in a big terrain. 3DEM does as well, though its algorithm is less effective (and of course it's no longer available from the official site). I've posted a mirror of 3DEM here for anyone who still needs it:
http://www.terragen.org/index.php?action=tpmod;dl=item490

- Oshyan
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: Tangled-Universe on June 17, 2009, 02:58:25 AM
Looking at the example-pictures dombib provided I still find it awkward that the "holes" are being rendered somewhat correct with raytracing enabled. Without raytracing it gives strange shadows.
It seems that raytracing influences the way TG interprets elevation-data, but that doesn't sound logical??
Title: Re: Ray traced shadows problem: CAUSE, HOLES IN DATA
Post by: Oshyan on June 17, 2009, 03:17:31 AM
Both are rendering problematic terrain data, the errors are just more conspicuous with shadow rendering on. The shadow rendering functions in such a way that the data provided by the erroneous terrain values creates particularly notable issues vs. without shadows.

- Oshyan