PeapBoy Posted April 19, 2017 Share Posted April 19, 2017 Hi everybody ! While I was writing my latest shader, I juste came up with annoying errors like this one : Guess what ? No, my typo is NOT at line 85. And I wondered why we couldn't have the real source code. The one after conversion, addition of defines and insertion of includes. Therefore the one where the typo actually IS at line 85. I know that getVertexShaderSource() function exists but it doesn't work without a successfully compiled program (and on success, no need of debugging). Guess what ? It's easy to get ! http://www.babylonjs-playground.com/#YX38N7#3 (Open your console) I would like to know, @Deltakosh , would you be interested in a PR for that or is it already implemented somewhere/useless ? Because in my PR I had to compute again the migratedVertexCode and migratedFragmentCode values, but these ones are available when entering the Effect.noError callback in the _prepareEffect() function... If you're interested, I see two options : - Just returning the two values in the onError callback and let the user make something with that. - Or printing the source code with numbered lines by default exactly as you print the defines Just let me know what you think is better. PeapBoy Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 19, 2017 Share Posted April 19, 2017 Like your second option:) please do a PR (I appreciate the help) Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted April 20, 2017 Author Share Posted April 20, 2017 Ok, done, thank you. Just one question. Since BabylonJS has a backward compatibility policy, can I remove a function ? Because I replaced _dumpShadersName (which is only used here) by _dumpShadersSource. Two other things I think about : - Maybe some developers do NOT want that random users of their site could see the content of their shaders when it fails to compile ? - It may add a huge amount of text in the console and it may be uncomfortable if you're not debugging this. I tried to order the content as good as I could though. Anyway, PR is sent. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 20, 2017 Share Posted April 20, 2017 All functions starting with underscore are consider private so you can change it like you want If a shader fails on user machine they will love to have this info Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted April 20, 2017 Author Share Posted April 20, 2017 Ok nice ! Good luck with push mode & UBOs GameMonetize 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.