Terrain rendering (avoid dbl shadow, num detail textures)

Hallo,

terrain textures often have some real world light source casting shadows baked into the image data. Like in this example (with slightly too large stones):


So there are areas that are a) in engine-generated shadow and/or b) areas that are in baked image data shadow. This might make up too much of contrast within engine-aware shadow areas.

No wonder, of course, with such a simple setup like the one I’ve made here


but the material-exit node doesn’t seem to have a “engine should apply that much of direct sunlight shadow even if it thinks the area is in sunlight”-pin (for the default-lit material type at least).

Also, the terrain documentation strongly recommends to not use much more than 3 detail textures, without mentioning reasons for that. IIRC, even my GF2MX (with CPU vertex pipeline) had so many texture samplers, and I have a strong preference to work with something like 8. Any probs to expect from that?

I think I’ve just found a workaround:

For outdoor daylight, I could try to pass “in pixel shadow”-areas as emissive, so that they won’t be additionally affected by sunlight shadow.

That’ll probably be good enough for me, yet. Then such areas also couldn’t profit from AO+indirect light calculations from the engine, but maybe this would be acceptable given the small expected area-percentage of “in pixel shadow”. If shadows get longer, it might already be time to move away from emissive fractions.



No!

As already can be seen in the screenshots in previous posting, the difference when switching to emissive is quite heavy.

And I don’t have any luck using sky atm sampler. Not sure, it looks like Engine Version 4.27 is the last that comes with that reference documentation page. For me (using 5.5.4), the sky-samples appear all black in terrain material.

Ah, ok SkyAtmosphereDistantLightScatteredLuminance works.

But now I have difficulties to see how heavy remaining issues might be. Something more that should be done here?




So here’s a preview, using a threshold on brightness of the ground texture to decide where “pixel shadow” is.

It’s somehow unintended that the overall-effect appears out-of shadow instead of in-shadow, but that’s ok. The image with the lower contrast in light shows “before” situation, and the hard in-light one should, according to my theory, feel a lot more natural.