Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Ah, I just noticed you used a depth fade for the ground effect on the screenshot. Unfortunately, we can’t access the depth texture in WebGL, which is really a shame.

Yeah, I too noticed that. It there a work around for using fade in webGL?

(+1)

I did some research to find a solution and came across this thread. Basically, it suggests adding the following lines in your shader:

#if !UNITY_REVERSED_Z
depth = 1.0f - depth;
#endif.

That should fix the problem.
 https://discussions.unity.com/t/depth-texture-not-working-correctly-on-webgl/149... 

(1 edit)

Thanks for exploring!!! Let me test this.