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 best solutions below
Related Questions in OPENGL
- setting OpenGL version in objective-C
- How to run OpenGL version 3.3 (with Intel HD 4000) on Ubuntu 15.04
- Can linear filtering be used for an FBO blit of an MSAA texture to non-MSAA texture?
- How to get shader version from QOpenGLShader?
- "Capture GPU Frame" in XCode -- iOS only?
- Difference between glewGetString(GLEW_VERSION) and glewIsSupported
- Tesselation result flickering - OpenGL/GLSL
- Water rendering in opengl
- Texture mapping consuming physical memory
- Rotating a Cube using Quaternions in PyOpenGL
- Switching from perspective orthographic projection in OpenGL
- FreeType2 and OpenGL : Use unicode
- Should Meshes with and without Skeleton use different Shaders?
- How to get accurate 3D depth from 2D screen mouse click for large scale object in OpenGL?
- Trying to load 2d texture with glTexImage2D, but just getting blank
Related Questions in ZBUFFER
- When is painter's algorithm required with Z-buffer algorithm?
- Implementation of a simple Z-Buffer in CUDA
- XNA 4.0 shader depth information
- Mathematical view of z-fighting
- Absolute limite to z-buffer (depth buffer) value
- How to save a bitmap as 16-bit in Maxscript?
- Depth buffer mode with several axes in Matlab
- Depth buffer in 2D
- Using OpenGL in Matlab to get depth buffer
- Best Z ordering method for tile-based, cocos2D-iPhone games?
- OpenGL Z order messed up
- Blender : How to select only viewable objects?
- in three.js, alpha channel works inconsistently
- Logarithmic depth buffer linearization
- AS3: Z buffering
Related Questions in 2.5D
- Perspective Vision on Canvas
- Depth buffer in 2D
- 2d point to 2.5d Point
- Player has little control over the character after dashing in midair
- Can you make a sprite in Unity with a tile set?
- Fish-eye effect corrections in JavaScript ray-caster engine
- How to separate two bit maps of size 8 and 16 from a single PNG
- Is there any tools or algorithms for convert 3D Point Cloud to 2.5D image?
- iPhone 2.5D code samples
- Any 2.5D or 3D Canvas rendering Engine with Ie8 support
- kivy 2.5d scene - graphics api with drawing/uix api
- pseudo 3D camera turning
- 2.5d in 2d canvas with camera rotation
- Unity 3d cross section shader
- 2.5D Plane in Slick2D is curved for some reason
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)
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?
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.