Jump to content

CreateScreenshot and PostProcess return image black


Dad72
 Share

Recommended Posts

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/#1DWSMW

cameraPlayer.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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...