Translucent vs. Translucent clipping

Hello there,

a couple of weeks ago I posted a thread from my UE3 UDN account at work, on the topic of clipping of translucent objects vs. other translucent objects. sadly the response was “UE3 handles depth sorting on a per-object basis” which pretty much meant “can’t fix it”.
the problem mainly affects the case of translucent objects moving inside a (translucent) plane that represents water. pretty simple and quite a common case to have in a game, so we (team of mostly programmers) were kinda disappointed due to the fact that such a modern and widely used engine didn’t handle such a basic and important functionality better

today I tried to reproduce the issue on our lovely Rocket and to my surprise, a top-notch next-gen engine like UE4 still handles depth sorting of translucent objects the old way: the object that’s closer to the camera gets rendered first as a whole. so if you have two translucent objects clipping into eachother and move the camera around them you see a hard switch in their rendering.

could this be improved?

Order independent solution of translucency is a problem that has not yet been solved in an efficient way. There are a few potential solutions that either use randomness and introduce noise (stochastic translucency) or cost a lot of performance (per-pixel linked lists).

Early on in UE4’s development we prototyped out some solutions. A variation on per-pixel linked lists was the best solution we had at the time and it cost about 6x more than per-object sorted translucency. So if enabled you’d have to reduce the number of pixels affected by translucency by a factor of 6 to fit in to the same budget. We decided the overhead was simply not worth it. We’d rather have a lot of FX and overdraw.

In addition to the performance concerns, UE4 is an engine meant to scale down to lower end PC and integrated graphics. Order independent translucency could only be supported on DX11 class hardware and even then only on platforms where you can afford the 6x penalty.

fine, but maybe for PC we could have the decision up to ourselves? PC games with UE4 require a DX10 card anyway (DX11 recommended), so what about a SystemSetting that enables per-pixel translucency sorting?

Im curious about how other engines do it btw

I can’t speak for other engines but we generally only implement and support features we intend to use ourselves. Every feature adds complexity to the code, the testing process and makes it more expensive to add other features we intend to use.

As I said, we have no plans to use the technique internally due to the performance cost and therefore have no plans to implement it for others. Sorry!

sorry to bring this back from the dead (didn’t know if I should’ve started a new Question for this same topic)

recently a co-worker pointed me to this paper about AMD’s solution for a problem that seems similar if not the same as this. the paper only explains the technique in a few lines but even it might be useful as-is, or I’m thinking maybe a big company like Epic could have contacts with AMD :slight_smile:

anyway here’s the link to the paper:
http://www.ptc.com/WCMS/files/141236/en/Creo_OIT_white_paper_041112.pdf

That white paper describes the per-pixel linked list method. We experimented with that method and a few variations on it. Again, there is a heavy performance penalty to that method compared to traditional per-object sorting that most game engines use.

A new technique for order independent blending is interesting and may be something we experiment with in the future. The results are not pixel accurate like per-pixel linked lists but would be significantly faster!

http://jcgt.org/published/0002/02/09/

Hi! I have a question on kind of the same topic.

I’m developing a strategy game with the camera set to top down with the possibility to tilt it a little each way. When using a translucent material for grass it looks great, however where i have overlapping grass-meshes they pop in and out depending on the camera position, I guess the engine computes which mesh is nearest to the center of the camera and displays it in that order. I’ve messed around with settings to try to see if anything affect this problem, and the only thing I found was to set the field of view to 5 which did lower the popping significantly, however that makes the game perceived as more or less 2d. It doesn’t really matter which grass mesh is seen as long as the engine sticks to displaying the same all the time.

My question: Is it possible to make the depth test of the grass meshes to a second camera which is orthographic, while still seeing through the normal camera as a work around of this issue for my game?

Hi Jorg,

Can you post this as a new question. This is an archived post from our UE4 Beta that is no longer being tracked.

Thank you!

Tim