465 questions
2
votes
0
answers
79
views
SceneKit SCNTechnique: why is the DEPTH semantic empty unless I add an explicit DRAW_SCENE pass?
I’m trying to sample the scene’s depth buffer in a post-processing pass.
According to the SceneKit Technique documentation, the built-in semantics COLOR and DEPTH should be “what SceneKit rendered in ...
0
votes
1
answer
67
views
Projecting Depth of Adjacent Pixel based on Normal
I'm working on a screen-space outline effect for a low-res, cartoony game idea. I'm very new to HLSL programming and fullscreen Shader Graphs, but by looking at tutorials, I've mostly gotten the depth-...
1
vote
1
answer
56
views
How can I make custom depth testing logic in Metal?
I am implementing a basic partial transparency system. While this is not correct, order independent transparency, this does work well enough (is more-or-less correct) when dealing with objects that ...
2
votes
0
answers
69
views
Passing depth buffer values as a texture to pixel shader
I'm very new to shader programming, so forgive me for any knowledge gaps or mistakes I've made.
I am currently following a technique discussed in Nvidia's GPU Gems: https://developer.nvidia.com/...
2
votes
0
answers
77
views
Depth stencil does not work properly during DirectX12 renderer implementation
I've fixed all the possible issues I could in the implementation process, but I still can't figure it out, so I'm sharing my repo.
Looking at the code, objects with larger Z values are not being drawn ...
0
votes
1
answer
37
views
Inconsistent behaviour in WebGL depth testing using EQUAL
I’ve run into inconsistent behaviour in depth testing and I don’t know if this behaviour is specified anywhere.
My question is: when using EQUAL as the depth-testing function, what is the expected ...
3
votes
1
answer
143
views
What is fragment slope?
I try to understand each member of the struct VkPipelineRasterizationStateCreateInfo, but its depth bias related member confused me, especially about the depthBiasSlopeFactor. I find description ...
2
votes
1
answer
80
views
How would I store the depth information for multiple color targets if my OpenGL FBO allows multiple color attachments but only one depth attachment?
If OpenGL FBOs have a provision for multiple colour targets with GL_COLOR_ATTACHMENT0 to GL_COLOR_ATTACHMENT31 but only one depth/stencil target with GL_DEPTH_STENCIL_ATTACHMENT, then how would I be ...
0
votes
1
answer
424
views
What’s the difference between linear depth, perspective depth, and orthographic depth?
Studying the code of three.webgpu.js, I come across the terms "linear depth", "perspective depth", and "orthographic depth".
I know there is a visual difference between ...
3
votes
1
answer
173
views
Why is writing to gl_FragDepth fast when using constant values, but slow when using varying values?
I have the following situation: I want to transfer depth values from a framebuffer with 1 sample to a different framebuffer with 8 samples. I think, the only way how this can be accomplished is by ...
0
votes
1
answer
100
views
How to store origin depth values in depth attachment?
I am trying to implement rendering points on top of geometry as in Blender. The algorithm is as follows: rendering is done through PointList without depth test. The depth test is done manually in the ...
0
votes
1
answer
105
views
OpenGL: How do you use the stencil buffer to discard fragments closer than polygons drawn to stencil buffer?
In the engine I'm working with, I'm drawing some polygons to be used as a stencil for a portal of sorts, and I want to clip depth to it, in the sense that anything I draw after setting up the stencil, ...
0
votes
1
answer
173
views
WebGL screen to world coordinate
I'm creating a 3D globe with elevation:
I now want to add click detection to get a 3D world xyz position from a 2D screen xy + depth (from a click). I'm using the following code (inspired from ...
1
vote
2
answers
205
views
Monogame My 3D objects overlap instead of drawing based on position relative to the camera
https://www.youtube.com/watch?v=QWImAT-g7tE
Hey, I’m having trouble with overlapping 3d objects. My 3D rendered models/objects are drawn on top of each other based on which draw method gets called ...
0
votes
1
answer
471
views
Does Vulkan require a depth buffer attachment to perform a depth bounds test?
The behavior I'm hoping to achieve here is to have my fragment shader write to gl_FragDepth and for a depth bounds test to be performed on that value before going on to a stencil test.
There are a few ...
0
votes
1
answer
194
views
DirectX 3d 11 after using the Depth Stencil view in OMSetRenderTarget nothing is rendering at alllll
I HAVE been trying this for hours now. I have no clue why the triangle is not rendering on the screen.
D3D11_DEPTH_STENCIL_DESC dsDesc = {};
dsDesc.DepthEnable = true;
dsDesc....
1
vote
1
answer
900
views
Vulkan depth testing not working with dynamic rendering and deferred
My setup is like this:
Render a small scene (ie. a single 3D model) into a framebuffer with 1 color and 1 depth attachment.
Render the color buffer into a fullscreen quad
Most code examples online ...
1
vote
0
answers
222
views
Access violation when calling ClearDepthStencilView in DX12
I'm trying to learn DirectX12 and have been following along with 3dgep's tutorial.
When I attempt to clear the depth stencil view, it works fine on the first call but throws
Exception thrown at ...
0
votes
1
answer
248
views
Does a reversed depth buffer in OpenGL require vertex shader changes?
I've read many articles about what is and how to set a reversed depth buffer in OpenGL (just search for opengl reversed depth on Google and I've read 6 positions). None of them mentioned any vertex ...
0
votes
1
answer
71
views
webgl2 problem with rendering opaque and translucent triangles
I am working from a sample at https://interactivecomputergraphics.com/. My goal is to have a simple example that shows alpha blending with opaque and translucent triangles. I have 6 squares (2 ...
1
vote
1
answer
175
views
Can I solve this OpenGL problem with the depth/stencil buffers
I'm trying to render meshes with the points and edges as black lines and points, similar to a modeling engine like blender. I have 3 separate draw routines to draw points, lines, and faces (each face ...
1
vote
0
answers
311
views
Disabling Depth Test Gives Weird Artifacts For Complex Meshes
I imported a mesh from Blender 2.90.1 (glTF 2.0 exporter, all transforms applied, normals calced outside) into Godot v4.0.2.stable.official [7a0977ce2] and when setting no_depth_test = true, it seems ...
0
votes
1
answer
815
views
Simplest way to get the pixel depth from Render Texture (CPU)?
In my project I capture the scene to a RenderTexture and I want to be able to loop over those pixels to get the depth of each pixel.
I have so far tried to convert RenderTexture to Texture2D and loop ...
1
vote
1
answer
376
views
How to un-linearize the depth buffer value
I use this function to linearize the depth value in my shaders:
float linearize_depth(float d, float zNear, float zFar)
{
return zNear * zFar / (zFar + d * (zNear - zFar));
}
What function would ...
0
votes
1
answer
254
views
Transparency and Depth test in Pyglet
I am trying to render a scene with partially transparent sprites in Pyglet.
I want to activate z depth test to render them but this yields the following:
two images overlapping
The two images ...
0
votes
0
answers
48
views
Unable to get depth texture in a compute shader generated using fragment shader [duplicate]
I have an FBO with two textures attached to it. One of them is color buffer attachment and the other is depth buffer attachment. After rendering the scene with the frame buffer attached I properly get ...
0
votes
1
answer
431
views
Direct3D 11: Why does the depth buffer not work and the cube continues to display incorrectly?
I wanted to draw a 3D cube, but it doesn't display correctly. That is, the Z buffer (depth buffer) does not work.
The initialization of the depth buffer occurs in the InitDepthBuffer method, which I ...
0
votes
1
answer
155
views
D3D11 Multiple Vertex Buffer 2D Depth sorting with depth buffer
I am trying to create some 2D UI drawing in D3D11. I am trying to get the draw calls down as much as possible to improve performance. Previously, I batched up as many textures as possible to send to ...
0
votes
1
answer
606
views
Pixel space depth offset in vertex shader
I'm trying to draw simple scaled points in my custom graphics engine. The points are scaled in pixel space, and the radius of the points are in pixels, but the position of the points fed to the draw ...
1
vote
1
answer
817
views
(DX12 Shadow Mapping) Depth buffer is always filled with 1
I'm really new to graphics programming in general, so please bear with me. I am trying to add shadow mapping from a distant light (orthogonal projection) into my scene, but when I follow the (very ...
0
votes
1
answer
106
views
Z Buffer Not Working Correctly (Not Displaying Anything)
Here is the code for my Z Buffer, it returns a black screen when I draw it.
sf::VertexArray ZOrder(sf::VertexArray verticies, std::vector<float> z_buffer) {
std::vector<float> order;
...
0
votes
1
answer
234
views
Maximum value of metal depth2d<float>/Depth32Float when using SceneKit
I'm using an SCNTechnique with SceneKit to implement my own multipass rendering. I have 1 DRAW_SCENE pass that outputs to separate colour and depth targets, and then a second DRAW_QUAD pass that uses ...
1
vote
2
answers
742
views
Implementing integer 1/z depth buffer
I am trying to adapt the code from this answer to use 1/z depth buffer and here is my attempt
/* g++ trig.cpp -o trig -lSDL2 */
#include <algorithm>
#define SDL_MAIN_HANDLED
#include <SDL2/...
0
votes
0
answers
107
views
Trying to draw liquid on floor in 2d (Opengl directly write array of byte into stencil buffer)
Currently I'm making 2d game with java libgdx.
In my game I need to have multiple kinds of liquid to occupy floor of room. (something like splatoon but in 2d)
Each liquid need track of what entity it ...
0
votes
0
answers
336
views
Increased precision when rendering depth map
In OpenGL, I'm trying to render a depth map that doesn't loose precision with fa away objects.
Do you know of any way I can accomplish this task?
My approach so far: I tried the "reverse depth&...
4
votes
1
answer
998
views
Why is only 1 Depth/Stencil buffer needed, even when the swap chain is tripple buffered DirectX12
I am learning DirectX12 programming. And one thing that has me confused is in all the tutorials I read, they only create a single depth/stencil buffer even when triple/double buffering is used with ...
2
votes
0
answers
358
views
How to correctly work with the range of depth data obtained from render-to-texture?
I'm doing some customized 2D rendering to depth buffer that connects to a texture of internal format GL_DEPTH_STENCIL. In fragment shader, the normalized Z value (only 0.0 to 1.0 is used, I'm lazy) is ...
1
vote
1
answer
989
views
Framebuffer not completing on GL_DEPTH_ATTACHMENT render to texture
I'm attempting shadow mapping in OpenGL, and have been unable to render specifically GL_DEPTH_ATTACHMENT to a frame buffer. glCheckFramebufferStatus does not return complete but only when targeting ...
0
votes
0
answers
314
views
Retrieving depth value of a sample position using depth map
I have been trying to implement SSAO following the LearnOpenGL implementation. In their implementation they have utilized the positions g-buffer to obtain the sample positions depth value and I am ...
1
vote
1
answer
72
views
Why is my depth testing not working in PyOpenGL
I'm quite new in 3D graphics so I'm just learning :-D. I wanted to create a cube as my first project. I chose PyOpenGl and ran into the following problem: Depth testing didn't work for me. I searched ...
0
votes
0
answers
590
views
Sorting 3D bounding boxes according to distance from specific point
Is there an efficient way to calculate the order of 3D bounding boxes according to their distance from a specific point?
I can't simply take the center point of the bounding box since there are often ...
1
vote
1
answer
407
views
OpenTK read depth buffer to array
I am trying to read the depth buffer and store it into an array using openTK in C#.
This is my code so far:
//Get depth buffer
int[] depthBufferID = new int[1];
GL.GenBuffers(1, ...
1
vote
0
answers
127
views
How to find out depth buffer resolution in OpenGL ES?
I was using the following code to produce depth values:
sealed class GL24: iDepthValues
{
const double mul = 2.0 / 0xFFFFFF;
float iDepthValues.value( int index )
{
// Have no idea ...
0
votes
1
answer
319
views
Interpreting unsigned short depth map values
I'm trying to test my algorithm on the lineMOD object detection dataset. According to the author, the depth values are stored as unsigned short values. I've managed to load the depth values into a cv::...
0
votes
0
answers
72
views
How do I reduce opacity of geometry that is hidden from view?
I have a 3D model of a house with some lines draw on it in teal. I'd like to reduce the opacity of lines that should not be visible to the camera because they are hidden behind parts of the roof.
1
vote
0
answers
312
views
How should I render an atmosphere between objects and a cubemap in OpenGL
I have got a scene with an object and a cubemap in OpenGL.
My atmosphere shader(rayleigh scattering) renders to a quad which is right infront of the camera.
This of course obstructs vision on my ...
2
votes
1
answer
924
views
Can I read single pixel value from WebGL depth texture in JavaScript?
In short
I would like to read a single pixel value from a WebGL 2 depth texture in JavaScript. Is this at all possible?
The scenario
I am rendering a scene in WebGL 2. The renderer is given a depth ...
0
votes
1
answer
94
views
Is it possible to use texSubImage2D on a depth texture?
I'm following this tutorial on 2D shadow mapping and I've gotten it working in WebGL. Now, I am looking to develop a way to recompute single rows in the depth texture, without clearing the entire ...
2
votes
1
answer
2k
views
PyVista: AttributeError: 'Plotter' object has no attribute 'ren_win'
I am using the example code of the documentation from PyVista:
import pyvista as pv
import matplotlib.pyplot as plt
from pyvista import examples
mesh = examples.load_random_hills()
p = pv.Plotter()
...
1
vote
1
answer
584
views
Vulkan Instanced Rendering Weird Depth Buffer Behaviour
I am rendering a single mesh test object that contains 8000 cubes, 1 monkey, and 1 plane. I checked normals and winding orders. all seems correct for mesh.
if I render a single instance, the depth ...