[quote="DarkStarSword"]It looks like I gave you a few pointers on that already - have you tried any of those?[/quote]
Not yet as I'm still trying to understand the whole workflow of working with multisampled resources, it's a new thing for me so I want to make sure I get this right. Currently i'm thinking about resolving MSAA with a custom shader, but I'm not entirely sure how width/height_multiply relates to the resolving Texture2DMS depth buffer into a Texture2D. What will be it's final size? The quarter of the multisampled or singlesampled depth buffer?
By having the following:
[code][ResourceDepthBufferQ]
width_multiply = 0.25
height_multiply = 0.25
[CustomShaderDownsampleDB]
ResourceDepthBufferQ = copy_desc ResourceDepthBuffer
o0 = ref ResourceDepthBufferQ
ps-t100 = ref ResourceDepthBufferH
[/code]
Wouldn't it make an output also antialiased? What size will I get in the next in line shader using GetDimensions when I bind the downsampled DB as a normal texture?
BTW: Happy anniversary! This thread is now 100 pages long :D
DarkStarSword said:It looks like I gave you a few pointers on that already - have you tried any of those?
Not yet as I'm still trying to understand the whole workflow of working with multisampled resources, it's a new thing for me so I want to make sure I get this right. Currently i'm thinking about resolving MSAA with a custom shader, but I'm not entirely sure how width/height_multiply relates to the resolving Texture2DMS depth buffer into a Texture2D. What will be it's final size? The quarter of the multisampled or singlesampled depth buffer?
Wouldn't it make an output also antialiased? What size will I get in the next in line shader using GetDimensions when I bind the downsampled DB as a normal texture?
BTW: Happy anniversary! This thread is now 100 pages long :D
Thanks for the update, DSS! It will be great especially for Unity games, which need a lot of code in "d3dx.ini". I'll use the new version in my Trails of Cold Steel fix (the GOG version didn't receive any patch yet. It's frustrating).
Thanks for the update, DSS! It will be great especially for Unity games, which need a lot of code in "d3dx.ini". I'll use the new version in my Trails of Cold Steel fix (the GOG version didn't receive any patch yet. It's frustrating).
The width and height are independent of the number of samples, so e.g. an MSAA8 back buffer might be 1920 x 1080 x 8, while a non-MSAA version of the same back buffer would be 1920 x 1080 x 1. The MSAA8 buffer has 8x as many pixels as the non-MSAA buffer, but it still has the same width and height.
The width and height are independent of the number of samples, so e.g. an MSAA8 back buffer might be 1920 x 1080 x 8, while a non-MSAA version of the same back buffer would be 1920 x 1080 x 1. The MSAA8 buffer has 8x as many pixels as the non-MSAA buffer, but it still has the same width and height.
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Sound's logical, but I don't know why I have to compensate the depth buffer's coordinates to make it not looking like this:
[img]https://s11.postimg.org/s6txacesz/dirt3_game_2017_08_14_22_32_32_471.png[/img]
Furthermore When I enable the MSAA the resolution of the depth buffer decreases (after compensation)
NOAA:
[img]https://s24.postimg.org/4eovrochh/dirt3_game_2017_08_14_22_26_48_337.png[/img]
MSAAx8:
[img]https://s24.postimg.org/6xakscy7p/dirt3_game_2017_08_14_22_26_18_720.png[/img]
Below is my vertex and pixel shader I use to resolve the MSAA on the depth buffer and scale it by 50%
[code]Texture2DMS<float> t100 : register(t100);
void main(
out float4 pos : SV_Position0,
out float msaasamples : TEXCOORD0,
uint vertex : SV_VertexID)
{
switch(vertex) {
case 0:
pos.xy = float2(-1, -1);
break;
case 1:
pos.xy = float2(-1, 1);
break;
case 2:
pos.xy = float2(1, -1);
break;
case 3:
pos.xy = float2(1, 1);
break;
default:
pos.xy = 0;
break;
};
pos.zw = float2(0, 1);
float _msaasamples;
float2 _size;
t100.GetDimensions(_size.x, _size.y, _msaasamples);
msaasamples = _msaasamples;
}[/code]
[code]Texture2DMS<float> t100 : register(t100);
void main(
float4 pos : SV_Position0,
float msaasamples : TEXCOORD0,
out float result : SV_Target0)
{
//working only on NOAA
float x = pos.x * 2;
float y = pos.y * 2;
//working only on MSAAx8
//float x = pos.x * 8;
//float y = pos.y * 4;
result = 1;
for ( int i = 0; i < msaasamples; i++) {
result = min(result,t100.Load(float3(x + 0, y + 0, i),0));
result = min(result,t100.Load(float3(x + 1, y + 0, i),0));
result = min(result,t100.Load(float3(x + 0, y + 1, i),0));
result = min(result,t100.Load(float3(x + 1, y + 1, i),0));
}
}[/code]
Then I use the depth buffer as a Texture2D
Update: I've also tried to set msaa=1 amd msaa_quality=0 for the downsampled resource, but after that almost all shaders, not just water turn white.
void main(
float4 pos : SV_Position0,
float msaasamples : TEXCOORD0,
out float result : SV_Target0)
{
//working only on NOAA
float x = pos.x * 2;
float y = pos.y * 2;
//working only on MSAAx8
//float x = pos.x * 8;
//float y = pos.y * 4;
result = 1;
for ( int i = 0; i < msaasamples; i++) {
result = min(result,t100.Load(float3(x + 0, y + 0, i),0));
result = min(result,t100.Load(float3(x + 1, y + 0, i),0));
result = min(result,t100.Load(float3(x + 0, y + 1, i),0));
result = min(result,t100.Load(float3(x + 1, y + 1, i),0));
}
}
Then I use the depth buffer as a Texture2D
Update: I've also tried to set msaa=1 amd msaa_quality=0 for the downsampled resource, but after that almost all shaders, not just water turn white.
[quote="DarkStarSword"]The only way to overcome this is to downscale the image on each GPU first, which is possible by adding another custom shader before it to scale to either 50% width or 50% height depending on which mode is in [/quote]
@DarkStarSword I guessed it is by using CustomShaderDownscaleWBuffer or does this shader not exists yet?
I tried to play with this one changing
[code];post ResourceWBufferStereo2Mono = stereo2mono ResourceWBufferQuarter
post ResourceWBufferStereo2Mono = stereo2mono ResourceWBufferEighth
[Present]
run = CustomShaderDownscaleWBuffer
[/code]
But no luck, so is there a way to downscale height 50% (for top bottom use) and as you said reduce sli load? Sadly with CustomShader3DVision2SBS on sli 1080 cards offers only 2 or 3 fps more than with only 1 card enable.
Thanks
DarkStarSword said:The only way to overcome this is to downscale the image on each GPU first, which is possible by adding another custom shader before it to scale to either 50% width or 50% height depending on which mode is in
@DarkStarSword I guessed it is by using CustomShaderDownscaleWBuffer or does this shader not exists yet?
I tried to play with this one changing
;post ResourceWBufferStereo2Mono = stereo2mono ResourceWBufferQuarter
post ResourceWBufferStereo2Mono = stereo2mono ResourceWBufferEighth
[Present]
run = CustomShaderDownscaleWBuffer
But no luck, so is there a way to downscale height 50% (for top bottom use) and as you said reduce sli load? Sadly with CustomShader3DVision2SBS on sli 1080 cards offers only 2 or 3 fps more than with only 1 card enable.
Thanks
@oomek I'm not entirely sure what's going on there... Could it be that the game has enabled some sort of additional scaling when MSAA is enabled?
@kalhohan Let me throw something together for you using The Witcher 3 as an example real quick
@dds me too, it would be a pitty if after all that struggling the simple msaa stopped me from finishing my mod. I do not see any other shader doing postprocessing on the depth buffer. I've tried all your 3 suggestions. Using msaa_ resolve or custom shader resolving the depth buffer produce different sizes of texture2d depending on the msaa level. Sampling texture2Dms the same thing and when I scale it the rendered reflection is cropped. Using msaa=1 burns out a lot of shaders in white (i can not even turn off msaa as the bloom takes over)
I've sent you a link on FB, so if you've got some spare time take a look at my problem please.
@dds me too, it would be a pitty if after all that struggling the simple msaa stopped me from finishing my mod. I do not see any other shader doing postprocessing on the depth buffer. I've tried all your 3 suggestions. Using msaa_ resolve or custom shader resolving the depth buffer produce different sizes of texture2d depending on the msaa level. Sampling texture2Dms the same thing and when I scale it the rendered reflection is cropped. Using msaa=1 burns out a lot of shaders in white (i can not even turn off msaa as the bloom takes over)
I've sent you a link on FB, so if you've got some spare time take a look at my problem please.
@kalhohan - put these in ShaderFixes (right click, save target as):
[url=https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/3DVision2SBS/SLI/3dvision2sbsdownscalevs.hlsl]3dvision2sbsdownscalevs.hlsl[/url]
[url=https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/3DVision2SBS/SLI/3dvision2sbsdownscalepass1ps.hlsl]3dvision2sbsdownscalepass1ps.hlsl[/url]
[url=https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/3DVision2SBS/SLI/3dvision2sbsdownscalepass2ps.hlsl]3dvision2sbsdownscalepass2ps.hlsl[/url]
Then you need to edit the d3dx.ini and *replace* all the SBS related sections with this:
[url=https://github.com/DarkStarSword/3d-fixes/blob/master/3DVision2SBS/SLI/d3dx.ini]d3dx.ini excerpts[/url]
That is, under [Present] you need to remove / comment out this line:
[code]run = CustomShader3DVision2SBS[/code]
And replace it with these two lines:
[code]run = CustomShader3DVision2SBSDownscalePass1
run = CustomShader3DVision2SBSDownscalePass2[/code]
Then find the section starting with [Resource3DVision2SBSBackupTexture] and ending with [KeyChange3DVision2SBSOutputMode]...type=cycle and replace it with these lines:
[code]
[Resource3DVision2SBSBackupTexture]
[Resource3DVision2SBSHalfHeight]
height_multiply = 0.5
[CustomShader3DVision2SBSDownscalePass1]
; Load a custom vertex + pixel shader:
vs = ShaderFixes/3dvision2sbsdownscalevs.hlsl
ps = ShaderFixes/3dvision2sbsdownscalepass1ps.hlsl
; Explicitly unbind other shader types for safety:
hs = null
ds = null
gs = null
; Disable the OM blend stage that could interfere with the shader:
blend = disable
; Disable front/back face culling so the vertices can be in any rotation:
cull = none
; Use a triangle strip topology so we only have to output four vertices:
topology = triangle_strip
; Clear all render + depth targets to avoid compatibility issues:
o1 = null
o2 = null
o3 = null
o4 = null
o5 = null
o6 = null
o7 = null
oD = null
; Make our Resource3DVision2SBSHalfHeight compatible with the back buffer's
; description, but with the height overridden in the above resource section:
Resource3DVision2SBSHalfHeight = copy_desc bb
; Then bind it as the render target. set_viewport ensures that the view port is
; the size of the buffer so the draw call will work:
o0 = set_viewport Resource3DVision2SBSHalfHeight
; Back up any textures that were in the ps-t100 slot. The CustomResource
; section will already back up a lot of state, including shaders, render
; targets, depth targets, UAVs, viewports, blend state, rasterizer state,
; primitive topology, etc. but it does not back up textures:
Resource3DVision2SBSBackupTexture = reference ps-t100
; Bind the back buffer as a texture:
ps-t100 = bb
; Some games such as The Evil Within and Akiba's Trip constantly unbind
; StereoParams & IniParams, so we may need to explicitly rebind them now:
vs-t125 = StereoParams
ps-t125 = StereoParams
vs-t120 = IniParams
ps-t120 = IniParams
; Draw four vertices. The vertex shader will construct coordinates to cover the
; full screen using the SV_VertexID semantic so we don't need vertex buffers:
draw = 4, 0
[CustomShader3DVision2SBSDownscalePass2]
; Load a custom vertex + pixel shader:
vs = ShaderFixes/3dvision2sbsdownscalevs.hlsl
ps = ShaderFixes/3dvision2sbsdownscalepass2ps.hlsl
; Explicitly unbind other shader types for safety:
hs = null
ds = null
gs = null
; Disable the OM blend stage that could interfere with the shader:
blend = disable
; Disable front/back face culling so the vertices can be in any rotation:
cull = none
; Use a triangle strip topology so we only have to output four vertices:
topology = triangle_strip
; Clear all render + depth targets to avoid compatibility issues:
o1 = null
o2 = null
o3 = null
o4 = null
o5 = null
o6 = null
o7 = null
oD = null
; Bind the back buffer as a render target. set_viewport ensures that the view
; port is the size of the buffer so the draw call will work, and no_view_cache
; is necessary for a few games like Mad Max:
o0 = set_viewport no_view_cache bb
; Use the reverse stereo blit to give the shader access to the downscaled back
; buffers of both eyes:
ps-t100 = stereo2mono Resource3DVision2SBSHalfHeight
; Some rare games (e.g. Onechanbara Z2) use MSAA back buffers, which cannot be
; directly used with the reverse stereo blit and must be resolved to non MSAA
; versions first. The symptoms will be a black screen after enabling this
; shader with F11. In that case, replace the above line with these two:
; ps-t100 = resolve_msaa bb
; ps-t100 = stereo2mono ps-t100
; Some games such as The Evil Within and Akiba's Trip constantly unbind
; StereoParams & IniParams, so we may need to explicitly rebind them now:
vs-t125 = StereoParams
ps-t125 = StereoParams
vs-t120 = IniParams
ps-t120 = IniParams
; Draw four vertices. The vertex shader will construct coordinates to cover the
; full screen using the SV_VertexID semantic so we don't need vertex buffers:
draw = 4, 0
; Restore the original texture from the ps-t100 slot:
post ps-t100 = reference Resource3DVision2SBSBackupTexture
[KeyChange3DVision2SBSOutputMode]
key = F11
; 0 = Regular 3D Vision
; 4 = Top and Bottom
; 5 = Reversed Top and Bottom
x7 = 4, 5, 0
type = cycle
[/code]
At the moment this only supports Top-and-Bottom output modes (x7 = 4 or 5) since I figured they are well regarded as giving better quality than side-by-side, and I can't support both without either having the user comment/uncomment certain lines or until I have some conditional logic in 3DMigoto to choose the right one automatically.
I haven't measured the performance gain of using this, but would be very interested to hear how it goes for you.
Then you need to edit the d3dx.ini and *replace* all the SBS related sections with this: d3dx.ini excerpts
That is, under [Present] you need to remove / comment out this line:
run = CustomShader3DVision2SBS
And replace it with these two lines:
run = CustomShader3DVision2SBSDownscalePass1
run = CustomShader3DVision2SBSDownscalePass2
Then find the section starting with [Resource3DVision2SBSBackupTexture] and ending with [KeyChange3DVision2SBSOutputMode]...type=cycle and replace it with these lines:
[Resource3DVision2SBSBackupTexture]
[Resource3DVision2SBSHalfHeight]
height_multiply = 0.5
[CustomShader3DVision2SBSDownscalePass1]
; Load a custom vertex + pixel shader:
vs = ShaderFixes/3dvision2sbsdownscalevs.hlsl
ps = ShaderFixes/3dvision2sbsdownscalepass1ps.hlsl
; Explicitly unbind other shader types for safety:
hs = null
ds = null
gs = null
; Disable the OM blend stage that could interfere with the shader:
blend = disable
; Disable front/back face culling so the vertices can be in any rotation:
cull = none
; Use a triangle strip topology so we only have to output four vertices:
topology = triangle_strip
; Clear all render + depth targets to avoid compatibility issues:
o1 = null
o2 = null
o3 = null
o4 = null
o5 = null
o6 = null
o7 = null
oD = null
; Make our Resource3DVision2SBSHalfHeight compatible with the back buffer's
; description, but with the height overridden in the above resource section:
Resource3DVision2SBSHalfHeight = copy_desc bb
; Then bind it as the render target. set_viewport ensures that the view port is
; the size of the buffer so the draw call will work:
o0 = set_viewport Resource3DVision2SBSHalfHeight
; Back up any textures that were in the ps-t100 slot. The CustomResource
; section will already back up a lot of state, including shaders, render
; targets, depth targets, UAVs, viewports, blend state, rasterizer state,
; primitive topology, etc. but it does not back up textures:
Resource3DVision2SBSBackupTexture = reference ps-t100
; Bind the back buffer as a texture:
ps-t100 = bb
; Some games such as The Evil Within and Akiba's Trip constantly unbind
; StereoParams & IniParams, so we may need to explicitly rebind them now:
vs-t125 = StereoParams
ps-t125 = StereoParams
vs-t120 = IniParams
ps-t120 = IniParams
; Draw four vertices. The vertex shader will construct coordinates to cover the
; full screen using the SV_VertexID semantic so we don't need vertex buffers:
draw = 4, 0
[CustomShader3DVision2SBSDownscalePass2]
; Load a custom vertex + pixel shader:
vs = ShaderFixes/3dvision2sbsdownscalevs.hlsl
ps = ShaderFixes/3dvision2sbsdownscalepass2ps.hlsl
; Explicitly unbind other shader types for safety:
hs = null
ds = null
gs = null
; Disable the OM blend stage that could interfere with the shader:
blend = disable
; Disable front/back face culling so the vertices can be in any rotation:
cull = none
; Use a triangle strip topology so we only have to output four vertices:
topology = triangle_strip
; Clear all render + depth targets to avoid compatibility issues:
o1 = null
o2 = null
o3 = null
o4 = null
o5 = null
o6 = null
o7 = null
oD = null
; Bind the back buffer as a render target. set_viewport ensures that the view
; port is the size of the buffer so the draw call will work, and no_view_cache
; is necessary for a few games like Mad Max:
o0 = set_viewport no_view_cache bb
; Use the reverse stereo blit to give the shader access to the downscaled back
; buffers of both eyes:
ps-t100 = stereo2mono Resource3DVision2SBSHalfHeight
; Some rare games (e.g. Onechanbara Z2) use MSAA back buffers, which cannot be
; directly used with the reverse stereo blit and must be resolved to non MSAA
; versions first. The symptoms will be a black screen after enabling this
; shader with F11. In that case, replace the above line with these two:
; ps-t100 = resolve_msaa bb
; ps-t100 = stereo2mono ps-t100
; Some games such as The Evil Within and Akiba's Trip constantly unbind
; StereoParams & IniParams, so we may need to explicitly rebind them now:
vs-t125 = StereoParams
ps-t125 = StereoParams
vs-t120 = IniParams
ps-t120 = IniParams
; Draw four vertices. The vertex shader will construct coordinates to cover the
; full screen using the SV_VertexID semantic so we don't need vertex buffers:
draw = 4, 0
; Restore the original texture from the ps-t100 slot:
post ps-t100 = reference Resource3DVision2SBSBackupTexture
[KeyChange3DVision2SBSOutputMode]
key = F11
; 0 = Regular 3D Vision
; 4 = Top and Bottom
; 5 = Reversed Top and Bottom
x7 = 4, 5, 0
type = cycle
At the moment this only supports Top-and-Bottom output modes (x7 = 4 or 5) since I figured they are well regarded as giving better quality than side-by-side, and I can't support both without either having the user comment/uncomment certain lines or until I have some conditional logic in 3DMigoto to choose the right one automatically.
I haven't measured the performance gain of using this, but would be very interested to hear how it goes for you.
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Hello, Just tried it, first of all thanks for your time !
I made an excel of my initial tests with two 1080 in sli with 1440p resolution.
Results are static in pose in crowded env.
[url]https://1drv.ms/x/s!Ak4Rcr_kxH5Ngck2wHzUnj1g9wbQMw[/url]
Summary : Good news it's definitely an improvement over previous shader for top/bottom mode.
Basically 4 to 5 fps better. Tried in corvo blancio and toussaint city port (crowded with npcs).
3dTVPlay DSR 4x : 1440p or 3Vision 1440p dsr 1.78 to 1080p is still 5 to 6 fps better.
Strange thing (or not ;) ) SBS (1st one) shader without upscale shader enable (set in ini 1920x1080), doesn't make sli sclale all, it drops to 22fps. Activated it gives 35 fps.
With the new SBS downscale shader without upscale gives 33 fps, and [b]with both 39 or 40 fps.[/b]
So it's definitely better.
The game is set to ultra, hairworks maxed, hbao+ (which takes 10fps only by itself, this beautiful bastard), and without AA.
I'll tried tonight to see if there is improvement over Fallout 4.
Side note, Nier Automata works at 60 fps nearly constant with sbs normal shader, but I'll try also the new shader.
Thanks again ;)
Edit : Fallout 4 crash at launch with new SBS
Hello, Just tried it, first of all thanks for your time !
I made an excel of my initial tests with two 1080 in sli with 1440p resolution.
Results are static in pose in crowded env. https://1drv.ms/x/s!Ak4Rcr_kxH5Ngck2wHzUnj1g9wbQMw
Summary : Good news it's definitely an improvement over previous shader for top/bottom mode.
Basically 4 to 5 fps better. Tried in corvo blancio and toussaint city port (crowded with npcs).
3dTVPlay DSR 4x : 1440p or 3Vision 1440p dsr 1.78 to 1080p is still 5 to 6 fps better.
Strange thing (or not ;) ) SBS (1st one) shader without upscale shader enable (set in ini 1920x1080), doesn't make sli sclale all, it drops to 22fps. Activated it gives 35 fps.
With the new SBS downscale shader without upscale gives 33 fps, and with both 39 or 40 fps.
So it's definitely better.
The game is set to ultra, hairworks maxed, hbao+ (which takes 10fps only by itself, this beautiful bastard), and without AA.
I'll tried tonight to see if there is improvement over Fallout 4.
Side note, Nier Automata works at 60 fps nearly constant with sbs normal shader, but I'll try also the new shader.
@oomek:
Make ResourceDepthBufferH non-MSAA since you are resolving into it:
[code]
[ResourceDepthBufferH]
;---depth buffer scaled to 1/2 res---
width_multiply = 0.5
height_multiply = 0.5
format = R32_FLOAT
msaa_quality = 0
msaa = 1
[/code]
Unbind the incompatible depth buffer (fixes the bloom issue you mentioned):
[code]
[CustomShaderDownsampleDB]
...
ResourceDepthBufferH = copy_desc ResourceDepthBuffer
oD = null
o0 = ref ResourceDepthBufferH
...
[/code]
Resolve the MSAA in the shader - this is close to what you posted earlier, but the .Load() arguments are slightly different - you had tried putting the sampleIndex as the third component of the Location (which is only an int2 for Texture2DMS since it doesn't support mip-maps), but it's a separate argument.
[code]
Texture2DMS<float> t100 : register(t100);
void main(
float4 pos : SV_Position0,
float msaasamples : TEXCOORD0,
out float result : SV_Target0)
{
float x = pos.x * 2;
float y = pos.y * 2;
result = 1;
for (uint i = 0; i < msaasamples; i++) {
result = min(result,t100.Load(float2(x + 0, y + 0), i));
result = min(result,t100.Load(float2(x + 1, y + 0), i));
result = min(result,t100.Load(float2(x + 0, y + 1), i));
result = min(result,t100.Load(float2(x + 1, y + 1), i));
}
}
[/code]
Resolve the MSAA in the shader - this is close to what you posted earlier, but the .Load() arguments are slightly different - you had tried putting the sampleIndex as the third component of the Location (which is only an int2 for Texture2DMS since it doesn't support mip-maps), but it's a separate argument.
Texture2DMS<float> t100 : register(t100);
void main(
float4 pos : SV_Position0,
float msaasamples : TEXCOORD0,
out float result : SV_Target0)
{
float x = pos.x * 2;
float y = pos.y * 2;
result = 1;
for (uint i = 0; i < msaasamples; i++) {
result = min(result,t100.Load(float2(x + 0, y + 0), i));
result = min(result,t100.Load(float2(x + 1, y + 0), i));
result = min(result,t100.Load(float2(x + 0, y + 1), i));
result = min(result,t100.Load(float2(x + 1, y + 1), i));
}
}
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Oh, btw I noticed that the screen space reflections aren't working in stereo again (I didn't check this last time because my driver was playing up and not engaging stereo) - they are hovering above the surface in the classic appearance of these things when they are broken but tolerable.
Last time it was a matter of applying a stereo correction to viewPosition, but it looks like the shader isn't using that any more and I didn't want to spend more time looking at this right now:
[url]https://forums.geforce.com/default/topic/685657/3d-vision/3dmigoto-now-open-source-/post/5058853/#5058853[/url]
Oh, btw I noticed that the screen space reflections aren't working in stereo again (I didn't check this last time because my driver was playing up and not engaging stereo) - they are hovering above the surface in the classic appearance of these things when they are broken but tolerable.
Last time it was a matter of applying a stereo correction to viewPosition, but it looks like the shader isn't using that any more and I didn't want to spend more time looking at this right now:
DarkStarSword saves the day again :D
The 1st and 2nd I tried adding after posting my question. For the 3rd, I've tried swapping the arguments like so:
[code]result = min(result,t100.Load(float3(x + 0, y + 0, i), 0));[/code] 4th argument is an offset, not necessary here I suppose.
I have no idea why it did not work before. Maybe during my desperate experiments I did not try all 3 together :D
[quote="DarkStarSword"]Oh, btw I noticed that the screen space reflections aren't working in stereo again (I didn't check this last time because my driver was playing up and not engaging stereo) - they are hovering above the surface in the classic appearance of these things when they are broken but tolerable.
[/quote]
I'm aware of the broken 3D even though I have no means to test it. The reason for this is that I moved the waves/ripples normals from view to screen space to eliminate the noise and get rid of the downsampled ssr quantisation. Even though the planar reflections are rendered in quarter of the original resolution the normals are applied in the final full resolution pass. What I need now I believe is 2 planar reflection buffers like the game is using originally and use them separately for each eye. I did not want to add any extra complexity before fixing the msaa.
The 1st and 2nd I tried adding after posting my question. For the 3rd, I've tried swapping the arguments like so:
result = min(result,t100.Load(float3(x + 0, y + 0, i), 0));
4th argument is an offset, not necessary here I suppose.
I have no idea why it did not work before. Maybe during my desperate experiments I did not try all 3 together :D
DarkStarSword said:Oh, btw I noticed that the screen space reflections aren't working in stereo again (I didn't check this last time because my driver was playing up and not engaging stereo) - they are hovering above the surface in the classic appearance of these things when they are broken but tolerable.
I'm aware of the broken 3D even though I have no means to test it. The reason for this is that I moved the waves/ripples normals from view to screen space to eliminate the noise and get rid of the downsampled ssr quantisation. Even though the planar reflections are rendered in quarter of the original resolution the normals are applied in the final full resolution pass. What I need now I believe is 2 planar reflection buffers like the game is using originally and use them separately for each eye. I did not want to add any extra complexity before fixing the msaa.
Not at this stage - the ability to customise the sampler state is very limited in 3DMigoto right now and limited to use in custom shader sections. Since ColAngel added that code I raised these limitations with him:
[url]https://github.com/bo3b/3Dmigoto/commit/f17da572266589c7e63424611c11397d438d5fb2#diff-db0c4fca7da30dacd7a6005fe60ee0efR1280[/url]
I'd have to check in with him to see if he has started work on making that more generic (and right now I have more pressing things to work on myself). Is this something you need urgently, or can you make do without it for now?
Not at this stage - the ability to customise the sampler state is very limited in 3DMigoto right now and limited to use in custom shader sections. Since ColAngel added that code I raised these limitations with him:
I'd have to check in with him to see if he has started work on making that more generic (and right now I have more pressing things to work on myself). Is this something you need urgently, or can you make do without it for now?
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Not yet as I'm still trying to understand the whole workflow of working with multisampled resources, it's a new thing for me so I want to make sure I get this right. Currently i'm thinking about resolving MSAA with a custom shader, but I'm not entirely sure how width/height_multiply relates to the resolving Texture2DMS depth buffer into a Texture2D. What will be it's final size? The quarter of the multisampled or singlesampled depth buffer?
By having the following:
Wouldn't it make an output also antialiased? What size will I get in the next in line shader using GetDimensions when I bind the downsampled DB as a normal texture?
BTW: Happy anniversary! This thread is now 100 pages long :D
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
Furthermore When I enable the MSAA the resolution of the depth buffer decreases (after compensation)
NOAA:
MSAAx8:
Below is my vertex and pixel shader I use to resolve the MSAA on the depth buffer and scale it by 50%
Then I use the depth buffer as a Texture2D
Update: I've also tried to set msaa=1 amd msaa_quality=0 for the downsampled resource, but after that almost all shaders, not just water turn white.
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
@DarkStarSword I guessed it is by using CustomShaderDownscaleWBuffer or does this shader not exists yet?
I tried to play with this one changing
But no luck, so is there a way to downscale height 50% (for top bottom use) and as you said reduce sli load? Sadly with CustomShader3DVision2SBS on sli 1080 cards offers only 2 or 3 fps more than with only 1 card enable.
Thanks
@kalhohan Let me throw something together for you using The Witcher 3 as an example real quick
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
I've sent you a link on FB, so if you've got some spare time take a look at my problem please.
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
3dvision2sbsdownscalevs.hlsl
3dvision2sbsdownscalepass1ps.hlsl
3dvision2sbsdownscalepass2ps.hlsl
Then you need to edit the d3dx.ini and *replace* all the SBS related sections with this:
d3dx.ini excerpts
That is, under [Present] you need to remove / comment out this line:
And replace it with these two lines:
Then find the section starting with [Resource3DVision2SBSBackupTexture] and ending with [KeyChange3DVision2SBSOutputMode]...type=cycle and replace it with these lines:
At the moment this only supports Top-and-Bottom output modes (x7 = 4 or 5) since I figured they are well regarded as giving better quality than side-by-side, and I can't support both without either having the user comment/uncomment certain lines or until I have some conditional logic in 3DMigoto to choose the right one automatically.
I haven't measured the performance gain of using this, but would be very interested to hear how it goes for you.
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
I made an excel of my initial tests with two 1080 in sli with 1440p resolution.
Results are static in pose in crowded env.
https://1drv.ms/x/s!Ak4Rcr_kxH5Ngck2wHzUnj1g9wbQMw
Summary : Good news it's definitely an improvement over previous shader for top/bottom mode.
Basically 4 to 5 fps better. Tried in corvo blancio and toussaint city port (crowded with npcs).
3dTVPlay DSR 4x : 1440p or 3Vision 1440p dsr 1.78 to 1080p is still 5 to 6 fps better.
Strange thing (or not ;) ) SBS (1st one) shader without upscale shader enable (set in ini 1920x1080), doesn't make sli sclale all, it drops to 22fps. Activated it gives 35 fps.
With the new SBS downscale shader without upscale gives 33 fps, and with both 39 or 40 fps.
So it's definitely better.
The game is set to ultra, hairworks maxed, hbao+ (which takes 10fps only by itself, this beautiful bastard), and without AA.
I'll tried tonight to see if there is improvement over Fallout 4.
Side note, Nier Automata works at 60 fps nearly constant with sbs normal shader, but I'll try also the new shader.
Thanks again ;)
Edit : Fallout 4 crash at launch with new SBS
Make ResourceDepthBufferH non-MSAA since you are resolving into it:
Unbind the incompatible depth buffer (fixes the bloom issue you mentioned):
Resolve the MSAA in the shader - this is close to what you posted earlier, but the .Load() arguments are slightly different - you had tried putting the sampleIndex as the third component of the Location (which is only an int2 for Texture2DMS since it doesn't support mip-maps), but it's a separate argument.
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
Last time it was a matter of applying a stereo correction to viewPosition, but it looks like the shader isn't using that any more and I didn't want to spend more time looking at this right now:
https://forums.geforce.com/default/topic/685657/3d-vision/3dmigoto-now-open-source-/post/5058853/#5058853
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
The 1st and 2nd I tried adding after posting my question. For the 3rd, I've tried swapping the arguments like so:
4th argument is an offset, not necessary here I suppose.
I have no idea why it did not work before. Maybe during my desperate experiments I did not try all 3 together :D
I'm aware of the broken 3D even though I have no means to test it. The reason for this is that I moved the waves/ripples normals from view to screen space to eliminate the noise and get rid of the downsampled ssr quantisation. Even though the planar reflections are rendered in quarter of the original resolution the normals are applied in the final full resolution pass. What I need now I believe is 2 planar reflection buffers like the game is using originally and use them separately for each eye. I did not want to add any extra complexity before fixing the msaa.
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
https://github.com/bo3b/3Dmigoto/commit/f17da572266589c7e63424611c11397d438d5fb2#diff-db0c4fca7da30dacd7a6005fe60ee0efR1280
I'd have to check in with him to see if he has started work on making that more generic (and right now I have more pressing things to work on myself). Is this something you need urgently, or can you make do without it for now?
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword