heyzxz Posted August 17, 2017 Share Posted August 17, 2017 Hi there, I have some questions about this function: _mustRebind( ... ), (which was executed inside the 'bindForSubMesh(...)' for both StandardMaterial and PBRMaterial, and was defined in the 'PushMaterial' class ) 1. I don't understand the purpose of using this function because it always returns true. Please prove me if I'm wrong: it finally execute a comparison like: 'scene._cachedVisibility !== mesh.visibility' , which is always true, because the scene._cachedVisibility has never been used and would always be null... right? is this a mistake? 2. The '_mustRebind' directly returns the 'scene.isCachedMaterialValid', look into the latter function, I guess it actually did a kind of 'Invalid' check, isn't it ? If so, is it better naming it as "isCachedMaterialInvalid"? Thank you! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 17, 2017 Share Posted August 17, 2017 Haha well done!!! This is a big bug I'll fix it right now. Thanks a lot! Regarding the name, you are also right!! will fix both heyzxz 1 Quote Link to comment Share on other sites More sharing options...
heyzxz Posted August 18, 2017 Author Share Posted August 18, 2017 Hi @Deltakosh, I've seen your changes on git, thank you But there is still one thing not very clear to me: see the StandardMaterial class (and also happens in PBRMaterial): the '_mustRebind' had been called twice in the 'bindForSubMesh'. The 1st call is now make sense to me, but the 2nd call is still always true I think, because it only passed the first 2 parameters, leaving the 3rd parameter 'visibility' as the default 0, which may mostly not equal to the scene._cachedVisibility (it is 1) . Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 18, 2017 Share Posted August 18, 2017 Rats!!! I did that when I was drunk or what??? Thanks again I'm working on a fix heyzxz 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.