1 registered members (AndrewAMD),
1,534
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: trying to get ssao working, too
[Re: xXxGuitar511]
#179806
01/25/08 00:47
01/25/08 00:47
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Quote:
dunno if using a 32 bit floating point texture for the depth map could be the solution, since i cant get it to work.. BMAP* depthMap = "#800x600x14"; is always plain white
put the depth in the red channel, and you could probably just ignore the green and blue, but i put them on 0, 0, and 1.0 for alpha anyway.
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: trying to get ssao working, too
[Re: JibbSmart]
#179807
01/25/08 01:08
01/25/08 01:08
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
why not store the depth in blue and green as well? Gives you a 256*4= 1024 byte range if you used addition. Pseudo-code: Code:
out_color.r = clamp(depth , 0, 255); out_color.g = clamp(depth-256, 0, 255); out_color.b = clamp(depth-512, 0, 255); out_color.a = clamp(depth-768, 0, 255);
...or you could use multiplication? giving you a 256+512+1024+2048= 3840 range (at least).Pseudo-code: Code:
out_color.r = clamp(depth , 0, 255); // 0 - 255 out_color.g = clamp((depth-256)/2 , 0, 255); // 255 - 768 out_color.b = clamp((depth-768)/4 , 0, 255); // 769 - 1792 out_color.a = clamp((depth-3840)/8, 0, 255); // 1793 - 3840
...I'd give it a try, but I don't have my computer anymore, so I can't do shaders. Otherwise I'd be all over SSAO & shadowmapping
xXxGuitar511 - Programmer
|
|
|
Re: trying to get ssao working, too
[Re: PHeMoX]
#179809
01/25/08 02:42
01/25/08 02:42
|
Joined: Jun 2004
Posts: 655 to your left
BoH_Havoc
User
|
User
Joined: Jun 2004
Posts: 655
to your left
|
wow very impressive shots! Quote:
dunno if using a 32 bit floating point texture for the depth map could be the solution, since i cant get it to work.. BMAP* depthMap = "#800x600x14"; is always plain white
Did you change your shader to only use the .r channel of the texture? A 16 or 32Bit fp texture only renders to the red channel as far as i know.
keep it up, really impressive!
[edit] Quote:
Trick seems to be to render to the alpha channels instead of rgb channels... it's 8bit per color channel vs. 24Bit alpha channel apparently:
Quote:
ello: The trick is to render to depthmap to the alpha channel and not the rgb channel. The alpha channel is 24Bit whereas the rgb channels are 8 bit each. You might want to have a look at this paper: http://ati.amd.com/developer/gdc/Scheuermann_DepthOfField.pdf />
Cheers
At the time i wrote this in my DoF thread i really thought that would be the case. But i think i was wrong. I read somewhere that an alpha channel always is 24Bit. However when you look at it that can't be the case. eg 32bit tga = 8Bit Red + 8Bit Green + 8Bit Blue + 8Bit Alpha ... 8+8+8+8 = 32. Can someone confirm this?
Last edited by BoH_Havoc; 01/25/08 02:51.
|
|
|
Re: trying to get ssao working, too
[Re: PHeMoX]
#179810
01/25/08 02:43
01/25/08 02:43
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
no, look at the shader workshop. if you want to use a 32-bit floating point texture (such as in this case), store the depth in the red channel. the others are redundant in this case, i'm pretty sure. you have to output a float4 colour (COLOR0 semantic) but in this case only the red matters.
julz
EDIT: not @ BoH_Havoc, who said what i said before but more clearly.
Last edited by JulzMighty; 01/25/08 02:48.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|