I'm working on a 2D game with realistic deferred lighting. Since I'm rendering the lights after the scene is rendered, I need a way to cull lighting calculations if there is an object, such as a tree, obstructing the area being lit. After doing some reading, my best bet for deferred rendering is to use a depth buffer. I've been searching the internet for ways to have a depth buffer with 2D graphics but really have not found anything helpful. I found glPolygonOffset but I really have no clue if that is what I want, or if there is another way to set a z value for the polygons. Thanks for any help
Depth buffer in 2D
2.2k views Asked by rcapote At
1
There are 1 answers
Related Questions in OPENGL
- How to fix "Access violation executing location" when using GLFW and GLAD
- getting Access violation writing location when calling glDrawElements caused by shader
- Experimenting with GLFW library: window boundary problem and normalized coordinates
- OpenGL Framebuffer/FBO RTT subpixel movement discrepancy
- Why isn't my glfw window showing anything?
- How can glPushMatrix affect the rotation of an object around a rotating object?
- g++ / vscode apparently cannot see my src folder? "cc1plus.exe: fatal error: src/glad.c No such file or directory"
- Does addition-assignment cause dependency chain in GLSL?
- Compiling C++ program with Opengl and Glut in windows
- Using Silk.NET in WinForms
- What happens when rendering an OpenGL buffer that has been padded with NULL (or another value)?
- How can I make a sphere follow an eight-like path in Python using OpenGL?
- OpenGL only rendering second triangle, first triangle not visible
- OpenGL shows black texture on quad
- My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined
Related Questions in ZBUFFER
- C++ 3D software rasteriser depth buffer producing incorrect results
- Blender : How to select only viewable objects?
- Disabling Depth Test Gives Weird Artifacts For Complex Meshes
- Using a second z-buffer as a stencil buffer (depth-stencil test)
- Dummy camera clears the depth buffer
- Minimalist Sphere Impostor -- computing sphere radius in zdepth
- Z Buffer Not Working Correctly (Not Displaying Anything)
- How to find the depth of a pixel using two x y and z coordinates
- Hidden and visible surface rendering in javascript by overlapping colours
- get simulated depth image from matlab figure
- Direct3D 9 Z-Buffer Precision Bug occuring only in release build
- What is hidden surface problem and why does z buffer precision even matter?
- Calculating individual distances from a Camera in a 3D world, Java
- Implementing Z Buffer Algorithm
- OpenGL optimizing skybox rendering
Related Questions in 2.5D
- How to fix fish-eye effect while making doom like pseudo-3d raycaster game
- Unity 3d cross section shader
- 2.5d in 2d canvas with camera rotation
- Enemy following player with walls between
- Fix Fish-eye effect 2.5D Raycaster game
- How to change angle of AStar pathfinding
- Can you make a sprite in Unity with a tile set?
- Horizontal rotation of a camera by the angle with the y axis
- pseudo 3D camera turning
- Player has little control over the character after dashing in midair
- Fish-eye effect corrections in JavaScript ray-caster engine
- Is there any tools or algorithms for convert 3D Point Cloud to 2.5D image?
- How to separate two bit maps of size 8 and 16 from a single PNG
- Does the Windows Composition API support 2.5D projected rotation?
- How to fix "the object of type 'GameObject' has been destroyed, but you are still trying to access it" error in Unity?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Your misconception lies in thinking "3D == perspective". To generate a depth buffer your scene needs, well, depth. But that's no problem. What you refer to as "2D" probably just means lack of perspective. So by using a ortho projection and placing your objects on layers at various depth you can generate a depth buffer with data usefull for deferred lighting.