Terrain shader to "integrate" other objects

Node-based Shader Editor

Terrain shader to "integrate" other objects

Postby VitaminCpp » Wed Apr 18, 2018 12:47 pm

Hi there,

I just bought ASE and it's worth every cent!!! Great!

But currently I wanted to author a bit more complicated shader to "integrate"/blend other objects with my floor/terrain.
In the CryEngine it´s called "soft depth testing". I think this movie explains it better: https://youtu.be/9P3Fr2TL9mo?t=32m18s

I already played around with various depth nodes and blending modes, but I'm not able to get the desired results. :(
Do you have any advice for me on how to author these kind of shader in ASE? Do I need a multipass shader with depth testing or something?

Thanks very much for any help!
VitaminCpp
 
Posts: 4
Joined: Wed Apr 18, 2018 12:41 pm

Re: Terrain shader to "integrate" other objects

Postby Amplify_Borba » Wed Apr 18, 2018 2:17 pm

Hello, thank you for getting in touch and for your support!

Mesh blending is a fairly complex effect, and it would require some elements external to our editor in order for it to be achieved, including additional scripting. Unfortunately, we don't have any immediate advice or samples that we can provide, so for now I would recommend that you look into a package that would specifically solve this problem, such as Terrain Mesh Blending.

Please let me know if you have any further questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Terrain shader to "integrate" other objects

Postby VitaminCpp » Thu Apr 19, 2018 3:05 pm

Hi,

thanks for your fast response! I've already looked into this asset from the asset store, but I think it overcomplicates the problem a bit. Because I'm using triplanar projection and I think it shouldn't be too hard do blend some rocks into a floor/terrain depending on the intersection.

But anyways... Thanks for your help!
VitaminCpp
 
Posts: 4
Joined: Wed Apr 18, 2018 12:41 pm

Re: Terrain shader to "integrate" other objects

Postby Amplify_Borba » Mon Apr 23, 2018 10:11 am

No problem at all!

While the mesh blending effect is quite complex, we're hoping to add support for a POM depth intersection effect sometime in the future, which should provide an easier to implement, although less flexible solution.

Let me know if you have any further questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Terrain shader to "integrate" other objects

Postby VitaminCpp » Mon Apr 23, 2018 5:54 pm

Hi there,

I've made some serious progress with signed distance fields (based on the great work of keijiro https://github.com/keijiro/DFVolume) already. Everything works fine, BUT you have to bake these fields every time your static objects change.
So currently I'm considering a more "dynamic" solution based on CryEngines "Soft Depth Test" feature. I don't know how exactly they do it, but I think they basically do a depth pre-pass and reconstruct the world position of the underlying terrain. Then you have the world position of your current vertex and the world position of the underlying terrain vertex. Now you have all the information you need for blending and adjusting the vertex normals... ;-)
The drawback of this method is the additional pass, but you gain the realtime comfort.

So TL;DR I would suggest to implement a depth pre-pass option (full ZWrite on!) so that everyone could fetch/grap this depth buffer to do all kinds of nice effects. Being able to access the depth of objects behind would just be awesome for a bunch of complex shaders. ;-)
VitaminCpp
 
Posts: 4
Joined: Wed Apr 18, 2018 12:41 pm

Re: Terrain shader to "integrate" other objects

Postby Amplify_Borba » Tue Apr 24, 2018 9:24 am

Thank you for providing such detailed information, we will have to further investigate this as we're not entirely sure if that type of custom depth pass can be achieved by just using shaders.

I'm registering your request and passing these details along to the developers, as it's already in our plans to add support for a similar type of effect.

I'll be sure to get back in touch as soon as there are any developments regarding this, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Terrain shader to "integrate" other objects

Postby VitaminCpp » Tue Apr 24, 2018 10:50 am

You're very welcome!

I'm not entirely sure if this can be archived by only using shaders. I will try it out as soon as I've a bit more time to spend and will let you know.

It really would be awesome if this effect could be archived with Amplify! But please implement a dynamic solution without having to bake some depth/SDF maps. ;-)

Thank you very much!
VitaminCpp
 
Posts: 4
Joined: Wed Apr 18, 2018 12:41 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests

cron