Add option "OccludedOnly" to the Highlight instance

Currently, there is no good way to only highlight things when they are occluded, they should be able to appear normally when not occluded.

The options present in the instance right now are “Occluded” and “AlwaysOnTop”.

With “Occluded”, it will apply highlights to the instance when there is nothing on top.
image

While “AlwaysOnTop” will always draw no matter the depth.
image

However, the present allowed behaviours are less than helpful in the majority of cases. The desired effect are showcased below:
image
image

Valorant is a game that comes to mind to use this effect to highlight players’ teammates or enemies that were “tagged” with some effect.


151 Likes

Would very much appreciate this; it should absolutely be a standard feature for Highlights. This option would give us the ability to add highlights to teammates or players occluded from the camera without making them too distracting.

37 Likes

Thanks for the feedback! Would welcome any further use cases here. We’ve brought this to the appropriate internal team to investigate.

25 Likes

This type of culling mode has been requested as it is useful in some cases. Unfortunately it is very hard to do efficiently do this for low end devices. We will continue to develop this feature to see if we come up with a good efficient solution for this and if so we can add it as a new depth mode.

To clarify the difficult bit is dealing with self occlusion. You don’t want the shading effect to apply when a part of the object in question is occluded by itself. Only by other objects in the world.

25 Likes

Is there more information about how the effect is rendered that can be shared? Just purely for curiosity.

Wondering if this is done with an edge detection algorithm over some intermediary texture. I imagine you could avoid self occlusion issues by using a texture that contains instance silhouettes by some id (e.g. outline group), but since that would have been done if that were possible I’m curious where the difficulty actually is. Maybe it’s the silhouette texture that’s the challenge?

9 Likes

Yes each instance of a highlight has a unique ID associated. A fullscreen pass will dry an outline if this ID is different either vertically or diagonally for each pixel.
This effect can be achieved by reading in the current depth buffer and outputting the ID only if the current depth is closer than the highlighted depth. Even then you may not want to overide a current depth which is closer to the camera.

The main difficulty is in the fallback pass for low end devices. These do not do an explicit full screen edge detect pass due to the cost. These render straight to the screen using a bayer screendoor pattern to simulate 4 levels of translucency.

21 Likes

Thank you for the detail! It sounds like that approach is very close to what I had expected. I think I get where the trouble is with self occlusion if you’re doing it that way. With respect to the fallback pass though, does that mean you’re (currently) just not doing the outlines on low end devices, and only the fill color?

1 Like

It has been a while, have there been any progress on this feature? I don’t really find the highlight instance useful for my experiences without this option.

6 Likes

Bumping. This is a very important feature that should be added.

Complex maps that frequently block the player’s view can be quite jarring as they cannot see where their character is. Having highlights only show on occluded regions is very, very helpful in these cases.

4 Likes

I support this, but wouldn’t this make it easier for exploits to have ESP?

1 Like

This would not affect exploiters.

4 Likes

Couldn’t an exploiter loop through each character, create a new highlight, and set it to OccludedOnly or AlwaysOnTop?

1 Like

This can already be done and actually is already done for Piggy / Rainbow Friends exploits with AlwaysOnTop

9 Likes

Just wish to bump this because I am currently having to use a hacky solution to achieve the desired effect, I am currently using 2 Highlights. One set to AlwaysOnTop with your desired settings; then on game-start (or regularly because the effect does wear off after a bit) clone that whole object / model and set the new Highlight (under the cloned Model) to Occluded with 0.999 OutlineTransparency and the 1 FillTransparency. I’m well aware that this is betting on the order of drawing always being the same and that may not be the case, hence why I want this to be an official feature. This also creates visual artifacts in certain scenarios.



13 Likes

This is pretty cool, but it would be kind of problematic if your use case was to put the highlight on player’s character as duplicating them will have undesired behaviour. Creative though!

1 Like

Bumping this, this is something that needs to be added to Roblox. Kind of limits what you can do with highlights

1 Like