I’ve always wanted to get into graphical programming but I always get hung up on creating anything. Shaders feel like black magic to me. And the tutorials are spread across many different technologies and techniques that it’s hard to determine where you should start.
qbasic_forever|5 years ago
d26900|5 years ago
But he has 2 more:
https://gamephysicsweekend.github.io/
And you can do a very simple one in much less than 30 lines in C. ;)
Edit: Oops, it was the wrong one... This is the right one:
https://raytracing.github.io/
Sorry!
vineek|5 years ago
jolmg|5 years ago
Or a business card's worth of space:
https://fabiensanglard.net/rayTracing_back_of_business_card/
ggambetta|5 years ago
kemiller2002|5 years ago
In all seriousness. It sounds like a cool book. Can’t wait til it arrives. Thanks for writing it!
d26900|5 years ago
Edit: (If I wouldn't be so poor, I would donate to your cause as well.)
jak6jak|5 years ago
d26900|5 years ago
- Write a software rasterizer
- Write a software ray tracer
You can do all that without exiting a programming language's standard library.
I wrote a simple ray tracer (primary rays only) in vanilla C89 in about 30 lines (if you don't count the PPM image library that I made):
https://github.com/d26900/JamaisVu/blob/main/tests.c
Lines 66 - 91.
Screenshot: https://raw.githubusercontent.com/d26900/JamaisVu/main/scree...
Here are great resources:
- https://www.scratchapixel.com/
- https://www.gabrielgambetta.com/computer-graphics-from-scrat...
- https://erkaman.github.io/posts/junior_graphics_programmer_i...?
- http://immersivemath.com/ila/index.html
CapriciousCptl|5 years ago
gfxgirl|5 years ago
Shadertoy can be fun and you can learn lots of techniques and lots of math but you aren't learning graphics
MikeSchurman|5 years ago
tpmx|5 years ago
Try to find a small and unusually talented team doing what you want to learn, and get hired by them. There is no substitute to learning from smart/experienced people.
(This is after learning the basics + the intermediate stuff.)
dataduck|5 years ago
theschwa|5 years ago
What kinds of things would you ultimately like to make?
[0] - https://thebookofshaders.com/
jak6jak|5 years ago
Arelius|5 years ago
The other key thing to understand, is that a GPU is across a network (PCI-X network generally) So when you call dispatch, your generally sending a message (encoding a command in a command buffer) to do the work later on on a different device.
Arelius|5 years ago
> [numthreads(64, 1, 1)] > void main(uint3 threadIdx : SV_DispatchThreadID) {
the dispatch size (x, y, and z) are multiplied by the numthreads components (Some compiler SIMD stuff requires this) And that sum total threads (x * y * z) are launched. the index of the thread this particular invocation is launched on is left in threadIdx, you can then use that index to read and write from other buffers.
This is HLSL, but the same generally applies to most APIs. Then more of this just becomes implicit and behind the scenes for shaders dispatched in other contexts, since more is known implicitly about the context, and more is done by other units of the hardware.
bialpio|5 years ago
soylentgraham|5 years ago
Starting with a software renderer is nuts.
Start with unity, make an unlit shader, start doing basic effects (in colours, then using texture samples) using uv coordinates. (In frag, ignore vertexes to start with). Just remember youre just colouring a pixel, on a bit of a surface.
d26900|5 years ago
No, not really. You can write a simplistic ray tracer and rasterizer in about 10 - 50 lines tops:
https://github.com/d26900/JamaisVu/blob/main/tests.c
Lines 66 - 91.
The result/screenshot: https://github.com/d26900/JamaisVu
If this is "nuts", then so be it. Let me be nuts. :P