Vulkan Rendering with Unity

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
afritz1
Posts: 43
Joined: Thu Nov 24, 2016 1:19 am
Contact:

Vulkan Rendering with Unity

Post by afritz1 »

With the release of Unity 5.6, Vulkan was added as another rendering API for Unity. This can significantly improve rendering performance because Vulkan was designed with zero driver overhead in mind and can make certain optimizations that older APIs cannot. As far as I know, you just add Vulkan to the list of graphics APIs in the player settings and your project will use it instead of OpenGL or Direct3D. It should all work automatically as GLSL is converted to SPIR-V for you.

Some older graphics cards might not support Vulkan, so you should still keep one of the other APIs around as a fallback. It looks like Daggerfall Unity requires Unity 5.5.0f3, so this shouldn't be too big of a jump for anyone.

Narf the Mouse
Posts: 833
Joined: Mon Nov 30, 2015 6:32 pm

Re: Vulkan Rendering with Unity

Post by Narf the Mouse »

afritz1 wrote:With the release of Unity 5.6, Vulkan was added as another rendering API for Unity. This can significantly improve rendering performance because Vulkan was designed with zero driver overhead in mind and can make certain optimizations that older APIs cannot. As far as I know, you just add Vulkan to the list of graphics APIs in the player settings and your project will use it instead of OpenGL or Direct3D. It should all work automatically as GLSL is converted to SPIR-V for you.

Some older graphics cards might not support Vulkan, so you should still keep one of the other APIs around as a fallback. It looks like Daggerfall Unity requires Unity 5.5.0f3, so this shouldn't be too big of a jump for anyone.
My understanding is that the switch to 5.6 is in progress...But it's not that simple. Different Unity Engine versions have different bugs, features, and fixes, which means that updating to 5.6 is a lot more complex than the switch to Vulkan once you're there. :)

First you have to figure out everything that's now broke, everything that now works, and make a new set of work-arounds...

Anyway, I don't have any insider info, so take this with Metaphorical solid crystalline Sodium Chloride. :)
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Vulkan Rendering with Unity

Post by TheLacus »

There is a problem with procedural terrain generation with 5.6; anyway, it will surely be interesting to try vulkan when DU wiil get there.

User avatar
afritz1
Posts: 43
Joined: Thu Nov 24, 2016 1:19 am
Contact:

Re: Vulkan Rendering with Unity

Post by afritz1 »

Good to know. I haven't been using modern Unity for very long so I'm not completely up to speed with the bugs and workarounds yet. I just thought I'd mention Vulkan since it's a very interesting path to take for rendering, and most of the work is done for you by Unity :). I've only done about a quarter of the Vulkan tutorials so far because it's much more verbose than OpenGL. I'd like to do some graphics experiments with it sometime for fun. I've already done a lot of ray tracing with OpenCL, but it doesn't provide a graphics API, so it's not the best choice for high-performance rendering. Vulkan on the other hand has both a graphics and compute API, so it's a much better option.

Narf the Mouse
Posts: 833
Joined: Mon Nov 30, 2015 6:32 pm

Re: Vulkan Rendering with Unity

Post by Narf the Mouse »

afritz1 wrote:Good to know. I haven't been using modern Unity for very long so I'm not completely up to speed with the bugs and workarounds yet. I just thought I'd mention Vulkan since it's a very interesting path to take for rendering, and most of the work is done for you by Unity :). I've only done about a quarter of the Vulkan tutorials so far because it's much more verbose than OpenGL. I'd like to do some graphics experiments with it sometime for fun. I've already done a lot of ray tracing with OpenCL, but it doesn't provide a graphics API, so it's not the best choice for high-performance rendering. Vulkan on the other hand has both a graphics and compute API, so it's a much better option.
Yeah, I agree with that.

Bit of *history, for those who don't know. Because if you're familiar with my posts on here, I love to explain things. :)

Back when DirectX first came out, most game programmers weren't too sure what about this new 3D stuff, or how to use it. So DirectX was deliberately written to handle a lot of the **details for you. And it worked; other APIs may have been, or were, faster; but DirectX was easier to use. And ease of use winneth a lot. So it got more and more popular, 3D game development advanced, CPUs gained multiple cores...And something else important happened.

Game developers now had a *much* greater handle what about this 3D stuff is. ;)

Now, DX9 introduced some ability to render from multiple threads (it's in the render options when you create the device). DX10 and DX11 expanded on multi-core rendering...and went even more low-level.

So, then experiments like Metal and early Vulkan (built from OpenGL) started showing up. And Microsoft needed a competitor. And for that...They'd only need to keep heading in the same direction they (and everybody else) already were.

Add more multi-core capability...And go even more low-level. Exactly what Metal and Vulkan were doing.

And thus, the current ***wave of graphics APIs. Because game programmers now know a lot better about what needs to be done than the graphics API, and because CPUs have multiple cores these days as a ^matter-of-fact.

* As I understand it. In 1995, I was over two decades younger.

** 3Dfx's Voodoo cards used a proprietary Glide API which allowed more low-level control; however, 3Dfx failed for management and marketing reasons unrelated to their API, and this post. ;)

*** All three? four? of them.

^ If this stopped being true, I would expect it to be part of some sort of material paradigm shift in CPU manufacture. Probably relating to no longer using silicon. :)
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.

Post Reply