Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rolling list of comments and issues in book #10

Open
trevordblack opened this issue Jul 12, 2024 · 10 comments
Open

Rolling list of comments and issues in book #10

trevordblack opened this issue Jul 12, 2024 · 10 comments

Comments

@trevordblack
Copy link
Collaborator

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

@trevordblack
Copy link
Collaborator Author

"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
Copy link
Collaborator Author

"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
Copy link
Collaborator Author

"... 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
Copy link
Collaborator Author

" 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
Copy link
Collaborator Author

"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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

I'm running on linux and wayland. I ran into this: rust-windowing/winit#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
Copy link
Collaborator Author

"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)) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant