Jump to content
  • Advertisement
Sign in to follow this  
LotusExigeS1

Linear depth and SSAO

This topic is 2504 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

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

Hello mateys,

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

I have recently moved from storing the actual position in my gbuffer to linear depth. I then use the linear depth with the frustum corner to get the view space position. All this works great with no issues.

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

The problem I have is that my old SSAO shader adjusts the texcoords in the pixel shader to get the surrounding pixels to calc the SSAO. How do you do this when the vs passes the interpolated corner and then the pixel shader uses the sampled pixel depth to get the position ? Is there still a way to do this ?

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

Hope this makes sense and thanks for any help.

[/font]

Share this post


Link to post
Share on other sites
Advertisement
If you really need to recreate the position of the sample locations, then you will have to do the interpolation yourself for each sample. You are essentially just interpolating one vector per location that you look up, but I would still try to find a way to do your comparisons without reconstructing the complete position (i.e. just use the depth values as they are). This is probably more possible if you have the normal at each depth pixel stored as well.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!