Skip to main content
GameDev.net gamedev.net
🔒 Locked

Creating a 3D Engine....

Started by madu Apr 10, 2007 at 8:08 AM 3 replies 1.3k views
Original Post
madu
madu
Hi. I probably should have put this thread in the beginner's forum, but anyway... I need to develop a new and simple (but reasonably modern) 3D Engine for a school project. I have worked before with OpenGL, DirectX (8), Win32 API, collision detection etc., and I developed a simple BSP engine; but this was some time ago. I don't know anything about shaders, or about how modern engines work. Now I was thinking to create a portal based engine. But I have so many questions about how modern engines work, and I don't have too much time to finish it all. For example, tranparent surfaces - from what I knew, you have to sort all of them and draw them back to front. So I was thinking to create a bsp tree only for the static transparent surfaces inside each cell, and use some other techniques for the dynamic tranparent surfaces. Are there any better techniques? Also - shadows. Do modern games use stencil shadows (which from what I knew they were copyrighted), or depth buffer based shadows? Any answers or suggestions would be helpful.
TheAdmiral
TheAdmiral
This is neither an answer or a suggestion, but a realistic observation that you probably won't like: it sounds like you're punching above your weight. Writing an engine that's anywhere near reasonably modern is a very difficult task for the most experienced games programmers.

If it's a school project and you're on a time budget, then I suggest you forget about shaders and portals, and try to write something simple but effective that's well-documented, such as a quad-tree engine. It's probably more than you'd need to get full credit, and you won't regret biting off too much at a later date.

Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
haphazardlynamed
haphazardlynamed
I like Portal Engines...
A simple one, used for collision detection and visibility culling; without any fancy shaders, shadows, or realtime lighting is pretty simple to do.
I made one at that level in about a week when making a Descent clone; assuming you have the opengl knowlege, and the 3d math experience, it should be do-able.

This is a great resource for portals:
http://www.flipcode.com/articles/portals_issue01.shtml
its primarily geared for writing a software based engine from scratch with no hardware acceleration.
But since you're using openGL you're in luck since that lets you gloss over about half of the hard parts. (specifically you really don't need to care about "overdraw" so much, which lets you play loosey-goosey with the frustum checks and other math intensive areas.)


Oh, transparent surfaces. If your Portal Engine is extremely simple, like the oldschool Descent type; whereby the actual map 'brush' geometry is intrinsically linked to the portals and sectors themselves; then sorting becomes trivial for static polygons. Since within a sector order doesnt matter(convex) and the rest is your portal transversal.
madu
madu
Thanks for your answers. I don't know if a quad-three is what I want (at least an OC-Tree). But I don't see the difficulty of portals... Actually, I think it will be fun to program. BSPs & BSP collision detection & lightmaps were quite fun to do, even though they were sometimes a pain to debug.

I don't really have problems with maths - especially geometry (actually maths and computer science is what I study at my university) - or programming in general. I don't want to develop a full-blown engine. The project is more about OpenGL than the engine itself, but I have to have a solid application to show, not just some spinning triangles or something like that. Also, because the project is about OpenGL too, shaders would have been nice to have.

There are a lot of tutorials that teach you all kinds of stuff. But first, I have to know what I'm looking for. I just need some hints to start off, then I'll be able to continue by myself.
Stani R
Stani R
Shaders are not particularly painful - you only need a day or two to read the docs and code the plumbing for it - but coming up with interesting shader effects beyond per-pixel lighting and the proverbial "toon" shader could be a pain.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.