Rendering Updates - April 2017

We’ve implemented a bunch of fixes/improvements recently and this is a thread that tells you what got better and how :slight_smile: Thanks to @maxvee, @Qiblox and @zeuxcg for the hard work!

Improved Z precision

On the systems that can support this (most Windows systems, all Xbox systems and most iOS systems - this is currently not available on Mac or Android) we’ve implemented several tweaks that improve precision of storage & computation for depth of all objects. Practically this means two things:

  • Z fighting got significantly improved when this change is active, especially with content that’s built far from origin (0,0,0)
  • Near plane is now at 0.1 instead of 0.5 when this is enabled
  • In VR, where previously near plane was already 0.1 but there was a lot of Z-fighting as a result, near plane is still 0.1 but Z-fighting is dramatically reduced

Note that you still can not rely on the near plane being 0.1 for desktop games, mostly because of Mac where we can’t enable this change because of OpenGL issues. We’re taking a look at moving to Metal on Mac which would solve this problem (for Metal-capable Macs…). Stay tuned.

Correct(ish) GUI ordering

We have changed the way 3D GUI renders to solve a long-standing transparency ordering issue where Surface or Billboard GUI would always render on top of transparent objects, including parts and particle systems. Now GUI should be correctly sorted wrt decals, parts and particles.

Now, please keep in mind that we’re still not able to achieve a perfect sort order because the algorithm we use to determine which object should be in front of another object does this per-object, not per-pixel, and sometimes it guesses wrong. Still, this basically means that GUI is ordered appropriately as well as any other transparent objects, so there’s no GUI specific transparency sorting bugs any more.

This is currently live on desktop, and will be rolling out to Xbox and mobile in the coming weeks.

Small fixes

We keep working on tactical improvements that fix bugs, reduce crashes, memory consumption and improve performance. Here are fixes from the last month or so:

  • Stability improvements for Direct3D 9 (for Windows XP and very old GPUs)
  • Performance improvements for lighting update on some Intel GPUs
  • Make particle emission more uniform for EmissionDirection != Top
  • Fix particle emitter visibility issues (particles should no longer disappear when emitter goes out of the view)
  • Faster visibility culling (saves 1-2 ms/frame on complex levels, more on mobile/Xbox)
  • Neon parts causing transparency issues on some Macs in Studio and also in VR
  • Reduce stuttering when loading places with large amounts of CSG/MeshParts
  • Fix parts with NaN CFrames causing objects to disappear depending on where the camera is pointing

Feel free to post any questions or issues that you suspect may be related to any of these.

We are working on more performance and memory optimizations and also features but they will be a subject for future threads.

75 Likes

THANK YOU SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO SO MUCH FOR THIS OMG

This is awesome for FPS games or anything with first person! For those of you that don’t know what this does, it basically means that you can move parts much closer to the camera (5x closer!) before they begin to do that weird thing where you can ‘see through’ them.

Also when can we expect to see this on more devices and what’s a rough estimate of how many people have this? 10%, 50%, 75%?

18 Likes

The weird thing where you can see through them is typically called “clipping” :wink:

Current breakdown:

Windows 96%
iOS 80%
Xbox 100%
Android 0%
Mac 0%

For Android there’s not much hope :frowning: We’ll see what it ends up being on Mac once we port to Metal.

7 Likes

Some people on my game experience part clipping while I didn’t, hopefully this fixes it!

1 Like

You mention this is supported on only some systems, but only announced plans to resolve the problem for Metal-capable Mac devices. Will the clipping plane remain at 0.5 on some devices? If so, can we get a property in Camera so that we know what its near clipping distance is?

1 Like

I think once we figure out Mac support we can look into that; I’m sort of curious as to how you’d use this - my impression has been that you basically want to design the game for a specific value, so for a desktop game you really want 95% coverage and then say that the other 5% will have clipping issues, but maybe I’m thinking of a different use case.

1 Like

Is the Mac support something that we’ll see in 2017? I’d love to start designing my games with it asap.

I guess if you’re fine with clipping issues on some devices, you wouldn’t need to know the clipping distance. Depending on what devices support the 0.1 near clipping, I might want to provide those users the next best thing. If only devices that can barely play the game experience the issue, I might not care, but otherwise 5% is still a lot of people for a popular game.

About that in regards to the particle limit, Ive come across times where I wanted more particles in my place but because of the limit I couldn’t get any more. Having it so the engine doesn’t load particles that aren’t in view would allow us to fit more.

The limit would still be there though, but whats happening now is lets say I have 30 emitters behind me and one in front, the one in front in restricted and produces less particles by the ones which aren’t even in view.

Now when more emitters come into view, less particles are shown as it reaches the limit.

1 Like

Thank you so much for this update! As far as I can tell it the update fixed all of my Z-Fighting issues even with parts that have a .005 scale difference and over 2k studs from the origin. bless up

Yeah I sort of understand where you’re coming from, I’m just not sure what exactly you’d do in case you’re making a game and we tell you 0.5.

Ultimately for games that want 0.1 it’s a tough call because unless you’re on a platform/API where we can switch to the new representation, you’re choosing between clipping (if near plane is 0.5) and really bad Z fighting (if near plane is 0.1). We’ll need to look into what exactly happens with smaller values on platforms that don’t support higher precision Z and what we can do about it.

@ScriptOn, we’re planning to switch to Metal on Mac this year but I don’t have a precise timeline and also I’m not sure how many issues we’ll see (I heard Metal is less stable on Mac compared to iOS, so we may have to work around some things) and thus it’s hard for me to predict anything here.

1 Like

With aiming down sights, I’d just push the weapon further from the camera. Would look a bit weird, but it’s definitely better than having chunks of the gun missing.

This is amazing!

This tunnel a couple dozen thousand studs from the origin looks beautiful now, and the cars look great this far out too! Everything used to be a garbled mess this far away, but look at it now:

Thanks guys for all your hard work!

18 Likes

I’m having a little bit of an issue with it.

Decals with transparency are drawn further back than transparent parts.

This update has actually made the near plane even farther than before on unsupported systems. I have a ton of clipping on parts even remotely close to my camera on Mac. Really hoping this feature makes it to Mac soon… is there an ETA by any chance?

Do you have a before-image?

So what this property could allow us to do is have a special state for cameras where there are clipping issues.

Like, this wouldn’t work very well in all cases but it would be somewhat functional; you could just move the camera back by 0.4 studs on devices with a 0.5 near plane.

But yeah, even though it’s such a seemingly small update, it’s very powerful and opens up a new world of potential for first person games. This is definitely one of my personal favorite updates to ROBLOX! Thank you so much!

This is the closest I have to a before image.

I specifically tried finding a camera angle that wasn’t screwed up when I took this, so the z-fighting isn’t obvious at first glance. You can see it in a few places:

  • Behind the fender of the white van in the oncoming lanes
  • The right brake light of the orange pickup truck in the right shoulder
  • The joints in the triangle terrain, especially between the tunnels
  • The lights in both tunnels
1 Like

Nvm.

I think near plane on Mac was closer than 0.5 before the update due to a bug and is precisely 0.5 after, matching all other systems that don’t support high precision depth.