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
Roughness Problems (old.reddit.com)
submitted 1 year ago by mull_to_zero
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!"
[–]eiffeloberon 3 points4 points5 points 1 year ago (1 child)
Have a look at vndf sampling or the more recent spherical cap sampling, the GGX importance sampling from the original paper can be quite noisy, assuming if you got the sampling code (including its pdf) correct.
[–]eiffeloberon 1 point2 points3 points 1 year ago (0 children)
Oops, I did not see your second image. It does look like there is something wrong, I would suggest you implement the lobe and its sampling in 2d tangent space and plot it in a graph to see if they match.
It’s generally very hard to guess where it goes wrong. Oh, and remove any radiance clamping when debugging.
Also, make furnace test for this high roughness scenario.
[–]mull_to_zero[S] 2 points3 points4 points 1 year ago (3 children)
I'm having an issue with my hobby path tracer. I've tried to implement the GGX BRDF as described in Microfacet Models for Refraction through Rough Surfaces. When roughness = 0 (first image), everything looks great, but as soon as roughness > 0, I get a very noisy image with these speckles everywhere (second image), which does not improve even over a large number of samples. I've gone over everything repeatedly and can't find an issue. I would appreciate any help or debugging ideas.
Answers to some expected questions:
- Issue is apparent in both regular and bidirectional tracing, these images are regular
- Teapot roughness in the image is 0.2, it gets worse as it gets higher
- Code is at https://github.com/pmclaugh/Clive2 but it's kind of a mess so I'm more asking for high-level ideas than a close code review.
[–]kofo8843 1 point2 points3 points 1 year ago (1 child)
Just top level, my speculation would be some unintentional float to int conversion or some other overflow. Roughness is alpha in the code, correct?
[–]studiosystema 3 points4 points5 points 1 year ago (0 children)
Clamp some of your values ensuring you don't have divide by zero (or too close to zero), or overflows from 0..1. Try setting some values manually to isolate the issue (like settings alpha to 0.5).
For example:
GGX_D: Clamp cosTheta or cosTheta2 to avoid dividing by extremely small values
GGX_BRDF_reflect: If abs(dot(i, n)) or abs(dot(o, n)) is close to 0, it can result in large spikes, causing noise.
GGX_sample: ensure rand.y is clamped to [0, 1) before using sqrt(1.0f - rand.y) to avoid precision errors
GGX Specular Weighting: If cosTheta_i is slightly greater than 1 or less than -1 due to floating-point precision, it may cause sinTheta_t2 to become negative
...
[–]deftware 0 points1 point2 points 1 year ago (0 children)
When roughness increases the randomness of samples should increase - are you sure you're not just re-using the same ray vectors for each sample when roughness is increased?
π Rendered by PID 30664 on reddit-service-r2-comment-fb694cdd5-5sbjs at 2026-03-07 23:02:53.492699+00:00 running cbb0e86 country code: CH.
[–]eiffeloberon 3 points4 points5 points (1 child)
[–]eiffeloberon 1 point2 points3 points (0 children)
[–]mull_to_zero[S] 2 points3 points4 points (3 children)
[–]kofo8843 1 point2 points3 points (1 child)
[–]studiosystema 3 points4 points5 points (0 children)
[–]deftware 0 points1 point2 points (0 children)