RayTracing / gpu-tracing

Ray tracing on GPU systems
https://raytracing.github.io/gpu-tracing
Creative Commons Attribution 4.0 International
98 stars 6 forks source link

Rolling list of comments and issues in book #10

Open trevordblack opened 1 month ago

trevordblack commented 1 month ago

I'll add a serious of rolling issues in the book

trevordblack commented 1 month ago

"Rendering a complex scene takes a long time and this get worse as the rendered scenes get complex."

Missing a word? "This can get worse"? "this gets worse"?

trevordblack commented 1 month ago

"Notably, modern GPUs are now equipped with hardware cores dedicated to ray tracing."

Maybe don't mention this functionality as I don't believe we'll be using these cores?

trevordblack commented 1 month ago

"... The accompanying code intentionally avoids hardware ray tracing APIs that are present on newer GPU models, instead focusing on implementing the same functionality on a programmable GPU unit using a shading language. "

If I was brand new to GPUs what exactly a shading language is would not be clear to me. Nor would it be clear if a shading language can't use the ray tracing APIs.

perhaps elaborate: ""... The accompanying code intentionally avoids hardware ray tracing APIs that are present on newer GPU models. These ray tracing APIs are designed to control the GPU's dedicated ray tracing hardware cores. This book instead focuses on implementing the same ray tracing functionality solely through writing GPU software in a shading language. This shading language can run on old GPUs that don't have dedicated ray tracing cores"

I'm not sure what would be best here. play with it.

trevordblack commented 1 month ago

" In my examples I use an API based on WebGPU, which I think maps well to all modern graphics APIs. "

perhaps mention WebGPUs comparative ease of use

trevordblack commented 1 month ago

"I tried to avoid external dependencies as much as possible except for the following: "

to

"I tried to avoid external dependencies as much as possible but I decided to include the following:"

trevordblack commented 1 month ago

You my want to drop the code/template directory. It's intermediate source that someone following along with the book will build on their own.

There's value in a "If you don't care about windowing you can use the prebuilt template in code/template and skip to chapter 3" but as near as I can tell, you're not explicitly doing that.

trevordblack commented 1 month ago

You need to point the reader at resources for rust beginners. Two important things to point to

  1. what does Cargo.toml do?
  2. how do I even build and run a rust program?

You may not need to make these assumptions of your audience (and assume that they can figure all of this stuff on their own), but it's reasonable to assume that your audience is not an expert in rust, even if they may be an familiar with graphics concepts

trevordblack commented 1 month ago
use {
    anyhow::{Context, Result},
    winit::{
        event::{Event, WindowEvent},
        event_loop::{ControlFlow, EventLoop},
        window::WindowBuilder,
    },
};

leads to

trevor@tdb:~/webgpu/my_gpu_tracing$ cargo build
   Compiling my_gpu_tracing v0.1.0 (/home/trevor/webgpu/my_gpu_tracing)
error[E0412]: cannot find type `Window` in this scope
  --> src/main.rs:53:34
   |
53 | async fn connect_to_gpu(window: &Window) -> Result<(wgpu::Device, wgpu::...
   |                                  ^^^^^^ not found in this scope
   |

needs to have

         window::{Window, WindowBuilder},
trevordblack commented 1 month ago

I'm running on linux and wayland. I ran into this: https://github.com/rust-windowing/winit/discussions/3164:

Which is a known quirk on wayland:

https://docs.rs/winit/latest/winit/platform/wayland/index.html

Note: Windows don’t appear on Wayland until you draw/present to them.

the brute force solution of forcing X11 fixed the no windows bug

export WAYLAND_DISPLAY=

But I get a thread panic regardless of which windowing system I use:

thread 'main' panicked at src/main.rs:40:26:
failed to get current texture: Timeout

I'll work backward to figure out that one. It's possibly a driver bug

trevordblack commented 2 weeks ago

"Interpolating from blue towards a reddish color instead of pure white can resemble twilight. Give vec3(1., 5. 0.3)) a try. "

Give vec3(1., 0.5, 0.3)) ?