Search the Community
Showing results for tags 'msaa'.
-
Hi everybody ! First of all, I'm not sure if I should begin a new thread or up these ones : http://www.html5gamedevs.com/topic/19285-create-screenshot-with-post-processing/ http://www.html5gamedevs.com/topic/17404-babylon-screenshot/ With the new support of WebGL 2 by BabylonJS, I got interested in the multisample render target. Until now, I used my own version of createScreenshotUsingRenderTarget() function which performs MSAA manually (actually, it pixel perfect downscales a 4x bigger renderTargetTexture than the requested size). Now, I would like to rewrite it using the latest available features. What should I do to get an antialiased screenshot using multisample render target ? Just increasing the samples property of the RenderTargetTexture is not enough, I'll always get the following error : [.Offscreen-For-WebGL-098CA170]GL ERROR :GL_INVALID_OPERATION : glReadPixels: Which comes obviously from this line : var data = engine.readPixels(0, 0, width, height); https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.tools.ts#L627 Here is a PG where I copy/pasted a lighter version of createScreenshotUsingRenderTarget() function. The only real difference is the sampleCount parameter which is used to increase the samples property : http://www.babylonjs-playground.com/#SDTEU#29 Just press 1, 2, 3 or 4 key to call the createScreenshot() function with 1, 2, 3 or 4 samples. Thanks for your help !
- 5 replies
-
- webgl 2
- screenshot
-
(and 2 more)
Tagged with: