Jump to content
Sign in to follow this  
Inu

X-Plane 12 Rendering Engine Plan (Mesh shaders coming?)

Recommended Posts

Mesh shaders are the GPU-programming equivalent to what Vulkan is in the graphics engine API arena. More versatile but requires dev input to a degree that has historically been handled at the "driver level" (e.g. VRAM cleanup) to make work. It replaces fixed-capability functions with customized, app-specific code. Makes things more efficient and less resource-hungry and therefore more and smoother FPSes.

  • Like 2

Friendly reminder: WHITELIST AVSIM IN YOUR AD-BLOCKER. Especially if you're on a modern CPU that can run a flight simulator well. These web servers aren't free...

Share this post


Link to post
Share on other sites
8 hours ago, blingthinger said:

Mesh shaders are the GPU-programming equivalent to what Vulkan is in the graphics engine API arena. More versatile but requires dev input to a degree that has historically been handled at the "driver level" (e.g. VRAM cleanup) to make work. It replaces fixed-capability functions with customized, app-specific code. Makes things more efficient and less resource-hungry and therefore more and smoother FPSes.

maybe, not convinced, the only thing "new" here Im seeing is the ability to add some code that does more than "is this bit of data in the field of view" before the gpu decides to do calculations on it. Not sure I trust how any of the theoretical explanations translate into actual code. 

And even that is just "standardising" it and dedicating some silicon to it, because devs have been doing that in the compute shaders since there were compute shaders.

I had a quick look around to see where its up to, been a while, seems Alan Wake 2 beat Laminar to being the first to do it themselves:

https://www.pcgamer.com/mesh-shaders-explained/

Quote

When it was first announced that Alan Wake 2 needs a graphics card that supports mesh shaders to run, PC gamers with AMD RX 5000-series or Nvidia GTX 10-series GPUs were immediately disappointed. It turns out the game will actually run without them, but the performance is so poor that mesh shader support really is a must.

reading that, I'm not even sure you can call them mesh shaders on anything not running DX12U. Which is backwards and somewhat comedy, because nanite on console is PS5 exclusive.

Edited by mSparks

AutoATC Developer

Share this post


Link to post
Share on other sites
12 hours ago, mSparks said:

"is this bit of data in the field of view"

It's more than just culling triangles. It's the ability to reuse existing geometry and render buffers through all functions (less VRAM), controlling exactly what processing happens at each step (everything, not only culling), and more control over the parallelization of each step.

Compute shaders don't explicitly control how the triangles are rendered. They're an aside from the main render pipeline. For example, the surface of the 3D water in XP is computed with a Fourier method in a compute shader. The compute shader (shader is a terrible name for its task) doesn't do the actual drawing. The new 3D coordinates are then fed into the render pipeline. Mesh shaders would allow LR to eliminate unnecessary triangle processing much like Vulkan eliminated all the unnecessary driver overhead in openGL.

I'm not holding my breath for mesh shaders in XP in short term.


Friendly reminder: WHITELIST AVSIM IN YOUR AD-BLOCKER. Especially if you're on a modern CPU that can run a flight simulator well. These web servers aren't free...

Share this post


Link to post
Share on other sites
Posted (edited)
5 hours ago, blingthinger said:

It's more than just culling triangles. It's the ability to reuse existing geometry and render buffers through all functions (less VRAM), controlling exactly what processing happens at each step (everything, not only culling), and more control over the parallelization of each step.

Mesh shaders are

https://www.khronos.org/blog/mesh-shading-for-vulkan

5 hours ago, blingthinger said:

Compute shaders don't explicitly control how the triangles are rendered.

rasterisation stage is identical with/without mesh/task shaders, 

Edited by mSparks

AutoATC Developer

Share this post


Link to post
Share on other sites
Posted (edited)
On 12/31/2023 at 5:53 AM, mSparks said:

OP's first link takes that one and extends the descriptions a bit more.

https://developer.nvidia.com/blog/introduction-turing-mesh-shaders/

meshlets_comparison-1024x524.png

The flexibility offered by mesh shaders would require a fair bit of code writing beyond the current vs/gs/ts pipeline.

The functionality isn't new to compute shaders, but it is entirely new for the render pipeline. More control than the fixed-function pipelines of old. Just like Vulkan did vs openGL.

Edited by blingthinger

Friendly reminder: WHITELIST AVSIM IN YOUR AD-BLOCKER. Especially if you're on a modern CPU that can run a flight simulator well. These web servers aren't free...

Share this post


Link to post
Share on other sites
7 minutes ago, blingthinger said:

The flexibility offered by mesh shaders would require a fair bit of code writing beyond the current vs/gs/ts pipeline.

like I said afaict they already do "most" of that with the water and trees, the only thing "new" is the better culliing. I'd say we're well behind when they wanted to make an announcement for that, Austin was talking about it in the works like 4 years ago. given how close they are to AMD, Nvidia, khronos and the rest of that crew I would be very surprised if work didn't start on making use of VK_EXT_mesh_shader the minute it hit the vulkan spec - sept 2022, in fact that seems like a pretty reasonable explanation for why we still have a lot of XP11 scenery, plus it needs doing in metal as well, which also dropped in 2022

https://developer.apple.com/documentation/metal/metal_sample_code_library/adjusting_the_level_of_detail_using_metal_mesh_shaders?language=objc


AutoATC Developer

Share this post


Link to post
Share on other sites
4 hours ago, mSparks said:

they already do "most" of that with the water and trees, the only thing "new" is the better culliing. I'd say we're well behind when they wanted to make an announcement for that, Austin was talking about it in the works like 4 years ago

It's not really the same thing. Not exactly a cut and paste operation. The water surface comes out of the FFT as a structured mesh of squares that needs to be tessellated. Tree motion calcs don't have anything to do with triangles.

Writing the underlying buffer sharing, GPU parallelization, and adding broad scale tessellation (if they go that route) is the non-trivial task I'm referring to. It's more than just deciding which triangle to draw. "New" in the sense that lots of new lines of code will exist.

I'm all for being pleasantly surprised that this is sooner rather than later. I fully expect that if they do jump into more tessellation (beyond just water) that it will be well implemented. E.g. there won't be AI aircraft pulling a "transformers mutation" in close air to air formation...


Friendly reminder: WHITELIST AVSIM IN YOUR AD-BLOCKER. Especially if you're on a modern CPU that can run a flight simulator well. These web servers aren't free...

Share this post


Link to post
Share on other sites
On 12/30/2023 at 6:17 PM, Inu said:

 

5) Ground texture tiling bug: There is a bug with the tiling shader that X-Plane uses for some of the ground textures, it is already fixed according to the bug tracker, not known when it ships though. IIRC it happens mostly using Nvidia GPUs when using anisotropic filtering. 

 

I can confirm it is fixed and already shipped in 12.0.08. 🙂

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...