royibernthal Posted May 19, 2018 Share Posted May 19, 2018 Me and Andy (@Pryme8) have been trying to get a very plain post process to work in the back scene of a PG that has 2 scenes: http://www.babylonjs-playground.com/#BLNIDI#19 It seems line 50 results in a webgl error when the value of time is set to anything other than 0, in any sort of render loop / timeout / interval. It works fine when it's set to any float value if it's defined right after creating the PostProcess instance (possibly because it's before the scenes are rendered?) uwPass.getEffect().setFloat('time', time); The error can only be noticed when loading the PG: Quote WebGL: INVALID_OPERATION: uniform1f: location not for current program I suppose that's because of: Quote WebGL: too many errors, no more errors will be reported to the console for this context. I'm stating the obvious, but that means that error won't be logged when modifying the PG and running, you'll need to save it and reload the page. When scene's camera is passed to the post process instead of backScene's camera, the error is not thrown: http://www.babylonjs-playground.com/#BLNIDI#20 Quote Link to comment Share on other sites More sharing options...
Guest Posted May 21, 2018 Share Posted May 21, 2018 Here is the fix: http://www.babylonjs-playground.com/#BLNIDI#34 First I fixed the shader which was using texture instead of texture2D (which is required when running on non webgl2 devices) Then I added line #43 which is where you are supposed to communicate with the effect. Everywhere else, there is no guarantee that the effect is connected or ready royibernthal and Pryme8 1 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.