Jump to content
  • Advertisement
Sign in to follow this  
Medo Mex

Deferred Rendering and Particles

This topic is 930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Guys,
 
I'm trying to render particles using forward pass (I'm using deferred rendering to render solid objects)
 
As a result, I get two textures (full screen quads):
- The scene with solid objects rendered using deferred lighting
- The particles (rendered to a separate texture)
 
What is the correct way to combine both textures so I can get the final scene with the correct depth?

Share this post


Link to post
Share on other sites
Advertisement

I have been trying to pass the scene depth to the particles to compare the depth and discard the pixels accordingly, I'm not sure if what I'm doing is correct.

 

How do I combine between two textures (forward rendering texture and deferred rendering texture)?

Share this post


Link to post
Share on other sites

I don't think you need to render the particles to a separate texture. Just do the lighting passes and then render the particles into the HDR buffer.

Share this post


Link to post
Share on other sites

@Mona2000: How? The lights are calculated on screen space.

 

Here is what I'm doing:

 

1. Render the scene to multiple render targets (Color, Normal, Depth, etc...)

2. Calculate lights on screen space

 

Now, If I render the particles after calculating the lights I would be rendering the particles to the back buffer and the particles will always be visible (it won't care about the scene depth).

Share this post


Link to post
Share on other sites

What stops you from using the depth render target (or depth buffer) from the deferred pass?

Edited by Mona2000

Share this post


Link to post
Share on other sites


Here is what I'm doing:
 
1. Render the scene to multiple render targets (Color, Normal, Depth, etc...)
2. Calculate lights on screen space

Yes but what render target are you using for 2.  You can do forward rendering into that render target assuming you're not doing in place lighting.  It's just as mona2000 describes IIRC.

Share this post


Link to post
Share on other sites

@Mona2000:

@Infinisearch:

 

The screen space lighting calculation was clearing the depth stencil view

 

The way I'm doing it now is using two depth stencil views, one for rendering the scene and the particles and one for calculating lights on full screen quad and doing all the screen space post processing.

 

Now it's working as expected.

 

I have two questions:

 

1. Should I render the particles before or after tone mapping?

2. Should I render the transparent meshes the same way as I'm rendering the particles now?

Share this post


Link to post
Share on other sites

I don't understand why you need a second DSV for lighting and SS processing? Normally you would disable DVS for those stages..?

 

1) I would say so, particles are a part of the scene, so render them before tonemapping..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!