This is only the bit for the actual anti aliasing, its not hard to figure out how to stop the lag.
Posted via Mobile Device
Printable View
This is only the bit for the actual anti aliasing, its not hard to figure out how to stop the lag.
Posted via Mobile Device
Guys please read the code, the code CHECKS if your computer can handle the Anti aliasing, and if it can it sees then how much Multisampling u can have...
So it will ALWAYS go to an anti alias level your graphics card can support, yes a neuz.ini saved option via patcher r ingame optinos would be a better choice, but for time's sake and lack or knowledge sake, i wanted to get the working code released before everyone used the original and crashes happened everywhere xD.
Maybe there are more "fail safes" you can add to this code like an "if(SUCCESS...." and "if(FAILED [then revert to no AA]"
altho i believe the code does that already in a a way as it will set to 0 multi sampling if you cant handle anything over..
so in a nutshell, yeah it shaved like 5 FPS off my game (maybe not even that) but its totally adaptable to your graphics card so u wont have an issue where someone can't play if their card doesnt support it, it'll jus go back to regular.
Ok, I read the coding. What it's doing it now, is setting it to the max antialiasing your card can handle, no matter what. In my opinion, 4x AA or 8x AA is the most you'll need. Any higher, and you hardly notice a difference, unless you're pressing your face to the monitor to examine each pixel.
You have a valid point.
So i very quickly scrambled this togethor, agian im sure there are WAY better methods to do this, but below SHOULD (havent tested it) detect the value your card can take, then it sets it to a sensible value based on what you can support, altho frankly i do not see the point as im not sure many people will get more than x8 anyway.
My computer is pretty good to say the least, and for some reason on flyff it only gets x2
Code:DWORD MSQuality = 0;
m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_NONMASKABLE, &MSQuality);
int MSQ = MSQuality - 1;
if (MSQ >= 8) // if your card can handle x8 or more.
{
m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONMASKABLE;
m_d3dpp.MultiSampleQuality = 8;
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);
}
else if (MSQ >= 4 && MSQ < 8) // if your card can handle x4-x6
{
m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONMASKABLE;
m_d3dpp.MultiSampleQuality = 4;
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);
}
//If your card cannot handle any of the above remove AA.
else{
hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType,
m_hWndFocus, behaviorFlags, &m_d3dpp,
&m_pd3dDevice );
}
I actually hadn't noticed that before, so I'll explain it, cause wewsir is actually correct. Setting the Culling mode to none, forces it to render both sides of everything, even if you can't see it. For example, rendering the bottom side of the floor that isn't visible.
What is most annoying is how it seemingly uses only a single mesh group within an o3d as the culling mesh, so if u had a giant castle and it selected the door as the culling mesh then whenever the door is off camera the whole castle vanishes -.-
idk if there is a way around this, i havent really looked to try.
But yeah its like Hitler...somehow xD.