Questions tagged [depth]
The depth tag has no summary.
40 questions
0
votes
1
answer
421
views
How can I make sprites and tile-sets interact with y-sort correctly in Godot?
Y-sort is not working how I would expect in Godot. I have a player sprite, their feet are at the origin. I have a y-sorted tile layer. The mushroom base is at the bottom of the tile, it doesn't ...
2
votes
1
answer
2k
views
How do I get the depth texture in an expression in Godot 4's visual shader?
I'm working on a tutorial for creating wake waves with Godot, versions 3.5 and, importantly, the upcoming 4.0. It uses shaders (including visual) and works fine so far, but in attempting to get the ...
0
votes
1
answer
90
views
Depth does not writes in texture
I am doing volumetric fog. In the first pass I write down the depth of the front polygons of the cube, in the second pass I write down the depth of the back polygons of the cube, in the third pass I ...
0
votes
1
answer
1k
views
OpenGL gl_Position z-range and depth buffer range
Am I correct that the OpenGL depth buffer has values between 0 and 1 while the z component of gl_Position is between -1 and 1?
3
votes
1
answer
2k
views
How to access a ViewportTexture's depth data as an image?
I make use of ViewportTextures, kind of like rendering security cameras on screens. Now, I'd need to access the depth textures to do some comparison of images / pixels. How do I access the depth data ...
0
votes
2
answers
906
views
Why does reading my depth texture in GLSL return less than one?
I've created a depth texture in OpenGL (using C#) as follows:
...
-1
votes
1
answer
332
views
Unity depth shader not giving correct values
I did the following shader (looked up and changed for my needs):
...
0
votes
1
answer
3k
views
How to convert depth values into Unity's distance
I am new in Unity and now only studying for my work project. I need help with computing real distances from depth values. Can't figure it out.
My shader is:
...
1
vote
1
answer
2k
views
How to write depth texture and read values from it
I am new in Unity and specializing in another field. But now I have to rapidly study it for a new project. I will be very thankful if anyone explain me how to read values of the depth buffer.
I wrote ...
4
votes
4
answers
6k
views
How to give depth to a top-down shooter?
I'm working on a top-down shooter kind of game, but it lacks the feeling of depth.
When you have a sun, it's a bit easier, because the sun can cast shadows. But it's even harder, when there is no sun,...
1
vote
2
answers
2k
views
Proper 2D isometric tile depth sorting?
I'm using Raylib, and I'm attempting to place tiles on a level, and the algorithm for placing the tiles is working.
The problem is that the player will display over the walls on the bottom right hand ...
0
votes
1
answer
547
views
Depth sorting issue
I've been working on a custom tile-based map editor for a while now, and everything works as expected, or so I thought until I've tried rendering the actual map including the dynamic objects as well.
...
1
vote
1
answer
306
views
How do I determine distance of a point within a ProBuilder mesh?
As in the title, I have an effect prepped for my game which applies certain derived parameters to a post-processing effect after the player enters a boundary I created with ProBuilder. Finding how far ...
6
votes
3
answers
1k
views
Why is the depth test not done on geometry before rasterization?
It seems the only time depth is used to discard data is during rasterization, i.e. at the fragment level.
In the geometry stage, I've only see culling and clipping of vertices. Is it not possible to ...
1
vote
0
answers
352
views
Improving Shadow
I need to improve the shadows in my scene. At a first look they don't look too bad:
They look awful when the camera gets closer to them, showing weird artifacts.
I would like to know what are the ...
0
votes
1
answer
118
views
Make character move behind object
I used Tiled Editor for making maps for my own game, I do not run any engine or anything. I have separated terrain layer and object layer in TiledEditor.
However I have problem with trees I want to ...
3
votes
3
answers
1k
views
Chroma depth shader unity
I'm trying to reproduce a post-effect with unity seen in the answer here.
Chromadepth answer
For the moment I just manage to reproduce the wave effect with a quick edge detection.
I tried multiple ...
0
votes
1
answer
775
views
Walking over walls - Game maker studio
I am having an issue with the walls in my game. I have set them as objects and used the script:
depth = -y;
inside their create event.
However, when I walk my character in front of them, the ...
0
votes
1
answer
641
views
How To Fix Strange White Edges With DOF and Fog in Unity?
I'm using global fog and the standard assets Depth Of Field script but it has a strange effect on the edges of far away objects.
How can I make the white edges along the trees blend smoothly into the ...
1
vote
2
answers
7k
views
Why does my disable z-depth test shader do not work?
I wrote the following shader which purpose is to force draw a mesh over the rest, regardless z-depth :
...
2
votes
2
answers
2k
views
Why is my depth buffer texture so bright?
https://www.youtube.com/watch?v=QuvAEqgHrMY&feature=youtu.be
https://www.youtube.com/watch?v=5ob1JsPIGAs&feature=youtu.be
...
1
vote
1
answer
1k
views
How to enable depth test with QOpenGLWidget? It renders black screen
Currently I am writing a small application with Qt and OpenGl and I choosed QOpenGLWidget for rendering graphics.
That's how I declared my widget:
...
5
votes
2
answers
561
views
How to get depth of vertex in 0 - 1 range
I want to get the depth of vertex in 0 to 1 range(like it done in the shader) and I do it like this
...
3
votes
1
answer
1k
views
Layering with slopes in Unity 2D isometric scene
I'm newer to Unity so bear with me. I'm using Unity2D and so far I have my character up and walking around, colliding properly with his surroundings, and I've ...
5
votes
1
answer
2k
views
Ideal draw order - sort primarily by distance or material?
When it comes to pre-sorting the draw calls for a given frame, I am aware of two different methods for optimising.
The first is to batch draw calls by their material. This minimises shader changes ...
1
vote
0
answers
281
views
How to make dynamic DOF from mouse position in Unity 5?
I found a video a while ago for how to make a dynamic DOF in unity. It fires rays from the camera and positions an empty at the location that the ray first hit. How can I change this so that it doesn'...
2
votes
1
answer
3k
views
SSAO, depth buffer linearization (?)
I'm trying to implement SSAO in my application but it doesn't look as it should. I think that the problem is with depth buffer linearization but I tried almost all methods which I found on the Web and ...
3
votes
1
answer
387
views
Strange depth map projection
I'm trying to implement depth-only SSAO and for that, I render a depth map into a texture and pass it to my SSAO shader which then uses it.
The problem is that when I try to output the depth map ...
5
votes
0
answers
2k
views
OpenGL Depth Cubemap with Geometry Shader Not Rendering Correctly
I was having some trouble with cubemaps in OpenGL, and was hoping to get some help. I've been following a tutorial about point light shadow mapping using cubemaps, where a geometry shader is used to ...
1
vote
1
answer
1k
views
What's wrong with my HLSL depth shader?
I'm trying to render depth texture in XNA 4.0. I'm read few different tutorials several times and realy cannot understand what I'm doing wrong.
Depth shader:
...
1
vote
1
answer
956
views
GUI.Box z-index for mouseover
So I am drawing an inventory with slots like so:
...
1
vote
0
answers
126
views
XNA Billboards dont have correct depth
Im back again with yet another problem :( My current problem is with my billboard effect. Im having trouble trying to get the depth correct so that billboards that are closer to the player are ...
0
votes
2
answers
2k
views
Z-Value of clip-space position is always 1.0
I render a lot of quads on the screen into z direction (20 x 2000). I want to get the depth value in a final render target. But it looks like z is always 1.0f. I checked the result with the OpenGL ...
1
vote
1
answer
519
views
Applying statements to a single instance in Game Maker?
I'm currently in the process of making a platformer, and am currently in the process of creating "depth" into my game, by making Up/Down-W/S control your depth. (Come closer to screen, go further).
...
-1
votes
2
answers
719
views
OpenGL Depth Test Errors [closed]
I've been working on this problem for a while now.
My problem is that the sphere in the top image, is under-lapping the plane which should have a lower Z value. Although, when depth testing is ...
3
votes
3
answers
3k
views
How to handle tiles on top of players
I am creating an 2d bird view tile game using the pixijs render framework.
Like pokemon or oldtime zelda.
In those games you sometimes walk behind buildings where the tile would be drawn on top of ...
1
vote
2
answers
2k
views
How do I ensure my skybox is always in the background, with OpenGL?
I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes.
Optimally, I ...
0
votes
2
answers
2k
views
Simulating 3D height in 2D scene (also shadows)
I recently stumbled across this http://vimeo.com/99118680 video and was stunned by the beautiful painted art and colors. But mostly I couldn't believe how everything appeared to have three dimensions ...
2
votes
1
answer
623
views
XNA 4.0 HLSL - strange depth map
I want to draw my pre-rendered depth map to the scene.
I get my depth value in the following way:
basically (Pixel Shader)
...
9
votes
2
answers
2k
views
How do I handle game objects with two depths?
I want to be able to do what you see in the image, but with a single wall. The player should be able to walk on either side of the same object. That is, the same wall is below the hero when I go down ...