Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Some people in forums i researched about that part, were saying it was adding +1 to the MSAA so that was added to counteract it, you could probably add additional code to the thing.
like
if( MSQ == 7 )
MSQ == 8;
or something like that if it isnt adding +1,
but for me, mine can handle x16 aswell, but for some reason on flyff it only does x2 =\.... but it comes up as x2...which means it was originally x3 for me before doing the -1.
Maybe its certain graphics cards or something, did it cause any problems ingame when it said x7???
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Adler
I hate culling more than Hitler. Nothing more annoying than making a map using epic, giant objects only to find out they disappear if you look two degrees to the left. -.-
Wrong kinda culling homezki.~
All the vertices in the mesh are transformed into screenspace, then the cross product of each triangle is found, and if the Z coordinate is - [I think it's negative, I'm sleepy shut up] then it doesn't keep going through the pipeline.
What you're talking about is frustum culling, which is handled by the program, flyff in our case. Sadly, FlyFF's frustum culling is retarded.
See here, it gives a comparison of the two.
weeeeeee
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Addi
Wrong kinda culling homezki.~
All the vertices in the mesh are transformed into screenspace, then the cross product of each triangle is found, and if the Z coordinate is - [I think it's negative, I'm sleepy shut up] then it doesn't keep going through the pipeline.
What you're talking about is frustum culling, which is handled by the program, flyff in our case. Sadly, FlyFF's frustum culling is retarded.
See here, it gives a comparison of the two.
weeeeeee
Thank you for the information, ive heard of Occlusion Culling, seen it being used on some of the newer game engines, but yeah flyff's culling is a big bag of ass.
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Jcdacez
Maybe its certain graphics cards or something, did it cause any problems ingame when it said x7???
nope but i saw that graphics were same as without your code i compiled one neuz with and one without and it looked same...
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Addi
Wrong kinda culling homezki.~
All the vertices in the mesh are transformed into screenspace, then the cross product of each triangle is found, and if the Z coordinate is - [I think it's negative, I'm sleepy shut up] then it doesn't keep going through the pipeline.
What you're talking about is frustum culling, which is handled by the program, flyff in our case. Sadly, FlyFF's frustum culling is retarded.
See here, it gives a comparison of the two.
weeeeeee
CULLING IS CULLING D;
*backs into corner, feels dumb*
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Jcdacez
Some people in forums i researched about that part, were saying it was adding +1 to the MSAA so that was added to counteract it
I guess that's what was happening from the coding, but then Jomex's results proved differently lol
@Adler
Don't feel bad. I knew about the general culling, but didn't know that other one xD
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Jcdacez
Thank you for the information, ive heard of Occlusion Culling, seen it being used on some of the newer game engines, but yeah flyff's culling is a big bag of ass.
Occlusion culling I believe is testing whether large objects such as buildings would obscure other objects in the scene in camera space. Like for example, that would check if a player was on the other side of Saint Morning's cathedral thing. No way in hell you'll be able to see them so why render em? The math's basically the same as finding a shadow volume, then just do the same thing as frustum culling but you're checking if it's in the occlusion volume. Yeah. Dig it.
Quote:
Originally Posted by
Adler
*backs into corner, feels dumb*
Pff. You make some sick-ass maps bro, we all got our strengths. :3
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Quote:
Originally Posted by
Jomex
Why is MSQuality - 1 because my card can handle x16 but w/e. it should easily handle x8 and message box says that it's x7 then please explain this:
Code:
int MSQ = MSQuality - 1;
The MSDN page below describes why you have to take one from the CheckDeviceMultiSampleType function.
IDirect3D9::CheckDeviceMultiSampleType method
Also from my understanding the value that is returned by that isn't your MSAA multiplier. It is the number of quality levels the card supports for the sample type (low, medium and high in this case), which is why most of you are getting 2(High). To set it use a specific MSAA multiplier you need to use one of the mask enumerators for the MultiSampleType property. ie:
Code:
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
I've done very little with DirectX but that's my understanding after reading about it, so if someone more knowledge wants to correct me feel free.
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
I looked into nabby59's information, and he is correct.
You should change it to:
Code:
DWORD MSQuality = 0;
int MSType = D3DMULTISAMPLE_NONE;
if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_8_SAMPLES, &MSQuality) )
MSType = D3DMULTISAMPLE_8_SAMPLES;
else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_4_SAMPLES, &MSQuality) )
MSType = D3DMULTISAMPLE_4_SAMPLES;
else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &MSQuality) )
MSType = D3DMULTISAMPLE_2_SAMPLES;
int MSQ = MSQuality - 1;
// --------------------------------------------------------------
// ... Below Will Display a message box on Start-Up with the AntiAliasing
// ... Multisample level Your Graphics card can handle .
// ---------------------------------------------------------------
// char msaaText[128];
// sprintf( msaaText, "Multi Sample Type = x%d", MSType );
// MessageBox( NULL, msaaText, "MSAA AMOUNT", MB_OK );
// -------------------------------------------------------------------
m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_d3dpp.MultiSampleType = MSType;
m_d3dpp.MultiSampleQuality = MSQ;
m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
m_d3dpp.EnableAutoDepthStencil = TRUE;
m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
m_d3dpp.Flags = 0;
m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType,
m_hWndFocus, behaviorFlags, &m_d3dpp,
&m_pd3dDevice );
m_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
m_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
m_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
m_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)8);
m_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
This starts by testing MSAAx8 and uses that if you can. If not, it tries MSAAx4. As a last resort, it does MSAAx2. If none are supported, it leaves the default of none.
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Shadow u forgot in your code after every if/else one ")" at the end of line.
Also it says:
Code:
J:\@Source\Official Source\_DirectX\d3dapp.cpp(924): error C2440: '=' : cannot convert from 'int' to 'D3DMULTISAMPLE_TYPE'
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Just change this:
Code:
int MSType = D3DMULTISAMPLE_NONE;
To this:
Code:
D3DMULTISAMPLE_TYPE MSType = D3DMULTISAMPLE_NONE;
It works fine for me :>
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Ok, so I'm not perfect lol but you got the idea =P I didn't actually test that coding, just wrote it up real quick.
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Thank you for working on this code like a REAL community xD, i'll try out Shadow's code and edit the first post to the same thing.
:)
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
corrected shadow's code:
Code:
DWORD MSQuality = 0;
D3DMULTISAMPLE_TYPE MSType = D3DMULTISAMPLE_NONE;
if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_8_SAMPLES, &MSQuality) ) )
MSType = D3DMULTISAMPLE_8_SAMPLES;
else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_4_SAMPLES, &MSQuality) ) )
MSType = D3DMULTISAMPLE_4_SAMPLES;
else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &MSQuality) ) )
MSType = D3DMULTISAMPLE_2_SAMPLES;
int MSQ = MSQuality - 1;
// --------------------------------------------------------------
// ... Below Will Display a message box on Start-Up with the AntiAliasing
// ... Multisample level Your Graphics card can handle .
// ---------------------------------------------------------------
// char msaaText[128];
// sprintf( msaaText, "Multi Sample Type = x%d", MSType );
// MessageBox( NULL, msaaText, "MSAA AMOUNT", MB_OK );
// -------------------------------------------------------------------
m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_d3dpp.MultiSampleType = MSType;
m_d3dpp.MultiSampleQuality = MSQ;
m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
m_d3dpp.EnableAutoDepthStencil = TRUE;
m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
m_d3dpp.Flags = 0;
m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType,
m_hWndFocus, behaviorFlags, &m_d3dpp,
&m_pd3dDevice );
m_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
m_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
m_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
m_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)8);
m_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
Compiled w/o errors, so should work.
Re: [Source] Multi-Sample Anti-Aliasing in Flyff
Uh, good job Jomex, but Jcdacez already corrected it and put that on the first post lol