Is the game still a lot darker than normal? Sorry for not following progress.Fuck yeah!
I fixed the SSAO issue! (and without impacting performance)
Is the game still a lot darker than normal? Sorry for not following progress.Fuck yeah!
I fixed the SSAO issue! (and without impacting performance)
Yes. I still want to fix the issue some people experience with SMAA, but I still couldn't reproduce it
It will be in the next version, but if you can't wait you should be able to just replace the contents of VSSAO.fx with this:
Code:// Volumetric SSAO // Implemented by Tomerk for OBGE // Adapted and tweaked for Dark Souls by Durante /***User-controlled variables***/ #define N_SAMPLES 9 //number of samples, currently do not change. extern float scale = 1; //downsampling scale, 1 is highest quality but slowest extern float aoRadiusMultiplier = 1.2; //Linearly multiplies the radius of the AO Sampling extern float aoStrengthMultiplier = 2.0; //Linearly multiplies the strength of the AO extern float aoClamp = 0.0; //The maximum strength of the AO, 0 is max strength, 1 is weakest extern float ThicknessModel = 30000.0; //units in space the AO assumes objects' thicknesses are extern float FOV = 68; //Field of View in Degrees extern float luminosity_threshold = 0.3; #define LUMINANCE_CONSIDERATION //comment this line to not take pixel brightness into account //#define RAW_SSAO //uncomment this line to show the raw ssao /***End Of User-controlled Variables***/ static float2 rcpres = PIXEL_SIZE; static float aspect = rcpres.y/rcpres.x; static const float nearZ = 10.0; static const float farZ = 5000.0; static const float2 g_InvFocalLen = { tan(0.5f*radians(FOV)) / rcpres.y * rcpres.x, tan(0.5f*radians(FOV)) }; static const float depthRange = nearZ-farZ; texture2D depthTex2D; texture2D frameTex2D; texture2D prevPassTex2D; sampler depthSampler = sampler_state { texture = <depthTex2D>; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR; }; sampler frameSampler = sampler_state { texture = <frameTex2D>; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR; }; sampler passSampler = sampler_state { texture = <prevPassTex2D>; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR; }; struct VSOUT { float4 vertPos : POSITION; float2 UVCoord : TEXCOORD0; }; struct VSIN { float4 vertPos : POSITION0; float2 UVCoord : TEXCOORD0; }; VSOUT FrameVS(VSIN IN) { VSOUT OUT = (VSOUT)0.0f; // initialize to zero, avoid complaints. OUT.vertPos = IN.vertPos; OUT.UVCoord = IN.UVCoord; return OUT; } static float2 sample_offset[N_SAMPLES] = { //#if N_SAMPLES >= 9 float2(-0.1376476f, 0.2842022f), float2(-0.626618f, 0.4594115f), float2(-0.8903138f, -0.05865424f), float2(0.2871419f, 0.8511679f), float2(-0.1525251f, -0.3870117f), float2(0.6978705f, -0.2176773f), float2(0.7343006f, 0.3774331f), float2(0.1408805f, -0.88915f), float2(-0.6642616f, -0.543601f) //#endif }; static float sample_radius[N_SAMPLES] = { //#if N_SAMPLES >= 9 0.948832, 0.629516, 0.451554, 0.439389, 0.909372, 0.682344, 0.5642, 0.4353, 0.5130 //#endif }; float2 rand(in float2 uv) { float noiseX = (frac(sin(dot(uv, float2(12.9898,78.233)*2.0)) * 43758.5453)); //float noiseY = sqrt(1-noiseX*noiseX); float noiseY = (frac(sin(dot(uv, float2(12.9898,78.233))) * 43758.5453)); return float2(noiseX, noiseY); } float readDepth(in float2 coord : TEXCOORD0) { float4 col = tex2D(depthSampler, coord); float posZ = clamp(((1.0-col.z)/256.0 + (1.0-col.y) + 256.0*(1.0-col.x))/(5.0), 0.0, 1.0); //float posZ = ((1.0-col.y) + 256.0*(1.0-col.x))/(5.0); return ((2.0f * nearZ) / (nearZ + farZ - posZ * (farZ - nearZ)))*10.0; //return posZ / (depthRange - (depthRange - 1.0)*posZ); //float posZ = ((1.0-col.y) + 256.0*(1.0-col.x)); //return posZ; } float3 getPosition(in float2 uv, in float eye_z) { uv = (uv * float2(2.0, -2.0) - float2(1.0, -1.0)); float3 pos = float3(uv * g_InvFocalLen * eye_z, eye_z ); return pos; } float4 ssao_Main( VSOUT IN ) : COLOR0 { clip(1/scale-IN.UVCoord.x); clip(1/scale-IN.UVCoord.y); IN.UVCoord.xy *= scale; float depth = readDepth(IN.UVCoord); float3 pos = getPosition(IN.UVCoord, depth); float3 dx = ddx(pos); float3 dy = ddy(pos); float3 norm = normalize(cross(dx,dy)); norm.y *= -1; float sample_depth; float ao=0; float s=0.0; float2 rand_vec = rand(IN.UVCoord); float2 sample_vec_divisor = g_InvFocalLen*depth*depthRange/(aoRadiusMultiplier*4000*rcpres); float2 sample_center = IN.UVCoord + norm.xy/sample_vec_divisor*float2(1,aspect); float sample_center_depth = depth*depthRange + norm.z*aoRadiusMultiplier*10; for(int i = 0; i < N_SAMPLES; i++) { float2 sample_vec = reflect(sample_offset[i], rand_vec); sample_vec /= sample_vec_divisor; float2 sample_coords = sample_center + sample_vec*float2(1,aspect); float curr_sample_radius = sample_radius[i]*aoRadiusMultiplier*10; float curr_sample_depth = depthRange*readDepth(sample_coords); ao += clamp(0,curr_sample_radius+sample_center_depth-curr_sample_depth,2*curr_sample_radius); ao -= clamp(0,curr_sample_radius+sample_center_depth-curr_sample_depth-ThicknessModel*depth*depth*depth,2*curr_sample_radius); s += 2*curr_sample_radius; } ao /= s; // adjust for close and far away if(depth<0.08) ao = lerp(ao, 0.0, (0.08-depth)*25); //if(depth>0.5) ao = lerp(ao, 0.0, (depth-0.5)*10); ao = 1.0-ao*aoStrengthMultiplier; //return float4(depth,depth,depth,1); return float4(ao,ao,ao,1); } float4 Blur( VSOUT IN ) : COLOR0 { float color = tex2D(passSampler, IN.UVCoord).r*4; color += tex2D(passSampler, IN.UVCoord + float2(rcpres.x,0)).r*2; color += tex2D(passSampler, IN.UVCoord + float2(-rcpres.x,0)).r*2; color += tex2D(passSampler, IN.UVCoord + float2(0,rcpres.y)).r*2; color += tex2D(passSampler, IN.UVCoord + float2(0,-rcpres.y)).r*2; color += tex2D(passSampler, IN.UVCoord + rcpres).r; color += tex2D(passSampler, IN.UVCoord - rcpres).r; color += tex2D(passSampler, IN.UVCoord + rcpres * float2(1,-1)).r; color += tex2D(passSampler, IN.UVCoord - rcpres * float2(1,-1)).r; color /= 16; return float4(color,1,1,1); //return tex2D(passSampler, IN.UVCoord).r; } float4 Combine( VSOUT IN ) : COLOR0 { float3 color = tex2D(frameSampler, IN.UVCoord).rgb; float ao = clamp(tex2D(passSampler, IN.UVCoord/scale).r, aoClamp, 1.0); #ifdef LUMINANCE_CONSIDERATION float luminance = color.r*0.3+color.g*0.59+color.b*0.11; float white = 1.0; float black = 0; luminance = clamp(max(black,luminance-luminosity_threshold)+max(black,luminance-luminosity_threshold)+max(black,luminance-luminosity_threshold),0.0,1.0); ao = lerp(ao,white,luminance); #endif color *= ao; //return float4(ao, ao, ao,1); return float4(color,1); } technique t0 { pass p0 { VertexShader = compile vs_3_0 FrameVS(); PixelShader = compile ps_3_0 ssao_Main(); } pass p1 { VertexShader = compile vs_3_0 FrameVS(); PixelShader = compile ps_3_0 Blur(); } pass p2 { VertexShader = compile vs_1_1 FrameVS(); PixelShader = compile ps_2_0 Combine(); } }
No support for this!
I managed to get it working with VIA audioSame as this question, I never thought I'd miss realtek.
I believe this is cause by in game AA being on. Could be wrong though...Why do i get this? :
I believe this is cause by in game AA being on. Could be wrong though...
I managed to get it working with VIA audio. I did a lot of messing around, so I'm not sure exactly how I fixed it, but this is what I think I did:
- In Vdeck I set my output to 6 channels, with side speakers instead of back ones (not sure if this step actually did anything).
- Uninstalled Vdeck and the VIA audio drivers, then restarted PC.
- Then I just followed the steps here http://www.neogaf.com/forum/showpost.php?p=41642354&postcount=3568. Before it wouldn't work, but after installing and removing the VIA audio drivers it works.
What is AO? lol =S
Fuck yeah!
I fixed the SSAO issue! (and without impacting performance)
1.0 (actually, it was even worse than this, but this is the closest I cared to reconstruct):
You set the internal renderer higher than the display resolution, I think.So how to I enable SMAA?
So how to I enable SMAA?
# SMAA1x toggle and quality setting
# 0 = off (best performance, worst IQ)
# 1 = low
# 2 = medium
# 3 = high
# 4 = ultra (worst performance, best IQ)
smaaQuality 4
I really wouldn't suggest it, your whole scene will be too dark. Also, I really think my fixed SSAO is better in every way than the forced oneSo is it possible to use your AO & the forced AO in Nv Inspector? I ask because it seems like your AO is applying more to background objects than the forced Inspector AO. I'd like to use them in conjunction. Just asking if you would recommend it![]()
can't believe I am reading you guys not having any slowdown with the new SSAO effect. My 460 2GB GTX chugs to hell if I turn it on.
umm extra features? I have a couple of requests!
1. HUDless video recording! MSI Afterburner is really great but videos with a hud are kinda lame.
2. Disappearing HUD! Without any item switching button input or taking damage/changing status effects, the HUD will fade!
Not yet. I know now though that it only happens when the vertical resolution is larger than 720.Awesome work.
Did you ever figure out what happened with that sun issue?
To be honest I really only looked at quality and not performance when I tweaked it today. As long as it doesn't dip on my 660 at 2560x1440 I have no way of really noticing performance changes.Yeah SSAO thru this mod is also pretty slow for me on my GTX 460 OC. Forcing it through Nvidia Inspector gives me a smooth 30 fps at all times with the performance setting.
Not yet. I know now though that it only happens when the vertical resolution is larger than 720.
I want to add one more tiny graphical feature, then it's just the HUD and that issue left on my personal priority list.
Not yet. I know now though that it only happens when the vertical resolution is larger than 720.
I want to add one more tiny graphical feature, then it's just the HUD and that issue left on my personal priority list.
To be honest I really only looked at quality and not performance when I tweaked it today. As long as it doesn't dip on my 660 at 2560x1440 I have no way of really noticing performance changes.
But it will most likely always be slower than "performance" driver SSAO, but that's because it also looks better.
And of course I meant "no performance hit" as compared to the previous, buggy and ugly SSAO in 1.0, not overall. If I had invented a way to do SSAO without any performance hit I'd write a paper about it, not a forum post![]()
I really wouldn't suggest it, your whole scene will be too dark. Also, I really think my fixed SSAO is better in every way than the forced one
I'm extremely happy with the way the SSAO looks now, both in motion and in stills. I'm pretty hard to please when it comes to graphics, but save for the small bonfire issue I think it's almost perfect. I probably won't change a thing about it.
![]()
![]()
When you play with the effect on for a while and then turn it off everything looks really flat. I particularly love the self-shadowing-like effect on my character (the inside of the boots, behind the arm and arrows or even behind the ear). It's great.
(Note that the difference in colors in the above shots is due to a difference in fog, not the SSAO)
Yeah, I realize that some would consider it too dark, but that's an easily tweaked variable that everyone can set to whatever feels right for them.The corners look a bit too dark, look like someone just used a soft edged paint brush in photoshop. The grass and all that looks great though.
It's something I did because I personally think SSAO in general isn't an effect that looks good on distant objects. It would be relatively easy to change.Great work on the SSAO implementation, it really looks amazing (tried it out with the code you posted). One question though, is there any way of extending the area of effect? As someone else posted earlier it seems limited really close to your character and objects at medium+ range have the effect applied to them in an incredibly subtle manner, if it all? Was that a compromise to reduce artifacts in the distance?
It's something I did because I personally think SSAO in general isn't an effect that looks good on distant objects. It would be relatively easy to change.
I don't really see a reason to implement that, you can just play with them in the VSSAO.fx file. You can even reload the effect without restarting Dark Souls (look into the keybindings file), which is a huge help when tweaking variables!Durante, are you going to let us play with the SSAO variables via the .ini file?
It's not as straightforward as that (unlike the strength of the effect, for which there already is a parameter at the top of the file).How would one go about doing that? Is it a parameter that you already have in the code?
It's something I did because I personally think SSAO in general isn't an effect that looks good on distant objects. It would be relatively easy to change.
I don't really see a reason to implement that, you can just play with them in the VSSAO.fx file. You can even reload the effect without restarting Dark Souls (look into the keybindings file), which is a huge help when tweaking variables!
It's not as straightforward as that (unlike the strength of the effect, for which there already is a parameter at the top of the file).
extern float aoRadiusMultiplier = 1.2; //Linearly multiplies the radius of the AO Sampling
extern float aoStrengthMultiplier = 2.0; //Linearly multiplies the strength of the AO
extern float aoClamp = 0.0; //The maximum strength of the AO, 0 is max strength, 1 is weakest
No, it doesn't. The default screenshot key is now page down, could it be that you pressed it accidentally?Does the autosave function create the screenshots in the game directory? If so, can you prevent it from doing that? Not too much room on my SSD.
No, it doesn't. The default screenshot key is now page down, could it be that you pressed it accidentally?
(If so, I think I'll disable all the key bindings by default in the next version, if someone wants them they should enable them, it's causing too many issues)
It's just a matter of setting these 3 to whatever you fancy in VSSAO.fx:
Code:extern float aoRadiusMultiplier = 1.2; //Linearly multiplies the radius of the AO Sampling extern float aoStrengthMultiplier = 2.0; //Linearly multiplies the strength of the AO extern float aoClamp = 0.0; //The maximum strength of the AO, 0 is max strength, 1 is weakest
E.g. if you think it's too strong try going with aoStrengthMultiplier = 1.0 and aoClamp = 0.3 for a start.
(if you find something you like then tell me the settings, I might include a "weak", "medium" and "strong" preset for the SSAO in the real release)