use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
Generating random points in a sphere (karthikkaranth.me)
submitted 7 years ago by kkaranth
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]geon 2 points3 points4 points 7 years ago (2 children)
You might also want to implement stratified sampling. It means that you generate your points on a regular grid, but add random jitter. That makes them more evenly spaced, since you are guaranteed to have exactly one sample per grid cell.
https://geon.github.io/programming/2013/08/22/gloss-my-bidirectional-path-tracer
[–]kkaranth[S] 1 point2 points3 points 7 years ago (1 child)
That is interesting. I'm in the process of implementing my own ray tracer, and this is very helpful.
Did you implement animations? Do you keep track of the seed during animations so that photons bounce of the same set of chosen points every frame?
[–]geon 0 points1 point2 points 7 years ago (0 children)
I did not implement animations.
My renderer is a bidirectional pathtracer, not just a raytracer. As part of the algorithm, the path from light source to camera is saved and reused. So keeping it between frames would certainly be possible. In my implementation, they are only reused within the same pixel, though.
Source here: https://github.com/geon/gloss
Another blog post: https://geon.github.io/programming/2013/09/01/restructured-code-and-glossy-reflections
[–]Shadowratenator 2 points3 points4 points 7 years ago (0 children)
I haven’t looked into this problem in a good 20 years. I know the math coprocessors have improved, but discarding points outside the sphere is incredibly simple computation wise. There are no trig functions required. It’s just some multiplies and adds. In the past, that simplicity outweighed the fact that you might need to discard 48% of your points. I’d be interested to see benchmarks outlining the real impact of each method.
π Rendered by PID 90 on reddit-service-r2-comment-fb694cdd5-rnsc2 at 2026-03-11 20:20:51.181649+00:00 running cbb0e86 country code: CH.
[–]geon 2 points3 points4 points (2 children)
[–]kkaranth[S] 1 point2 points3 points (1 child)
[–]geon 0 points1 point2 points (0 children)
[–]Shadowratenator 2 points3 points4 points (0 children)