Search Unity

Real-time pathtracing without RTX?

Discussion in 'General Discussion' started by HonoraryBob, Aug 2, 2019.

Thread Status:
Not open for further replies.
  1. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    Someone made a Minecraft shader pack which is described as a set of realtime pathtracing shaders that run on normal video cards, without the need for hardware-accelerated raytracing. Maybe I'm missing something, but this makes no sense to me: sure, you can do realtime pathtracing if you render it on a single quad with a single shader rendering the whole thing, but Minecraft doesn't render on a single quad and a modded shader pack can't rewrite the basic game code. Videos of the shader pack indicate (to me, anyway) that all of the effects could be done with standard techniques (e.g. a grabpass shader to make refracting glass surfaces), with no real need for pathtracing.

    Here's a video showing what it looks like :


    And here's the author's Patreon page, where he's making nearly $40,000 per month selling it: https://www.patreon.com/sonicether

    The reason I'm asking about this is because I had wanted to spiff up my own graphics with some limited form of raymarching or similar in combination with normal geometry (which is what he's allegedly doing), but it would be enormously difficult to do that on separate objects rather than rendering the whole scene on a single quad. If there's a way to do it, I'd be interested.
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    One very important thing you have to understand about that shader is that it's engineered entirely for Minecraft. It's able to achieve the performance it does because it takes into account the way the world is made up of cubes.
     
    chingwa and Antypodish like this.
  3. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    But what exactly is it doing? Presumably he would have to have separate materials on different objects (in this case different types of blocks), which would prevent pathtracing because there's no way for the shader(s) to gain access to information about the geometry in the scene. Realtime pathtracing can only be done if a single shader is rendering the whole scene to a single quad using math to represent the "geometry" - e.g. Inigo Quillez has produced a lot of amazing photorealistic raymarching shaders, but they produce everything mathematically from a single set of equations, not from polygon geometry. Minecraft uses polygon geometry.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    He occasionally streams and answers questions but I don't remember much of anything from the last time he did it and any of the explanations he gives just go way over my head.

    Honestly though this doesn't strike me as accurate. I haven't looked too deeply into the way it's handled now but this strikes me as much more of an explanation for raytracing before we had general purpose shaders (ie before DirectX 12, Vulkan, etc). Modern raytracing is handled similarly to compute shaders as mentioned in the blog below.

    https://devblogs.nvidia.com/introduction-nvidia-rtx-directx-ray-tracing/
     
    Last edited: Aug 2, 2019
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    By the way if you're curious there is an explanation of how the raytracing cores on NVIDIA's RTX series are accelerating raytracing and the short answer is that they're just accelerating the Bounding Volume Hierarchy checks. That is to say they're just checking if a ray intersects with a box followed by any triangles.

    NVIDIA's Tensor cores (AI-centric cores) are handling the denoiser but aside from these two tasks everything is going through the same shaders that have been shipping with their cards for years. Which is why you can totally run RTX apps with the GeForce 10 series of cards albeit at a greatly reduced frame rate.

    https://en.wikipedia.org/wiki/Bounding_volume_hierarchy
    https://devblogs.nvidia.com/nvidia-turing-architecture-in-depth/
     
Thread Status:
Not open for further replies.