Page 1 of 1

Refraction Issue - Filter depth bias

PostPosted: Sun Jul 15, 2018 8:54 am
by gponzini
I'm getting mad trying to obtain the depth bias filtering of Unreal through Amplify Shader.

The technique is described here https://developer.nvidia.com/gpugems/GP ... ter19.html

Basically, I'm creating a shockwave shader and the refraction show up everything in front, grabbing the screen.
I would need, as explained in gpugems, a technique for filtering the frontal object, as it is in Unreal.

Could you please help me through this? As it can be really good for many stuff being able to filter frontal object from refraction.

Thank you

Re: Refraction Issue - Filter depth bias

PostPosted: Mon Jul 16, 2018 12:47 pm
by Ricardo Teixeira
gponzini wrote:I'm getting mad trying to obtain the depth bias filtering of Unreal through Amplify Shader.

The technique is described here https://developer.nvidia.com/gpugems/GP ... ter19.html

Basically, I'm creating a shockwave shader and the refraction show up everything in front, grabbing the screen.
I would need, as explained in gpugems, a technique for filtering the frontal object, as it is in Unreal.

Could you please help me through this? As it can be really good for many stuff being able to filter frontal object from refraction.

Thank you


Greetings,

I suppose you could use distance based masking but I'm not entirely sure what to recommend, it really depends on how you have it set up. Can you share your shader for further examination?

Thanks!

Re: Refraction Issue - Filter depth bias

PostPosted: Mon Jul 16, 2018 2:45 pm
by gponzini
Ricardo Teixeira wrote:
Greetings,

I suppose you could use distance based masking but I'm not entirely sure what to recommend, it really depends on how you have it set up. Can you share your shader for further examination?

Thanks!



If you can help me showing how to setup it I would be really thankful.

In Unreal you avoid the refraction of object in front of the refractive plane (the issue that is described into GPU Gems article). Here the setup both through unlit emission and through Normal and Refraction output combination, it's the same.

https://ibb.co/emDvuJ
https://ibb.co/gYtvuJ
https://ibb.co/d9BgZJ

Re: Refraction Issue - Filter depth bias

PostPosted: Mon Jul 16, 2018 3:27 pm
by Ricardo Teixeira
gponzini wrote:
Ricardo Teixeira wrote:
Greetings,

I suppose you could use distance based masking but I'm not entirely sure what to recommend, it really depends on how you have it set up. Can you share your shader for further examination?

Thanks!



If you can help me showing how to setup it I would be really thankful.

In Unreal you avoid the refraction of object in front of the refractive plane (the issue that is described into GPU Gems article). Here the setup both through unlit emission and through Normal and Refraction output combination, it's the same.

https://ibb.co/emDvuJ
https://ibb.co/gYtvuJ
https://ibb.co/d9BgZJ


Hello,

You can try using the Distance Blend Shader Function included(search for it in the node list), or be sure to check the Snow Coverage Terrain sample for a more practical case.

The GPU Gems sample uses a custom mask to isolate specific objects, setting up something like this is beyond the scope of our editor. We actually use something along those lines in order to provide object isolation in Amplify Color, I recommend checking it out.

Let me know if you have any additional questions, we would be happy to elaborate.

Thanks!

Re: Refraction Issue - Filter depth bias

PostPosted: Mon Jul 16, 2018 6:53 pm
by gponzini
Ricardo Teixeira wrote:
gponzini wrote:
Ricardo Teixeira wrote:
Greetings,

I suppose you could use distance based masking but I'm not entirely sure what to recommend, it really depends on how you have it set up. Can you share your shader for further examination?

Thanks!



If you can help me showing how to setup it I would be really thankful.

In Unreal you avoid the refraction of object in front of the refractive plane (the issue that is described into GPU Gems article). Here the setup both through unlit emission and through Normal and Refraction output combination, it's the same.

https://ibb.co/emDvuJ
https://ibb.co/gYtvuJ
https://ibb.co/d9BgZJ


Hello,

You can try using the Distance Blend Shader Function included(search for it in the node list), or be sure to check the Snow Coverage Terrain sample for a more practical case.

The GPU Gems sample uses a custom mask to isolate specific objects, setting up something like this is beyond the scope of our editor. We actually use something along those lines in order to provide object isolation in Amplify Color, I recommend checking it out.

Let me know if you have any additional questions, we would be happy to elaborate.

Thanks!



Hi Ricardo, thank you for your suggestions! Could you give me a little bit more tips about using those nodes for clipping the object in front of the refraction? I don't mean to use exactly the same technique of GPU Gems, neither I don't know how Unreal do it by default, but I cannot figure out how to use those nodes for avoiding the object in front the refractive plane for being capture by Grab Screen Pos/Grab Screen Color nodes