depth-buffer


Pack depth information in a RGBA texture using mediump precison

陌路散爱 提交于 2020-02-24 21:53:16
问题 Trying to understand the many issues related to the WebGL development for a generic mobile target, now I need to store depth information in a texture attachment for later retrieval and post-processing. JavaScript: var depthRB = gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, depthRB); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, w, h); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthRB); gl.bindRenderbuffer(gl.RENDERBUFFER,

Pack depth information in a RGBA texture using mediump precison

做~自己de王妃 提交于 2020-02-24 21:51:33
问题 Trying to understand the many issues related to the WebGL development for a generic mobile target, now I need to store depth information in a texture attachment for later retrieval and post-processing. JavaScript: var depthRB = gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, depthRB); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, w, h); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthRB); gl.bindRenderbuffer(gl.RENDERBUFFER,

Pack depth information in a RGBA texture using mediump precison

ぐ巨炮叔叔 提交于 2020-02-24 21:50:21
问题 Trying to understand the many issues related to the WebGL development for a generic mobile target, now I need to store depth information in a texture attachment for later retrieval and post-processing. JavaScript: var depthRB = gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, depthRB); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, w, h); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthRB); gl.bindRenderbuffer(gl.RENDERBUFFER,

Matlab z buffer for simulating kinect

廉价感情. 提交于 2020-01-21 12:49:31
问题 We are trying to simulate simple kinect output. I have rendered a triangle mesh in Matlab and now I want to get at the depth buffer of the figure/axis where the shape has been rendered. How do I do that in matlab? i.e. how do I access the depth buffer of a figure? 回答1: You could try this. 来源: https://stackoverflow.com/questions/5963193/matlab-z-buffer-for-simulating-kinect

Create depth buffer histogram texture with GLSL

旧城冷巷雨未停 提交于 2020-01-12 02:36:52
问题 I'm using the depth buffer of the current context to influence a texture I am displaying. The texture is 1 dimensional and in grayscale. From left to right represents from near to far. The more pixels are at a certain depth the brighter the texture is at that point with black being no pixels are at that depth and white being all pixels are at that depth. Now I have a solution that does glReadPixels() on the depth-buffer, analyzes it on the CPU and then writes it back to the texture. Naturally

Create depth buffer histogram texture with GLSL

别等时光非礼了梦想. 提交于 2020-01-12 02:36:05
问题 I'm using the depth buffer of the current context to influence a texture I am displaying. The texture is 1 dimensional and in grayscale. From left to right represents from near to far. The more pixels are at a certain depth the brighter the texture is at that point with black being no pixels are at that depth and white being all pixels are at that depth. Now I have a solution that does glReadPixels() on the depth-buffer, analyzes it on the CPU and then writes it back to the texture. Naturally

Copy depth buffer with non-lockable format (D24S8) to system memory with Direct3D9, Win 8.1

纵饮孤独 提交于 2020-01-07 05:48:06
问题 EDIT: As ozeanix points out in the comments it is not possible to copy a D24S8 surface to system memory. Unfortunately you also cannot bind the surface (or rather its containing texture) to a pixel shader. I ended up going the reimplementation way, intercepting all D3D9 calls. If the graphics card supports it - all cards with DX10+ should do - it is sometimes possible to exchange the D24S8 format with FOURCC INTZ, which has the same memory layout, but can be bound to a pixel shader's texture

How to efficiently copy depth buffer to texture on OpenGL ES

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 00:43:13
问题 I'm trying to get some shadowing effects to work in OpenGL ES 2.0 on iOS by porting some code from standard GL. Part of the sample involves copying the depth buffer to a texture: glBindTexture(GL_TEXTURE_2D, g_uiDepthBuffer); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, 800, 600, 0); However, it appears the glCopyTexImage2D is not supported on ES. Reading a related thread, it seems I can use the frame buffer and fragment shaders to extract the depth data. So I'm trying to

OpenGL ES 2.0 displaying objects in opposite depth order using LibGDX

夙愿已清 提交于 2019-12-25 02:27:05
问题 I am using LibGDX and rendering a few models. This works as expected, except objects that are "further away" are displayed "in front" of "closer" objects. In other words the depth order seems to be the opposite of what I intended for it to be. Strangely, the models are clipped in the correct order by the far clipping-plane. (Most distance objects disappear first) I have tried enabling GL_DEPTH_TEST , and I am clearing GL_DEPTH_BUFFER_BIT . Does anyone know what could be causing this? 回答1: If

How to write to zbuffer only with three.js

老子叫甜甜 提交于 2019-12-24 13:45:03
问题 I'm trying to use thee.js to only update the zbuffer (I'm using preserveDrawingBuffer to create a trace effect). However I can't find any way to only write to the zbuffer with the standard materials, so far I've tried: setting the material's visible to false, which stops the object rendering. setting the material's opacity to 0.0, which means nothing gets rendered. Is there a 'standard' way of doing this, or do I need to use a custom fragment shader? 回答1: You can render to the depth buffer

工具导航Map