WebGLpbr icon indicating copy to clipboard operation
WebGLpbr copied to clipboard

Flickering of specular(?) areas of material

Open robhawkes opened this issue 9 years ago • 2 comments

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?

robhawkes avatar Oct 13 '15 16:10 robhawkes

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

tiansijie avatar Oct 16 '15 20:10 tiansijie

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.

robhawkes avatar Nov 11 '15 09:11 robhawkes