Page 1 of 1

Depth Pass

PostPosted: Wed May 16, 2018 12:13 pm
by benjaminF
Hi everyone,

I have a problem with my hologram shader. I would like to fix the depth transparency.
I should not be able to see the legs in the back, like this picture.
Image
Image
Image
I don't know if it's possible to you to help me but it was very nice.

Thanks a lot.

Re: Depth Pass

PostPosted: Wed May 16, 2018 3:51 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

According to the screenshots that you've shared, it seems that you're using a very outdated version of ASE, please download the latest one through the Asset Store or via our download page.

As you may be aware, semitransparent shaders don't usually write into the depth buffer. Unfortunately, this can create draw order problems, especially with complex non-convex meshes. If you intend to overlap meshes like that, then using a shader that fills in the depth buffer before rendering transparency might be useful.

You can probably mitigate the issue by toggling the extra pass parameter.

ExtraDepthPass.jpg
ExtraDepthPass.jpg (14.32 KiB) Viewed 5966 times


Alternatively, this can be done by code by adding the following after "SubShader {"

Pass {
ZWrite On
ColorMask 0
}


Please let me know if this helps, if your require any additional assistance, please forward us a complete sample further examination on our side, either by attaching it to this post or through [email protected], thanks!

Re: Depth Pass

PostPosted: Thu May 17, 2018 12:41 pm
by benjaminF
Thank you for this answer it works very well, perhaps the update has been effective but it's great.

On the other hand if I can bother you again with another problem, when I superimpose two meshs it happens in front of each other like this gif

Image


Is it a question of render Queue ?

Thanks.


ps : Little question just for me :). How do you see what i use a very outdated version of ASE ?

Re: Depth Pass

PostPosted: Thu May 17, 2018 1:38 pm
by Amplify_Borba
Transparent objects can be a bit problematic, although this may not necessarily be an ASE issue we would be happy to examine it on our side if you could send us a sample scene.

In your node parameters, there was no option to expose them ( the circles beside certain parameters, like in the screenshot I've sent ), which is why I could tell that you were several versions behind the latest build.
We release new builds weekly, sometimes more than once, so we advise users to update through our website frequently.

Re: Depth Pass

PostPosted: Thu May 17, 2018 4:34 pm
by Amplify_Borba
Thank you for sending a sample, upon further examination and according to the way you've set up your meshes, setting different Render Queues per material might help mitigate the situation, although it might not work for all cases.
For example, try setting a lower Render Queue value for the vest, and a higher one for the pants, so that the vest is rendered on top of them.

Removing the "cap" on the pants mesh might also help, since it shouldn't be visible either way.

Please let me know if this helps, thanks!

Re: Depth Pass

PostPosted: Fri May 18, 2018 1:34 pm
by benjaminF
It was an idea that I had explored to change the rendering tail of the different elements. But now the problem is for different objects with different angles.

Example:

Object A
subobject A1 with the render queue 3000
subobject A2 with the rendering queue 2999
subobject A3 with the rendering queue 2998

Object B
subobject B1 with the render queue 4000
subobject B2 with the rendering queue3999
subobject B3 with the rendering queue 3998


I wouldn't want to see object A through object B but it's impossible without changing the rendering queue to all B objects.
But if I did, through object A, I see object B.

Like the gif

Image

A possible method it's betwin postion mesh and camera

Re: Depth Pass

PostPosted: Fri May 18, 2018 1:49 pm
by Amplify_Borba
Do you have a lot of variations? If not, using replacement models could perhaps simplify the setup, as it seems a bit tricky as it stands.

I would personally look into hiding specific parts of the mesh.

Re: Depth Pass

PostPosted: Fri May 18, 2018 1:55 pm
by benjaminF
Yes in the end, we will have a lot of variations. Different clothes will be created for these avatars.

Re: Depth Pass

PostPosted: Mon May 21, 2018 10:37 am
by Amplify_Borba
It's a tricky setup, no doubt about it, Unity has always been a bit problematic with transparency.

I would recommend exploring other alternatives such as dividing the model or using replacement models since, unfortunately, I don't think that I can offer you a solution that would work with all possible cases.

Please don't hesitate to get back in touch if you come across any other issues or questions.