• 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
mv348

Stencil shadow volumes - constraints on models too delicate?

4 posts in this topic

I am working on my first implementation of Stencil Shadow volumes and I have to say I'm a bit skeptical. I read this tutorial (and the tutorial the follows) and I understand the concept, the math and the geometry quite well, but the tutorial did not say if there are any constraints on the types of models you can render. Certainly I can see that any model involvng transparrencies would be bad news, but no information about the general shape.

In particular, the algorithm in the tutorial assumes that a given edge on a triangle will always be adjacent to another triangle. If you peek at my model below, you can see that the low end of his shirt (that hangs down beneath his belt) has no adjacencies at the edge. So I decided for this case that when an edge on a front facing triangle doesn't have an adjacent triangle at all, it is assumed to be a silohuette edge. It appears to work fairly well. The bottom edge of his shirt was marked as an edge appropriately. The model features plenty of such edges, especially at joints of the major body parts. Are stencil shadow volumes even expected to work for a model such as this? If no, what contraints are needed on the model for this to work?

 

[attachment=13238:stencil_shadow_volumes.png]

My other question, here I am rendering the silohuette edges of the mesh in bind-pose, from the viewer's location  (silohuette edge calculation all done in CPU at the moment, moving to GPU later). I have it set to rotate as it is displayed. As the model rotates, a very small but noticable number of edges tend to flicker (marked in yellow in the attached image). Sometimes little sections of edges disappear. The outisde outline seems to always be there, but various other edges flicker in and out as it rotates. Will such minor variations in the silohuette edges cause noticable artifacts when rendering the shadow volume?

In case someone asks,

1. I have properly computed and checked my indices to make sure I am retrieving adjacent vertices.
2. I consider an edge a silohuette edge if its triangle is front facing, and its adjacent triangle is back facing OR if there is no adjacent triangle.
3. I consider an edge front facing if (eyeLocation - edgeVertex0) dot faceNormal > epsilon. I have tried adjusting epsilon but it does not appear to help any of the flickering edges.

Some advice would be most appreciated!


 

Edited by mv348
0

Share this post


Link to post
Share on other sites

This might be unrelated to your silhouette edge finding problem, but usually, shadow volume meshes must be "water-tight" -- i.e. the mesh must form a completely closed geometry. Some modelling tools have helper functions to help close off a mesh like this.

 

For example, excuse my bad mspaint drawing of a green arm connecting to a blue glove...

Often these kinds of connections will have gaps that can be seen at certain angles (1st image), which is bad.

The easiest fix for an artist is just to close off the 'outer' shape (the glove here), but leave the other one open, which is bad (2nd image).

You either have to close off both (3rd image), or properly weld them together (4th image).

DEr7b.png

 

 

Also, IIRC there's different constraints on your models depending on which stencilling technique you choose (there's many ways to render shadow volumes using the stencil buffer). It may be that some of these techniques tolerate non-water-tight meshes while other's don't...

1

Share this post


Link to post
Share on other sites

Thanks for that speedy reply, Hodgeman. No, that is exactly what I am asking about. I was afraid that a non-watertight (i guess the proper term is 'non-Gaussian') surface might mean bad news. :\ Moreover, my model appears to be just like the drawing second from the top that you made. That's depressing! sad.png

 

I wonder what I should do. I don't have an artist helping me and only work with models I purchase from Turbosquid, so I am kind of at a loss for how to proceed... 

 

(edit)

So this article describes a modification to the algorithm for low quality, 'non-two manifold' meshes (Hey we now have three names for them!). Essentially it says to do exaclty what I'm doing with the edges that don't have neighbors. However! They also render silohuette edges between faces that switch from back-facing to front facing (as opposed to just front facing to back facing). I'll try rendering the silohuette edges this way and post a screenshot.

Edited by mv348
0

Share this post


Link to post
Share on other sites

There is a better algorithm for producing shadow volumes. Check out this paper: http://hungryspoon.com/PX_web/paper/paper.pdf

 

Not sure why it isn't more commonly known, I implemented it years ago in my hobby engine and it worked great. I didn't have to worry about the meshes at all, if it looked solid from the lights point of view it would cast a proper shadow.

0

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