About Store Forum Documentation Contact
Donations:
243$/mo



Post Reply 
Problem with shadows of terrain mesh
Author Message
Gian-Reto Offline
Member

Post: #1
Problem with shadows of terrain mesh
I have a problem with the shaowing cast from the ground mesh.

For a start, I am using pretty big terrains (8x8km atm), and they have very larg Terrain Features (maybe not the best idea wink ), so a Mountain is never completly in sight, but just one side of it.

This now creates a problem with the night/Day cycle.... as soon as the sun sinks below the Monatin, I get a correct shadowing for a moment (I assume while the light still hits upsides of some terrain-faces), followed by strange shadow artefacts, and the objects appearing to be lit from below.

Is there any possibility to tell the Engine to use kind of double sided Faces for the terrain?
Is there a possibility to create kind of an invisible "horizon layer" that just blocks the Sunlight at some point, without being visible (kind of a "hidden in the mist" effect )?

And how do I take screenshots in the built game?

Thanks a lot in advance

Gian-Reto
10-04-2011 07:20 AM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #2
RE: Problem with shadows of terrain mesh
For screenshots there are a separate function in the engine, you have to look for it. Print screen also works for me :-)
As for shadows, I've got the same issue, if I understood you correctly. It happens, when part of terrain goes out of sight (unloads) and becomes invisible, while it could still cast shadow on the far terrain (and close for character). It usually happens with big objects, like large hills or mountains, that can be "spliced" by the LOS. Disabling backface culling could help, I think... Maybe someone will know more.
10-04-2011 08:06 AM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #3
RE: Problem with shadows of terrain mesh
Updategame function:
Code:
if(Kb.bp(YOUR_BUTTON_HERE))Renderer.screenShots("Screenshots/","jpg");
It creates a folder in the main directory of your game called "Screenshots" and saves as a jpg.

SnowCloud Entertainment - We are recruiting!
http://www.sc-entertainment.com
10-04-2011 08:14 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: Problem with shadows of terrain mesh
10-04-2011 08:17 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Problem with shadows of terrain mesh
2 things can help
decrease the sun light the closer its Y position is to zero
set world active range a bit bigger than view range
10-04-2011 10:58 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #6
RE: Problem with shadows of terrain mesh
Thanks about the hints to activating a screenshot function....

I decrease the sun light already.... and basicly I could turn it off at some point, when it reached the horizon.... but: if my player character stands just below a big mountain which is very steep, this solution will still not prevent the ugly shadowing artefacts.

The second solution sounds good though.... I assume the memory footprint will be increased considerably? I would need a massive increase to solve the shadowing problem for big mountains....

@ kulesz: disabling the backface culling sounds almost like a more "viable" solution here, increasing the amount of tris used by the terrain by 100%, but giving me the exact result I like to achieve in almost all situations.... is there an easy solution to do it in the engine?

So, I'll give it a try, else my Terrain goes back to the drawing board with smaller Hills and Mountains to prevent this kind of problems....
10-04-2011 09:47 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #7
RE: Problem with shadows of terrain mesh
For the culling, see the link posted by Esenthel (setting material culling in material editor).
10-04-2011 09:49 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #8
RE: Problem with shadows of terrain mesh
Disabling backface culling helped with the shadow issue... FPS took a hit of course, but that was to be expected.

What is still there is the weird "lighting" of the relief bumps from below.... I assume this happens when the sunlight starts to light up from below the horizon line and isn't turned off by then.
I need to experiment with switching off the sun at this point, though it would be cool if there would be an option for a "light blocking" or at least "image blocking" invisible plane that would make it look like the sun (or the image of the sun) sinking down below an invisible horizon. It would be a lowcost tweak that would make a sunset with Fog turned on that much more believable.... is that already possible? Or is it impossible because of some constraints?

Thanks a lot for all the help.


Gian-Reto
10-05-2011 07:22 AM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #9
RE: Problem with shadows of terrain mesh
Maybe instead of simple turning on/off the sun, try to slowly decrease the power of its light?

BTW. How big was the FPS hit after turning off the BFC?
(This post was last modified: 10-05-2011 09:15 AM by kulesz.)
10-05-2011 09:14 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #10
RE: Problem with shadows of terrain mesh
well, can't say for sure, as I had vsync on... it was at the limit, 60 FPS, before, afterwards it dropped sometimes to 45 FPS (very rare), but often to 55 FPS.

So I'd say a rather big hit.

Decreasing the light is what I already do... I could start earlier though, so that it will be switched off earlier. Problem with that is the missing "horizontal line" in the distance, which makes it more of an approximation.... which could, to some extend, also be the fault of my terrain, which has very large terrain features instead of a lot of small ones, and the missing level objects which additionally would block line of sight to the sun.... well, I think I leave it until I'm done with the level, and tweak it more then.
10-05-2011 11:57 AM
Find all posts by this user Quote this message in a reply
Post Reply