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

Deferred rendering

5 posts in this topic

Hello! I'm working on a deferred rendering engine ( lighting ) for my game. The approach is really simple : 
 

  1. Set up multiple render targets for color,specular,depth etc.. (GBuffer) 
  2. Draw geometry
  3. Resolve render targets ( GBuffer)
  4. Draw lights

I'm drawing the geometry with the GBuffer shader whose pixel shader returns the different render target values, but what if i wanted to use "custom" shaders for the geometry that don't return the values for the multiple render targets : the "normal" shaders.

 

My idea would be :

  1. Draw geometry with "normal" shaders to a render target
  2. Set up multiple render targets (GBuffer)
  3. Draw the previously rendered scene once again 
  4. Resolve render targets (GBuffer)
  5. Draw lights

This approach shouldn't be very memory expensive and seems quite simple, but i'm interested in knowing how other people tackled this problem and if there are "better" solutions. If my idea is completely wrong please tell me!

 

Thank you for your time and happy coding!

 

0

Share this post


Link to post
Share on other sites

You don't specify what you do with the render target filled in step 1. If it's not used, then step 1 can be skipped and where back at the begining.

 

So, I'm not sure what you want to accomplish here exactly. Either write down the complete algorithm or just describe the problem and desired outcome.

 

Usually, deferred rendering is "extended" the other way round. Do the deferred passes first, including lighting and then things that can't be done deferred (i.e. semi transparent parts or some post processing steps).

0

Share this post


Link to post
Share on other sites
I'm sorry if i didn't make myself clear.
The texture in pass1 is the complete scene rendered without lighting but with the shaders used in the forward lighting model, so they are not refactored for the GBuffer. I then take that texure and draw it fullscreen after having set the GBuffer. Thus i continue with the normal deferred process.

I wanted to know if there was a way to use the shaders used in the forward lighting model without rewriting them for multiple render targets output.
0

Share this post


Link to post
Share on other sites

Generally you do not do this, there's no point writing a deferred renderer and then spend time writing non-deferred passes. The whole point of the deferred path is to bring everything together into the same lighting equation.

 

The problem with transparent geometry is that you need the information for the surface as well as what's behind it (which might change based on the shader for the transparent surface) so that's why they're usually done in a separate, forward-pass, renderer. You can also just render your forward pass geometry in a similar way, prior to the transparent phase. It just doesn't really make much sense, if you want to render using deferred rendering then use deferred rendering otherwise don't bother (either choice is fine, but don't go all hand wavey and say "I wan't both so I don't have to change my old shaders").

 

So you can do:

 

Deferred Rendering Pass

Forward Rendered Opaque

Forward Rendered Transparent

 

Though, I wouldn't really recommend that. It just seems the appropriate answer to what I believe you're asking.

 

Also, you mention "Thus i continue with the normal deferred process." which reads like you want to interleave the deferred rendering with your forward rendering which isn't going to work at all and makes even less sense (and that makes me think I perhaps misunderstood you).

 

My suggestion is just to redo your forward-opaque shaders so that they are deferred *or* don't bother with a deferred renderer.

 

If I've missed the point entirely (which, it seems a little confused, so I certainly may have) feel free to ask further.

 

n!

1

Share this post


Link to post
Share on other sites

Generally you do not do this, there's no point writing a deferred renderer and then spend time writing non-deferred passes. The whole point of the deferred path is to bring everything together into the same lighting equation.

 

The problem with transparent geometry is that you need the information for the surface as well as what's behind it (which might change based on the shader for the transparent surface) so that's why they're usually done in a separate, forward-pass, renderer. You can also just render your forward pass geometry in a similar way, prior to the transparent phase. It just doesn't really make much sense, if you want to render using deferred rendering then use deferred rendering otherwise don't bother (either choice is fine, but don't go all hand wavey and say "I wan't both so I don't have to change my old shaders").

 

So you can do:

 

Deferred Rendering Pass

Forward Rendered Opaque

Forward Rendered Transparent

 

Though, I wouldn't really recommend that. It just seems the appropriate answer to what I believe you're asking.

 

Also, you mention "Thus i continue with the normal deferred process." which reads like you want to interleave the deferred rendering with your forward rendering which isn't going to work at all and makes even less sense (and that makes me think I perhaps misunderstood you).

 

My suggestion is just to redo your forward-opaque shaders so that they are deferred *or* don't bother with a deferred renderer.

 

If I've missed the point entirely (which, it seems a little confused, so I certainly may have) feel free to ask further.

 

n!

You absolutely got the point, i will convert all the shaders for deferred rendering and move on. 

Sorry if the question was confused, but my mind is too. :)


Thank you and happy coding!

0

Share this post


Link to post
Share on other sites

Sorry if the question was confused, but my mind is too

 

Oh it's fine, I was more worried I'd gone off on a tangent and missed what you wanted to know, rather than the question itself.

 

Thank you and happy coding!

You too, and have fun!

 

n!

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