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

To Defer or Not To Defer

5 posts in this topic

I've had my eye on deferred lighting for a while. In my renderer, I've tried sending an arbitrary amount of lights through a shader and using expensive loops per-pixel, and an attempt at forward rendering that requires me to draw the screen a bunch of times which is also very expensive.

 

However, it sounds like deferred lighting still requires a forward renderer for transparent, reflective, or refractive objects. Is that correct? I could understand if this is the case for transparent objects, but not for reflective/refractive objects since you could just render the scene to a cube map with deferred lighting applied to it. Also, if I'm wrong and reflection and refraction is possible, then why not just make all transparent objects refractive with a refraction index of 1? Sure, cube maps can be expensive, but then again, everything is at least a little refractive. It could us to abuse refraction and reflection more since the maps are updated anyway.

 

Now, here's the biggest problem I face: all of these are pretty tough on mobile hardware. MRTs won't be an option on mobile hardware until Open GL ES 3.0-compliant devices are mainstream since Tegra 3's the only hardware I know of that support it as an extension... My shaders for mobile allow you to have up to 1 of each light enabled: global (directional), point, and spot light, but that's quite a bit too. Would supporting light maps be the best way to go for mobile devices?

0

Share this post


Link to post
Share on other sites

However, it sounds like deferred lighting still requires a forward renderer for transparent, reflective, or refractive objects. Is that correct? I could understand if this is the case for transparent objects, but not for reflective/refractive objects since you could just render the scene to a cube map with deferred lighting applied to it. Also, if I'm wrong and reflection and refraction is possible, then why not just make all transparent objects refractive with a refraction index of 1? Sure, cube maps can be expensive, but then again, everything is at least a little refractive. It could us to abuse refraction and reflection more since the maps are updated anyway.

Now, here's the biggest problem I face: all of these are pretty tough on mobile hardware. MRTs won't be an option on mobile hardware until Open GL ES 3.0-compliant devices are mainstream since Tegra 3's the only hardware I know of that support it as an extension... My shaders for mobile allow you to have up to 1 of each light enabled: global (directional), point, and spot light, but that's quite a bit too. Would supporting light maps be the best way to go for mobile devices?

 

The reason transparent objects are usually done with forward rendering is because you have to render in a specific order. If you just rendered using your reflection cube map, then you wouldn't be able to have multiple layers of transparency. Also using a cube map for transparency would probably create artifacts because reflection cube maps are usually lower resolution.

 

I think that if you're targeting current mobile hardware then deferred lighting is not really that wise a choice. If you're playing a long game, or you're just playing with it then maybe that's OK, but fill rate is so restricted on many mobile chipsets and MRT support so limited that I'd advise against it. There's an article on light prepass rendering which is probably more viable than full deferred on mobile, but I think you're still going to get better results with forward rendering http://www.altdevblogaday.com/2012/03/01/light-pre-pass-renderer-on-iphone/. You mention light maps, if they're a viable approach for your project then use them as they perform very well on powervr chips.

2

Share this post


Link to post
Share on other sites

Some thoughts:

 

Mobile devices generally have really small screens. Is deferred rendering really worth it?

 

As for rendering the scene to a cubemap with deferred rendering, well that just sounds ridiculously expensive, and again, mobile hardware

 

No MRTs means multiple full-scene passes. Thats however many buffers there are in the gbuffer, x7 (1 for screen,  6 for a cubemap).

 

We tend not to use refraction on most transparent objects because it's quicker to use normal boring alpha blending. (Did I misunderstand you here?)

 

I was playing Black Ops 2 earlier, and I noticed a weird transition on the reflections on my golden gun whenever I exited a room. That I suspect is caused by the engine using pre-baked cubemaps.

 

Lightmaps can look absolutely gorgeous if well done.

2

Share this post


Link to post
Share on other sites

Yah, definitely not a mobile thing yet unless you're targeting quite far into the future. If you're using OpenGl ES 3.0 or above as your minimum spec, and have some large art requirements the equal of current gen consoles games or better, and are exclusively targeting Tegra 4 or above as your spec (and Tegra 4 isn't even fully 3.0 compliant) then I don't see what benefit you'd gain.

1

Share this post


Link to post
Share on other sites

The reason transparent objects are usually done with forward rendering is because you have to render in a specific order. If you just rendered using your reflection cube map, then you wouldn't be able to have multiple layers of transparency. Also using a cube map for transparency would probably create artifacts because reflection cube maps are usually lower resolution.

 

The reason transparent objects are rendered using forward rendering is because MRT in DX9 class hardware cannot selectively use one channel from one render target as the alpha channel and not use the same channel from the other render targets in a similar way. In other words, if you have 4 render targets each with an R,G,B,A channel and enable alpha blending, then the alpha channels of all 4 render targets are considered not just the alpha channel of the 1st render target (if that's the render target/channel that represents your alpha component in your G-buffer). This generally yields an invalid visual result. Anyway, with > DX9 class hardware you should be able to selectively blend using individual channels from selected render targets.

2

Share this post


Link to post
Share on other sites

Deferred style renderers are a terrible idea on mobile due not only to bandwidth limitations, but cache issues and other memory issues related to the fact that the dominant mobile chips are tile based deferred renderers running in very tight constraints. I'm also finding that at very high resolutions (4K and above), deferred starts to behave very poorly with respect to bandwidth. I'm planning to investigate tiled-forward as a better alternative on modern hardware, though it doesn't seem to have gotten much attention yet.

 

In general, I think it's safest to treat mobile devices roughly as if they were desktop GPUs from approximately 10 years ago, give or take.

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