This topic is now archived and is closed to further replies.


3d in 2d game enginge question

Recommended Posts

Luctus    584
I''m just about to begin on the graphics part of my(our really) 3d in 2d engine and I have a question about depthtesting. My original idea was to first draw a mesh of the current scene, draw the pre-rendered background then draw the 3d-models on top of that and do the depth-testing against the scene mesh. That approach brings a problem though. If using very complex scenes (and I''m probably talking about VERY complex scenes), the background mesh will also get very complex and will take alot of time to draw every frame, something I really want to avoid since I partially choosed to use a 3d in 2d engine because I thought it would be nicer to the computer load ;-) However, now I begun thinking about that instead of drawing a mesh for depth-testing, I could write directly to the depth buffer. However, the only way I found to do that is using the glDrawPixels function that should be REALLY slow. A solution to that would be to blit the pixels to the depth buffer, lock the depth bufffer, sort the 3d objects depth-wise and render them back-to-front (since I''ve locked the depth buffer because I only want to draw it once). So, my question is if there is any faster way than using glDrawPixels for writing in the depth buffer and whetever I should stick to the first approach or try the depth blitting? -Luctus

Share this post

Link to post
Share on other sites