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

Rendering models with transparent parts

4 posts in this topic

Bit of a weird problem that I feel I should know the answer to.

 

I have a number of models that have transparent areas (e.g torn cloth, hair). I'm rendering them all with the same shader in XNA. Some of them appear correctly, others don't: the transparent areas 'overwrite' the pixels beneath them (like when you don't sort the depths of models with transparency). But given that it is within the same model (all uses a single texture), I'm not sure how to solve it. Why do some models render correctly and others don't?

I'm guessing it's just an accident that those polys happen to be rendered in a bad order.

Thoughts and solutions?

 

Thanks a lot. 

0

Share this post


Link to post
Share on other sites

For sure this happens because of bad render order.

 

Usually if I want to make a transparent part of a model, I add it to a different subset, i.e., with a different texture. I think in this way you won't have a problem. If you add the parts with alpha and the opaque parts in the same texture probably you will have to reorder the polys each time you draw depending on the view which I don't think is a good idea.

 

And as you already mentioned you should sort the objects with alpha by depth and always remember to render them after the objects which are opaque.

 

Hopefully this helps you.

 

BGH

0

Share this post


Link to post
Share on other sites

Thanks for the quick reply BigGiantHead (nice name)

 

I was hoping to find a solution that wouldn't need different textures. You suggested that on the same texture you'd have to constantly reorder the polys each time but this doesn't seem to be necessary with those models that are already working. I assume that just means that on those models, the transparent parts are in a different ModelMeshPart that is rendered later than the others (are they grouped like that?) If that's the case, how do you arrange them so they're rendered in the correct order?

 

Worst case scenario I might just be lazy and model polys around the transparent edges. I'm fairly low poly so it'd be manageable.

0

Share this post


Link to post
Share on other sites

Actually I don't know if it is even possible to order the polys with a reasonable computational overhead.

 

If you want to get good and robust results you render everything with alpha after the opaque models, and of course ordered by depth.

That's the way to be sure that your models are ordered in the right way. Even then. there might be some problems with particles for example, or with instanced objects.

 

I don't think you'll get good results if you render the whole model in one go. 

 

I'm curious, is it possible to see a screenshot from the model you are having problems with.

 

BGH

0

Share this post


Link to post
Share on other sites

Well I've solved it. Not entirely sure what was going on but the behaviour of these transparent parts made had me speculating that there was just some simple material options that could fix it (and I was right).

I'm working in 3ds max. Separated the model into opaque and transparent models. Applied the same texture (in 2 dif instances) to each model and then recombined them. Problem solved, works fine.

I'm guessing this forced XNA to interpret the model as having 2 ModelMeshParts instead of 1?

Thanks for the input all the same!

1

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