Dad72 Posted February 5, 2015 Share Posted February 5, 2015 When adding a postProcess to the camera, the ScreenShot is black output. I remove prostProcess, the image is ok : Repro:http://www.babylonjs-playground.com/#1DWSMWcameraPlayer.attachPostProcess(new BABYLON.FxaaPostProcess("fxaa", 1.0, this.cameraPlayer, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, true));// OrcameraPlayer.__fxaa_cookie = new BABYLON.FxaaPostProcess("fxaa", 1.0, this.cameraPlayer, 2.0, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false);var size = { precision: 0.5 };BABYLON.Tools.CreateScreenshot(engine, camera, size); // => return image black//*****************//cameraPlayer.attachPostProcess(new BABYLON.FxaaPostProcess("fxaa", 1.0, this.cameraPlayer, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, true));// and//cameraPlayer.__fxaa_cookie = new BABYLON.FxaaPostProcess("fxaa", 1.0, this.cameraPlayer, 2.0, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false);var size = { precision: 0.5 };BABYLON.Tools.CreateScreenshot(engine, camera, size); // => return image Ok Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2015 Share Posted February 5, 2015 This is because you call CreateScreenshot right after setting the postprocess. But setting postprocess takes time as babylon,js needs to compile a shader (asynchronously) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 5, 2015 Author Share Posted February 5, 2015 No it does not change. I waited 3 minutes to create a screen and the texture is black. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2015 Share Posted February 5, 2015 OMG I spent 2 hours trying to figure out why it was not working... THIS IS A SIMPLE TYPO!!!!!! camera.__fxaa_cookie = new BABYLON.FxaaPostProcess("fxaa", 1.0, camera, 2.0, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false); the 2.0 is a typo, you should call this:camera.__fxaa_cookie = new BABYLON.FxaaPostProcess("fxaa", 1.0, camera, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false); http://www.babylonjs.com/Playground#1DWSMW#3 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 6, 2015 Author Share Posted February 6, 2015 thank you Dk. is the signature that change? I cross that it's something that I copy here or in the tutorials with this error. Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 6, 2015 Share Posted February 6, 2015 Documentation ist wrong... http://doc.babylonjs.com/page.php?p=22431var postProcess = new BABYLON.FxaaPostProcess("fxaa", 1.0, null, null, engine, true);Only 6 vars instead of 7 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 6, 2015 Author Share Posted February 6, 2015 I had to copy it on the forum and not the documentation. 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.