Advertisement

3d in 2d game enginge question

Started by June 10, 2002 07:27 AM
-1 comments, last by Luctus 22 years, 8 months ago
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
-LuctusIn the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams

This topic is closed to new replies.

Advertisement