• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0

Implementing Meagher's Octree Renderer

1 post in this topic

I have a question about Donald J. Meagher's paper called Efficient Synthetic Image Generation of Arbitary 3D Objects. The paper for those who don't know is a method of rendering octrees or octrees of voxels written back in the days when floats were too costly to use on CPU's. The algorithm pretty much goes like this:


1. Recurse through your octree in front to back order

2. If octree node is visible, project onto a quadtree of the screen

3. Find which nodes are intersected by the node

4. If that spot of the screen is free, draw the node


Part 3 and 4 is where it gets confusing for me. He mentions some sort of overlay algorithm where you make 4 bigger bounding boxes around the bound of the projected node and use this to test against the quadtree. He also tests I guess the remaining nodes against the bound of the projected node as well as lines created from the silouhette lines (edges) of the projected node for intersection.


To me, a lot of this seems redundant for example, whats the purpose of this overlay algorithm if he already checks the bound of the projected node against the quadtree nodes? Also, how does he get the line formula without doing division? Isn't a division needed for the slope?


The way I thought about implementing was also to use the bound of the projected node which would give you something like this:




At this point, you would recurse through the quadtree until you got a list of all the nodes intersecting the bound of your projected node:




Here's where im sort of lost as to what I should do.Although I have a list of all nodes intersecting the bound of the projected node, they don't always encapsulate the actual projected node as shown by this picture:




So do I do the same thing as he does in terms of making line formulas for each edge of the faces and then checking if the node is on other side of the line? Won't this be computationally heavy just to figure out where a shape sits in terms of the screen quadtree? If I intersect 12 nodes like in my drawn case, I would have to do 144 line checks (4 lines per face * 3 faces * 12 nodes) + more for however many times I subdivide to get down to the pixel level. I could test all of the nodes against the 6 edges of the projected node but then I wouldn't know which pixels correspond to the face of the octant which is important if each octant face has a different color.


I also was wondering if there would be a way of figuring out which faces are not on screen without projecting them all? I know it should be possible since you only have a few possible cases (3 or 2 faces are actually projected). Or can this be done with some kind of distance tests?


And also, if someone understands how the paper describes doing this, that would be of great especially the overlay algorithm he uses.


Share this post

Link to post
Share on other sites

Okay so I re-read the the paper and I understand the overlay algorithm a bit better. Its explained in a really weird fashion but its pretty much just standard quad tree insertion as far as I understand. You start of with the root of the quad tree and check if the bound of your projected node intersects. If it does, you check it against the quad tree's children. In the paper they illustrate only the case where at this point, the bound intersects all 4 of the children but there are actually 3 cases with a square (and rectangle I believe).


1. It could be completely encapsulated inside one of the roots children.

2. It could overlap two of the roots children.

3. It could overlap 4 of the roots children.


In each case, you could just recursively subdivide until you found out to the pixel level where your projected node sits and since your projected nodes will usually try to be 1 pixel or less (working with large voxel data sets and the nature of this renderer), then your probably going to hit around a pixel or two for your bound. Whats also important to note its that if your projected node has children, then subdivide it as well and check its children against the next nodes instead of itself (as long as its not less than or equal to 1 pixel). 


So all in all, your left with this kind of algorithm for the first half:


1. Project the root of the octree.

2. If it is visible, subdivide the quadtree

3. If the root has children, project its children and check which quadtree nodes they overlap. (if no children, than just check the root octant)

4. Keep going until you hit 1 octree node per pixel or you hit a leaf node


I'm still confused as to how he makes the half planes and checks for that. I don't really know the math of planes too well but I assume its just simply y = mx + b lines for the edges of the projected octree node. It still confuses me how he doesn't use multiplication or division for these operations. Also, I still want to know, is there a quicker way to check if a projected node overlaps a bunch of quad tree nodes if you already know which quad tree nodes its bound overlaps?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0