Decal/Fog Rendering bug?

https://youtu.be/f5xkGkgfnUc

Seems like roblox is having a hard time rendering particles over decals over other decals and fog?

The video posted gives me an error message when I try to view it.
EDIT: Silly me, I can view it on youtube. :stuck_out_tongue:

Can you attach the place file to make this easier to reproduce?

Rendering bug.rbxl (42.6 KB)

Thought I uploaded that in the first post, my bad.

It seems like this ‘kind’ of bug happens with decals when you try and overlap them with transparency (or fog?)

Notice how the green decal is dominant over the blue in this gif, despite it being behind. What this gif doesn’t show is every now and then the ‘top’ decal will swap depending on the camera’s position, which I believe is also happening for you.

Other then making the horizon into a none-transparent part (which will ruin the overall look), is there any way to “fix” this rendering bug?

@ROBLOX Rendering team/anyone who can answer.
Why does the furthest away decal render over the nearest decal, instead of nearest rendering over furthest? And will you ever change the way their currently rendered to fix this issues?

This bug also happen with surface GUIs…

1 Like

It is a bug with transparency of anything + particles

Mind posting a repro for this? I’m not sure if it’s the same issue as the one in the original post or not.

This issue has multiple causes:

  1. We don’t do a 100% correct sort of particles wrt other transparent geometry. No other game does. We do per-object sorting of emitters and other transparent parts/decals. You’re inside a giant transparent object so you’re witnessing the effects of sorting object positions which does not make sense here.

  2. Our current CSG decal implementation is including all triangles in the decal mesh instead of just the ones that need the texture from the relevant side projected. This has some other issues so we’re planning to fix it.
    You can observe 2 by enabling bounding box visualization (ShowBoundingBoxes in Studio Rendering settings), creating a CSG part with 1 decal and making the part Transparency=1. Note how the bounding box envelops the entire part instead of just the decal faces.

  3. We have a special-case optimization for trees that merges decal geometry on the same part in a single object. This is important since if you have a transparency=1 block with 6 decals you don’t want to use 6 draw calls to render that - and this was a semi-common case when the rendering system was developed (all those Minecraft games :-/)

  4. Your Sky object has decals only on one face, but a mesh that covers the entire area, making decisions about rendering order complicated - even changing 2/3 above would not fix it.

So, we plan to fix 2 - but fixing it alone is not enough. Here’s my recommendation (I have not tried it):

  • Segment Sky geometry into at least 5 pieces - top/left/right/bottom/front. Make it so the top has its bottom point way above the character height.
  • Segment Sand geometry into 5 pieces - top/left/right/bottom/front. Top can have just the cap.

This should in theory be enough to fix this. The second part would not be necessary if not for 2/3 above - we’ll fix 2 but 3 is harder to fix since it’s required for performance on some levels.

1 Like

In general transparency in real-time graphics does not have good solutions that are both reasonably performant and visually consistent. We usually try to fix issues if they are fixable within the object-sorting framework (e.g. @asimo3089 reported a transparency sorting issue some time ago that was actually a bug / precision issue in our code and we since fixed that), but we can’t really have a 100% correct solution :frowning:

There is one reasonably cost-efficient approach that I’ve been meaning to try but even that probably won’t work on all hardware and it has confusing behavior if the objects are really close - if the transparent layers are far enough it results in believable rendering but in cases like @Rindir has posted it would result in the loss of depth perception on these layers and it’s not clear that this can work in ROBLOX.

This also happens when you overlap transparent parts.ezgif.com-video-to-gif.gif

DecalProblem.rbxmx (22.9 KB)