WebGLpbr
WebGLpbr copied to clipboard
Flickering of specular(?) areas of material
First off, thank you for putting these together. I'm currently learning about how to implement things like cook-torrance and hooking it up with an environment map so this is proving very helpful.
One thing I noticed when running the demo is that the specular(?) areas on the material are flickering and have a sort of dotted appearance. Is there a reason for this? If so, is there a way to stop it from happening so the resulting material / look is static?
Thanks for your question! If I am understand your question correctly, I think the reason why there are flickering thing is because for PBR, there is sampling process which is shooting different ray from one point to gathering the color for this point. This sampling process is using an random function to determine the direction of the ray for each frame. I think if we increase the sampling number, this artifact will be less obviously. Here is the code where is using the random function. https://github.com/tiansijie/WebGLpbr/blob/master/index.html#L198
Thanks for the reply, and sorry for the delay!
If this method is sampling in random directions every frame then that would definitely make sense why there's a flickering / pixelation-style effect on the models as you move around. I noticed that this doesn't happen on other PBR implementations so I'm sure there's a fix somewhere.