PeapBoy Posted November 10, 2016 Share Posted November 10, 2016 Hello world First of all, BIG THANKS to @Sebavan for its amazing PBR Material ! I'm taking a lot of fun playing with the differents features. On monday, I enjoyed playing with microsurface parameter. It worked really fine until I added a bumpTexture.After diving into the code, I understood that microsurface is handled in two different ways : EXT_shader_texture_lod WebGL extension is supported, LODBASEDMICROSURFACE define is added to the shader, and we can sample reflection texture with the good LOD level. EXT_shader_texture_lod WebGL extension is NOT supported, no define is added to the shader, we don't have access to LOD level and we have to bias mipmap level when sampling to fake LOD level or something like that. Both ways seem to work fine when I don't use bumpTexture. But if I add a bumptexture to the PBR material, then only the first option works. With the second option, we can see some flickering or pixelation, I don't know how to call that (left plane on the picture) : Here is a basic PG showing the PBR material with all these parameters (this one should work !) : http://www.babylonjs-playground.com/#19SMAD#3 And here is the same PG, but I intentionally disabled the extension, to see how it works on devices which do not support the extension : http://www.babylonjs-playground.com/#19SMAD#4 It's less striking on the PG (don't look perpendicular to a face), that's why I posted the picture above. Maybe it's not a bug and it's really impossible to have both microsurface and bumpmap working when the extension isn't available ? What do you think ? Have a good day Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2016 Share Posted November 10, 2016 ping @Sebavan Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 10, 2016 Share Posted November 10, 2016 Yep, I am really not proud of the support without the extension... and your understanding is fully correct :-) The main issues are both specular aliasing and normal map aliasing and it costs of lot to reduce in the shader if the texture have not been authored in a special way. Also normal map mip mapping should be done in a custom way not the the default mip map: https://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/ So, the first thing is to disable mip map generation off the normals. Concerning the extension, the bias does not give at all the same result than the lod extension. I did not spend more time on it considering most of the browsers should supprd the lod ext soon :-) I would be happy for integrating any changes on this part but I am kind of short in research time currently :-( I am afraid that does not help resolving the issue but could give you more hint on where it coes from. See you, Nabroski and PeapBoy 2 Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted November 11, 2016 Author Share Posted November 11, 2016 Hello ! Oh don't be afraid, these explanations are really helpful ! I wouldn't be able to figure out all this on my own, thank you ! I agree with the fact most of the browsers support the lod extension (fortunately !) and I think it's enough. I just wanted to understand why this was happening, and maybe inform you if this issue wasn't a known issue. So, thanks for the link, I'll read it right now ! And maybe I'll experiment things on this. PeapBoy Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.