Interactive Demo Scene

I just wanted to do something.
It took about a week of evenings.
Assets are not mine.
Beware of heavy GIFs below (up to 40MB).
01A
01B
A01
A02
B01
B02
https://media.giphy.com/media/w9d4Co3fX913SiBqCV/giphy.gif
https://media.giphy.com/media/5BWVHdvEJarfjfZaxv/giphy.gif


This is not code exchange.
Re-check your equipement before looking at the code if you are brave enough to even open it.
All sources are here:
https://github.com/eugeneko/Urho3D/tree/sample-77
Source/Samples/77_Oddball
bin/Autoload/LargeData/77
bin/Autoload/LargeData/Shaders

Tested only with DX11.
Grass animation works only with DX11.

Assets info is here:
https://github.com/eugeneko/Urho3D/blob/sample-77/bin/Autoload/LargeData/77/README.txt

11 Likes

One thing that really bothers me with Urho, but I never found a way to tweak it, is how jaggy vegetation and shadows tends to look like. Is there any config that I’m missing on my materials? Did you manage to find a way to fix it?

There’s one trick that I found helpful and it has nothing to do with Urho.
You should carefully prepare foliage LODs so they doesn’t get too sparse.
In other words, LOD calculation shall be conservative and preserve as much non-transparent pixels as possible…
image

Alpha to Coverage plus MSAA x4, if properly used, may help too.
It has it’s own issues tho.
https://medium.com/@bgolus/anti-aliased-alpha-test-the-esoteric-alpha-to-coverage-8b177335ae4f
It shall be configured more thoughtfully than just turning switches on like I did below, but it’s enough to get an idea:
image

3 Likes

Looks really great!
Compiled and ran it on Ubuntu 16.04 and everything seems to be working except the grass animations as you already mentioned. I always thought that vegetation was one of the missing samples in this project and it could be great if someday it can be created in the master repo.

BTW it’s quite easy to port grass shaders for OpenGL. Add some attributes, copy paste code… maybe I’ll do it next time when I touch this code.
DX9, on the other hand, doesn’t allow to sample textures in vertex shader and cannot support all these animations.

Are these artifacts caused by bad LODs?

image

Runs well on a shitty Intel 4th and Ubuntu:

image

Grass noise appeared when I enabled MSAA, don’t know why. Maybe texture mode was set to wrap implicitly.
Tree model itself is quite strange. It seems it was designed to have one-sided leaves. At least, I had artifacts when made leaf material two-sided. I don’t know.

Cool, how did you port shaders?

Didn’t port anything. Cloned, built and it worked well.