Search the Community
Showing results for tags 'webgl 2'.
-
Hello, friends. There was such a task. Start up one! a wave over a sphere, which, as it were, looks like a map of the planet, which (map) in turn is generated from planeBufferGeometry and then these geometries are combined using THREE.BufferGeometryUtils.mergeBufferGeometries(geometries, false); Code of vertex shader: vertexShader:` varying vec2 vUv; uniform float time; void main(){ vUv=uv; vec3 newposition = position + position*sin(position.z*12.)*0.03; gl_Position = projectionMatrix * modelViewMatrix * vec4( newposition, 1. ); } `, The question is how to make only this one "wave", i.e. so that sin does not go over the entire sphere, but only in the middle, for example. And further. How can I change the direction of this "wave", now it comes from the Z coordinate of this sphere, I need it to go from the position I have defined (for example, approximate coordinates of London).
-
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: