Jump to content

Anti-Aliasing


Recommended Posts

25 minutes ago, LoKnarash said:

Nah, That's not true, dtx8 supports antialising without any problems, I've been using it for over 2 years on my client.

Only MSAA as I know, but this look very horrible in game.. (font problems, etc..) Primary is better just implement dx9..

Edit: Btw. these things are possible to fix, but for what? No sense do it..

Edited by Filachilla
Link to comment
Share on other sites

Just now, Filachilla said:

Only MSAA as I know, but this look very horrible in game.. (font problems, etc..) Primary is better just implement dx9..

I don't have a screen at hand nor the possibility of doing so, I'm updating to dtx9 for tests with rtx remix, but I've never noticed problems with the font, in fact it has been improved, the only real problem is on compatibility with some GPUs that I don't quite understand ( and I didn't even elaborate).

My friend have my same computer, same parts (motherboard, CPU, GPU, RAM, etc.) it works for me and not for him... we tried to see the differences but nothing, in the end I solved it with an option to disable in case

Link to comment
Share on other sites

4 minutes ago, LoKnarash said:

I don't have a screen at hand nor the possibility of doing so, I'm updating to dtx9 for tests with rtx remix, but I've never noticed problems with the font, in fact it has been improved, the only real problem is on compatibility with some GPUs that I don't quite understand ( and I didn't even elaborate).

My friend have my same computer, same parts (motherboard, CPU, GPU, RAM, etc.) it works for me and not for him... we tried to see the differences but nothing, in the end I solved it with an option to disable in case

*These things are possible to fix, but for what? No sense do it..

As I said, very easily is use wrapper and build some custom dll, so far still exist much open source sdk.. Second way is just port to dx9 and world is open 😄 dx9 support msaa, ssaa, txaa and more things than pretty old dx8..

Link to comment
Share on other sites

14 hours ago, Denizeri24 said:

yes, i did this. but msaa really have performance impact. i get 200 fps if msaa on (normally i get 240 fps)

What graphics card are you using? Which MSAA are you using (x2, x4, x8,...)? A reduction from 240fps to 200fps is not a problem. In this game, MSAA should be "free" pretty much.

Link to comment
Share on other sites

  • Active+ Member
On 1/18/2024 at 9:01 PM, Filachilla said:

Only MSAA as I know, but this look very horrible in game.. (font problems, etc..) Primary is better just implement dx9..

Edit: Btw. these things are possible to fix, but for what? No sense do it..

If you do this with a wrapper yes you will run into these problems. Because the wrapper is applied to many elements, including ETC. However, when done from source code, none of these problems occur. Because the wrapper doesn't know which Render does what task and applies the effect anyway. It is automatically applied to all rendering operations such as textail rendering, interface rendering, character rendering.

Link to comment
Share on other sites

  • Premium
Link to comment
Share on other sites

1 hour ago, DemOnJR said:

Here is the DX8 and DX9 with anti-aliasing.
https://www.mmotutkunlari.com/eklentiler/dx8-dx9-aa-zip.14301/

This is not good because of external, recommended to use create device etc after that it should look like this:

https://metin2.download/video/63s63mMciGVNS63mJHG0tyYa84Bd45HW/.mp4

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • Active+ Member
47 minutes ago, peaceofficial said:

This is not good because of external, recommended to use create device etc after that it should look like this:

https://metin2.download/video/63s63mMciGVNS63mJHG0tyYa84Bd45HW/.mp4

I am the person who prepared the mentioned .dll files. Yes, it is not a very healthy method, but it is still an alternative for those who want to use it.
The codes within the DLL are dynamic, meaning it implements as much MSAA as the GPU supports. If it doesn't support it, it won't apply. Device creation etc. It is applied depending on the transactions. It has no other duty.

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

1 hour ago, peaceofficial said:

This is not good because of external, recommended to use create device etc after that it should look like this:

https://metin2.download/video/63s63mMciGVNS63mJHG0tyYa84Bd45HW/.mp4

yea, i did this too

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

13 minutes ago, blaxis said:

I am the person who prepared the mentioned .dll files. Yes, it is not a very healthy method, but it is still an alternative for those who want to use it.
The codes within the DLL are dynamic, meaning it implements as much MSAA as the GPU supports. If it doesn't support it, it won't apply. Device creation etc. It is applied depending on the transactions. It has no other duty.

Ofc! Nice 🥰

Link to comment
Share on other sites

  • Active+ Member
20 hours ago, peaceofficial said:

This is not good because of external, recommended to use create device etc after that it should look like this:

https://metin2.download/video/63s63mMciGVNS63mJHG0tyYa84Bd45HW/.mp4

how to do this on dx8 ?

  • Love 1

spacer.png

Link to comment
Share on other sites

  • Premium
On 11/27/2023 at 2:09 PM, MysteriousDev said:

I got interested in this topic so I tried it myself. What I've found you can pretty easily enable antialiasing on dx9.

Search for:

int CGraphicDevice::Create

Now scroll down where the parameters of ms_d3dPresentParameter are set.

 

Add those two lines

ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;
ms_d3dPresentParameter.MultiSampleQuality = 0;

And now that's a riddle. I haven't got too much time for a research, but ms_lpd3d->CheckDeviceMultiSampleType tells that multiSampling is indeed available, and it sets the quality to 1. But I can't get it working with it, so I left the quality set to 0, it still looks good enough, IDK what would be the difference.

 

Also there's one more thing to set in the parameters, and I don't know the long term effects of this change, but it looks like it works just fine, like I said I don't have too much time for doing research atm.

You'll be having a "D3DERR_INVALIDCALL" error if ms_d3dPresentParameter.Flags are set to D3DPRESENTFLAG_LOCKABLE_BACKBUFFER, and I don't know the answer for now, maybe I'm missing something, but setting the flag to 0 does the job.

After the device is created with success you must write last line to make it work:

ms_lpd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);

 

And now you can enjoy those SMOOTH EDGES:

  Reveal hidden contents

.png

 

This works with DX9 and for the screenshot use https://metin2.dev/topic/31916-uninstalling-libjpeg-and-taking-screenshots-with-directx9/

Edit:
Bug when you open an second client the FSAA/MSAA will be DISABLED on the first Window,
Solution ... edit this option to TRUE

StateManager.cpp

void CStateManager::SetDefaultState()
{
...
#ifdef DX9_FSAA_DEFAULT_FIX
	SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
#else
	SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
#endif
...
}

Bug CEF
Unsolved.

Edited by DemOnJR
  • Good 1

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

  • Active+ Member
On 11/27/2023 at 3:09 PM, MysteriousDev said:

I got interested in this topic so I tried it myself. What I've found you can pretty easily enable antialiasing on dx9.

Search for:

int CGraphicDevice::Create

Now scroll down where the parameters of ms_d3dPresentParameter are set.

 

Add those two lines

ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;
ms_d3dPresentParameter.MultiSampleQuality = 0;

And now that's a riddle. I haven't got too much time for a research, but ms_lpd3d->CheckDeviceMultiSampleType tells that multiSampling is indeed available, and it sets the quality to 1. But I can't get it working with it, so I left the quality set to 0, it still looks good enough, IDK what would be the difference.

 

Also there's one more thing to set in the parameters, and I don't know the long term effects of this change, but it looks like it works just fine, like I said I don't have too much time for doing research atm.

You'll be having a "D3DERR_INVALIDCALL" error if ms_d3dPresentParameter.Flags are set to D3DPRESENTFLAG_LOCKABLE_BACKBUFFER, and I don't know the answer for now, maybe I'm missing something, but setting the flag to 0 does the job.

After the device is created with success you must write last line to make it work:

ms_lpd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);

 

And now you can enjoy those SMOOTH EDGES:

  Reveal hidden contents

.png

 

if we disable backbuffer and add anti aliasing CEF Browser stops working

spacer.png

Link to comment
Share on other sites

  • Active+ Member
1 minute ago, DemOnJR said:

Try to enable it back when the browser is starting, and when you close it disable it again... idk
I do not use CEF anymore.

It's not that easy, because anti aliasing is initialized on create, I don't think you can deactivate it once the client is started.

spacer.png

Link to comment
Share on other sites

7 hours ago, HFWhite said:

It's not that easy, because anti aliasing is initialized on create, I don't think you can deactivate it once the client is started.

Of course you can disable it. You just need to set new present parameters and reset the device.

Or you can choose not to multisample the swap chain buffers, and render the scene to off screen, multisampled render target, then you will not need to reset the device to enable/disable MSAA.

Or you can use a post process anti-aliasing solution (FXAA, SMAA, etc), and not worry about changing device/surface parameters.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.