[MMD] Anti Aliasing Showcase 2
This is my second comparison of the Anti-Aliasing methods that I’ve
tested. I used mipmaps on all test and have more to show the difference
outside of supersampling.
All are using High Quality Texture Filtering and Ainstropic Filtering at 16x on all drivers.
Previous comparison: https://pokefan531.tumblr.com/post/171769349563/mmd-anti-aliasing-showcase-this-is-a-montage
Internal methods:
No AA gives us raw aliased image on geometry just like games without any AA.
MMD’s
Internal AA setting uses driver’s MSAA at 8x without alpha coverage, as
seen on the leaves below, shadows, and shading on models. It does show a
little difference between Nvidia and AMD. On Nvidia, even if I try to
change the LOD setting, it doesn’t change for MSAA so some textures are a
bit blurry on the models on lower resolution, despite using high
quality filtering with 16x AF. Higher resolution may lessen the LOD
blur. However, the anti-aliasing method uses Sparse Grid to do better on
some lines, but hard to see the difference in this one when comparing
with Rotated Grid that AMD uses. AMD’s however, have more clear
mipmapping and the Rotated Grid method looks similar.
Shader methods:
FXAA
and SMAA shaders are from RayMMD’s extensions from github, and are used
without AA on to demonstrate. FXAA and SMAA doesn’t help on
disconnected lines and shimmering in motion is visible still. SMAA ia a
bit sharper, but neither can clean the aliasing at the models. At the
log on the bottom right, FXAA has a small advantage to do that slope
better. SMAA, like the last comparison, has the line glitch as seen on
the leaves. It is a bug only to that shader port to MMD.
SSAA_4x.fx
is less compatible with MMD, and if using some post processing effects
like SSAO, it can either have a little blur on edges, or aliased blur as
seen here. That shader is not well compatible with it, and you can see
it can look a bit worse than no AA.
Downsampling Methods:
Like
the Downsampling post and previous comparison, it does have up to 16x
downsampling quality and comparing each. SSAA_4x shader looks identical
to 4x if the shader is compatible with it, but it is comparable. 4x does
a good job at trying to do anti-aliasing, but if you look at the small
lines at the leafs, it is not completely smooth, and temporal aliasing
is still shown, but less frequent. 9x helps more and 16x cleans the rest
of small aliasing and looks better in motion where you don’t see a lot
of shimmering or temporal aliasing. This is the best way to use with
RAYMMD however, since this is the only method to do downsampling at the
monent. This is a manual downsampling, meaning you would have to
downsample from Photoshop or Virtualdub as this post was explained:
https://pokefan531.tumblr.com/post/171739184928/mmd-downscaling-anti-aliasing-with-ray-mmd
MSAA from two vendors:
Similar
to MMD’s AA. This method uses alpha coverage which does affect the
leaves this time. It is more smooth. However, MSAA will never take care
of shadows, self shadows, or shading. I decide to show Nvidia and AMD on
this one again, and you can compare the quality. The LOD situation from
MMD’s AA is also said here on lower resolutions. AMD’s seems to be
sharper on textures and both barely showed texture aliasing due to
mipmapping, regardless of shaders. For AA quality, AMD uses Rotated Grid
method and Nvidia uses Sparse Grid method. AA quality description are
pretty much the same as below, but using MSAA on this one.
Supersampling methods:
We’re
comparing Nvidia’s SGSSAA with AMD’s RGSSAA. Nvidia’s LOD can be change
here, so it can compare with AMD’s LOD. At 2x, you can see some
differences and aliasing is taken on one direction. Sparse Grid does
take care of the small lines a bit more, but you generally won’t be
using 2x supersampling. 4x, Sparse grid takes care of small lines
slightly more than Rotated grid. They are a bit harder to tell the
difference in this scene. Both of them at 4x looks a lot better than 4x
downsampling. 8x, the difference are pretty minor. At the log at the
bottom right, the slope is a bit smoother in Sparse grid and at Miku’s
hair, AA patterns are a bit less than Rotated grid. Honestly, this scene
is pretty hard to see some difference from 4x, but not sure about in
motion yet. With 8x paired with 4x downsampling for fun, the difference
is indisguinishable.
https://pokefan531.tumblr.com/post/171569153043/mmd-tutorial-sgssaa-with-nvidia-inspector-edit
Conclusion:
8x Supersampling is recommended for general use and there isn’t really
much a difference between SGSSAA and RGSSAA on this still image. This
scene doesn’t use RAYMMD, so it is safe to use 8x AA with any shaders.
4x is pretty good to and you can use it if your system can’t handle it
or rendering a 4k video with vram lower than 3gb if using several
shaders and effects. However, I prefer sticking with 8x on any situation
since I usually make videos and images at 1080p and 720p. I can still
use 8x for 4k images. Next one will be a video to test between SGSSAA
and RGSSAA to see how it looks in motion. I know SGSSAA does get rid of a
lot of shimmering and temporal aliasing to where it barely shows at 4x
and pretty much none at 8x, and I do want to see how it’s like for
Rotated Grid method.
Yuki Story MMD Chapter 10 - Yuki’s Showdown - Page 1
Ron decides to make a plan for Yuki after the basketball game. He, Aki, and Ren are excited to see how it will turn out.
[MMD] Anti Aliasing Showcase
This is a montage of showing ways to use anti-aliasing in MMD. I do have
several Anti-Aliasing methods to showcase here and I will go over each
of them, and explain specific methods that AMD or Nvidia driver
implemtation use. All uses 480x360 and uses high quality texture
filtering with 16x Anistropic filtering. Mipmapping setting is ON with
MSAA pictures being the exception.
No AA is just a raw image
without any sort of Anti-Aliasing. It is what you normally see in games
if not using Post-AA or using traditional methods.
MMD’s AA
method uses driver’s MSAA method without alpha coverage. It’s not shown
here, but you can see the aliasing on the model in the middle in some
areas. Texture aliasing inside the models do have aliasing left on,
especially having transparent aliasing. Using Mipmapping on some drivers
can help with inner teture aliasing, but won’t smooth alpha aliasing.
FXAA.fx
shader is from Raycast developer. As you can see on the grid, there is a
bit of bloating due to how FXAA works. It does its job on some areas,
but on missing geometry, disconnected lines, and temporal aliasing can’t
be helped with. Look at the staircase and the seat at the right side.
FXAA cannot makeup with missing lines, and shows shimmering in motion.
SMAA.fx
is pretty similar, but there is no bloating on the grid. It’s sharper
than FXAA, but for the shader for MMD, it has problems. If the slope is
going upper left or bottom right at any angle degree, it shows line
artifacts, as seen on the chair at the left. It’s distraction and is a
bug to the shader for MMD. On slopes that are upper right or bottom
left, it leaves a bit of aliasing, so it does needs that bug to be
fixed. SMAA never had this situation, and you can compare with games if
you use reshade and never seen line artifacts.
SSAA_4x.fx from
Elle in NicoNico has a shader where it doubles the resolution and scales
it down with bilinear. It is ordered grid sampling. It does a better
job and you can use it with driver’s AA or MMD’s AA for better quality.
THe downside of this is that it is less compatible with post processing
shaders like SSAO or some Diffusions. It can either makes the lines
blurry, leave alpha aliasing a bit more visible, or show all aliasing
with slight blur. It is only useful if you don’t use post processing
effects that affects the shader. Link for SSAA shader:
http://seiga.nicovideo.jp/seiga/im3800138
Downsampling, let’s get
to it. I made a post about downsampling for Ray shader to put more AA
quality. Here, I demonstrate the levels of downsampling. The setting
model does have white aliasing on some edges for some reason if you turn
off AA, but I just leave AA off to showcase Downsampling quality. 4x is
4 pixel samples and doubles the resolution before scaling down to your
target resolution. 4x does take care of some aliasing and looks like
SSAA_4x, but you could see on some areas that has small aliasing, and in
motion you can see a bit of temporal aliasing and shimmering. Also,
since the Grid looks thinner on higher resolution, it is the cause of
the thickness that the grid make 1 pixel wide regardless of using higher
resolution, and the thickness never scales. 9x does take care of
aliasing more and it is a triple of your target resolution. 16x is
quadruple and it smooths the rest of the aliasing. I don’t recommend
using 16x for video rendering if your VRAM is the bottleneck and just
use your driver’s AA at 8x instead for better rendering time.
https://pokefan531.tumblr.com/post/171739184928
MSAA
showcases shows the quality for each preset. They all are using
driver’s MSAA with alpha coverage, so it takes care of transparent
textures too. Although, it’s barely in this test and you can only see it
at the character model from far. It shows aliasing regardless of
quality, and turning on mipmapping does smooth inner texture aliasing a
bit, but it can look blurry on far objects even using 16x anistropic
filtering. It depends on the driver, showing how AMD’s MSAA does. It
does have better texture LOD management than Nvidia if using MSAA on
small resolutions with shaders applied to models. The blur is mostly
diminished on higher resolutions, but can’t even get rid of the blur
that is caused by the shader in Nvidia side. You rarely see this on a
lot of situations, but to keep note if rendering on lower resolution
like 360p as seen on this image. Same thing happens if using MMD’s AA,
and while the blurry mipmapping isn’t exaggerated, it shows the blur.
AMD have better LOD management on MSAA and same can be said on programs
that uses MSAA. Anyway, 8x shows better quality, but between how AMD and
Nvidia does MSAA, Nvidia does Sparse Grid method while AMD uses Rotated
Grid method. The Sparse Grid does its job a bit better than Rotated
Grid if you look at the staircase at upper right.
Now let’s show
SGSSAA. The issue above about LOD can be adjusted for SGSSAA to -3.0 to
match AMD’s SSAA if comparing 8x. Default driver’s LOD is less blurry
with SGSSAA than using MSAA if using shaders on models. I did adjust the
LOD to match AMD’s Supersampling’s LOD. Higher quality gets better, and
you can see that 8x does its job. Even at 8x, it shows few aliasing on
the staircase and on the seat on the right, but it’s barely, and way
acceptable to see in motion since Temporal Aliasing or shimmering isn’t
visible. The small aliasing is seen on lower resolutions and shouldn’t
be bothering when seeing it in motion, and you may not see it that much
anyway on higher resolution. For fun, I’ve use the downsampling method
at 4x, and it does clean up the very small aliasing. However, it’s
pretty easy and simple to just use 8x for video rendering and even image
rendering anyway. It is compatible with any Post Processing shaders I
throw it to MMD with SGSSAA.
https://pokefan531.tumblr.com/post/171569153043
RGSSAA, AMD’s Supersampling. The LOD
doesn’t have an option to AMD drivers, but it is clean and better than
Nvidia’s default driver LOD preset for Supersampling. Higher quality is
better, and 8 is almost as good as 8xSGSSAA, but if you look at the
staircase on the upper right, you can see a bit of aliasing still. Even
though Rotated Grid is better than Ordered Grid, Sparse Grid is better
at slopes at the stairs. Rotated Grid does a better job than MSAA since
it takes care of the full scene. I think Supersampling method is the
best way to use with AMD drivers. It looks well on the rest of the
scene, but I couldn’t really find what RGSSAA does better than Sparse
Grid method in this scenary. For fun, I show the next example to use 8x
RGSSAA along with 4x downsampling and it looks a lot better, and smooths
on the staircase.
I generally recommend using Supersampling
method on MMD to 8x, and use enhanced instead of override if you don’t
want to use AA if you are editing with a weak GPU. While Downsampling
gives better results, especially at 16x, it is intensive process,
especially for video rendering. I don’t recommend using Post AA
generally and I would not use SSAA shader if I decide to throw in Post
Effects. So far, MSAA with Alpha at 8x, SGSSAA, RGSSAA, and Downsampling
are compatible with Post Effects. Next post will compare another
comparison of various Anti-Aliasing methods again, and show Alpha and
shader aliasing better a well as comparing more on Nvidia and AMD’s
handling with MSAA. After that, I want to compare photos and videos of
using Rotated Grid and Sparse Grid Supersampling methods.
[MMD] Downscaling Anti-Aliasing with RAY-MMD
Edit 3/12: Correct Downsampling terms. 4x is 4 pixels coverage and not actually 2x.
This
project of doing the best method of Anti-Aliasing is challenging. If
you use MMD-RAY shader, any form of Anti-Aliasing, whether it’s from
MMD’s default AA, or your driver’s AA, is not being used at all. You
only do have post-procesing shaders instead, such as FXAA and SMAA.
Although, I do came across artifacts on SMAA. Those post-aa shaders
don’t help temporal aliasing or shimmering from missing geometry lines,
and Ray-MMD doesn’t have internal supersampling options. I’ve tried many
theories to do this approach, and while it’s easier to do with photos
since it takes seconds to do snapshots, videos do take a lot longer the
higher the resolution is. Ray Shader is a tricky situation for better
Anti-Aliasing since it has its own framebuffer.
Here are the comparisons of Anti-Aliasing, and it includes Downsampling:
https://pokefan531.tumblr.com/post/171769349563
Video:
https://youtu.be/5Uc3wkC7Xx8 1080p version for none and 4x.
https://youtu.be/Sqaz_v9IAZs 720p version for none, 4x, and 9x.
The
best option right now is to double, triple, or quadruple the target
resolution. You do get more pixel samples and it is the only easiest
method if you know how to downscale manually. Think of this as Nvidia’s
DSR or AMD’s VSR ecept only doing 4x.
In the photo, I’ve shown no
downsampling, 4x, and 16x. All downscaled from Photoshop to have more
defined anti-aliasing. FXAA isn’t used here to demonstrate the quality
of downsampling. 4x have 4 pixel samples, 9x has 9 samples, and 16x has
16 samples. 16x seems to be the best quality, especially for photo
editing. If you are doing a non-integer sampling, such as putting a
resolution in the middle between 1080p and 4k, the downsampling won’t
really help a lot on shimmering and temporal aliasing on lower samples
than 4x.
4x Downsampling is really 4 times pixels from your
target resolution. As you can see at the image on top, you can see the
difference between no downsampling and 4x. Look at the foliage and small
lines at the staircases. It even takes care of the shading aliasing as
seen on the models. It is a big difference. It is “recommended” for most
users to use this quality of downsampling for video rendering to save
rendering time to process on both MMD and Virtualdub.
16x
Downsampling is the last thing to show from the image above. It is 16
times pixels. The staircase is taken cared well and the lines around the
screen are more connected. It is somewhat less of the difference from
9x from the comparison AA post, but comparing the image is noticeable if
you look at small lines and missing disconnected lines. It is more
noticeable if you compare it with 4x. It is best for Image rendering for
Ray Shader.
Instructions how to downsample your video or image.
For
Image, load your favorite photo editor like Photoshop or GIMP, and load
that file, and downscale it to your target resolution. Downscale it
with Bilinear, and Bicubic gives off ringing around the edges. For
example, you downscale 3840x2160 to 1920x1080p with bilinear for 4x
downsampling. You can save that image.
For Video, since you render it
to AVI with UT Video, load it to Virtualdub, and go to filters and use
resizer, and make sure you know the video’s resolution to downsample.
Use bilinear and put 1920x1080 if it’s from 4k to do 4x downsampling,
and go to Compression and select UT Video RGB to compress and then click
Files and Save AVI and name your AVI to save, and you are rendering
your downsampled video and it’s saved. If you have audio, it will
automatically do a direct copy, and you can check at Stream List and see
if you have audio.
You can use it with FXAA to give more AA IQ,
even at 16x. It’s always best to upscale the resolution by exact
integer, like double, triple, and so to have best AA quality. For
example, if you are targeting 1080p (1920x1080), then you double it to
4k (3840,2160) for 4x downsampling, (5760,3240) for 9x, or 8k
(7680x4320, INSANE!!!) for 16x. UT Video RGB codec is recommended.
Let’s
talk specs for 4k rendering to video with Ray shader. A 2GB video card
won’t give you reasonable fps for video rendering. For me with GTX 950
OC, it is around 1fps to render in 4k (VRAM bottleneck) and a bit more
at 1440p. It has to be at least more VRAM, but 4GB is recommended, but
that doesn’t mean that you can’t get or keep a GTX 1060 3GB. 8k right
now is pretty insane if your VRAM is lower than 10GB+ for video
rendering while using MMD-RAY shader. RayMMD on higher resolutions are
intense right now, and if you want to supersample your 1080p video with
16x or a 4k video with 4x, your GPU has to be like GTX 1080 Ti to render
it to video with decent fps, 16GB RAM, and a CPU that has at least 8
threads in last few years, like i7s or Ryzen 7. A CPU while using UT
Video with lossless compression and use Gradient for the fastest encode
than the lowest settings, Left, which has lower compression ratio than
Gradient or Median. T2 renders faster with CPUs that have AVX2 or
AVX-512, but if you want to play the video, it’s pretty difficult as
I’ve tried to get video players to run it, but didn’t show on players or
video editors, but loads well on Virtualdub or Avisynth. RAM is best
for at least 8GB, and I’ve had 4k rendering hit around 6.5gb and goes
around 5gb on 1080p or lower. Image Snapshots are not really worried
about for fps. It takes several seconds with MMD-RAY, but if you got a
crash for going even higher resolution, then downsample less like 4x for
stability. My GPU has no problems taking snapshots at 8k so far, but
whether you are doing snapshots or video rendering that bottlenecks your
VRAM, you will experiences slowdown on your desktop since it shares the
VRAM and can make it almost unusable during the bottleneck. If you
don’t mind letting your PC render on higher resolution for downsampling
or doing native 4k, you can leave it on, and it does depend on how long
it is the project and can depend how much fps you want to render your
video to. 30fps vs 60fps will double the rendering time. For Image, it’s
best to use PNG since you’re gonna downscale it and JPEGs has lower
quality and artifacts, depends of the quality that an applications will
encode it to.
My conclusion is this is our alternative to do
better anti-aliasing on MMD Ray to have better quality. It currently
doesn’t have its internal downsampling or is compatible with traditional
MMD AA or Video Driver’s AA. I prefer doing 4x on videos if I have to
wait for video rendering. What I noticed in this image is that bloom
effects scale differently on higher resolutions, because the bloom on
the models are smaller, but the white lights around the screen have
larger blooms.
If you are not using Ray shader and either using
your driver’s Supersampling, or stuck with MMD’s AA, and if you want to
get rid of small aliasing as possible, 4x Downsampling should do the job
if you decide to do that, especially for photo editing.
Yuki Story MMD Chapter 9 - Yuki’s Defense - Page 8
Yuki talks to Ron after school about not picking on Minoru and doubts
him that he just changed. She also offered him a competition tomorrow.
Yuki Story MMD Chapter 9 - Yuki’s Defense - Page 7
Minoru’s former teacher decides to talk to Yuki when her class begins.
She warns her about fighting with Ron while she tells her that she wants
to protect Minoru.
Yuki Story MMD Chapter 9 - Yuki’s Defense - Page 6
Yuki and Ron gets caught fighting in the hallway. Yuki decides to take Minoru to check on his knee that got hurt.
[MMD Tutorial] SGSSAA with Nvidia Inspector
Edit 3/12: Added LOD quality and examples.
This is my second post about SGSSAA on MMD.
I
know it’s a bit overdue that I posted this than I stated. The fact that
I’ve been using this method for best Anti-Aliasing, SGSSAA is the best
method. To use SGSSAA on Nvidia cards on MMD, use Nvidia Inspector and
make a profile for MMD and load application for both MikuMikuDance.exe,
PMXEditor.exe (32 or 64 bit), and VMDViewer.exe. Then do the exact same
settings from this photo and pay attention to the black texts instead of
grey. Also, you don’t need AA compatibility bits to use SGSSAA for MMD.
AA Fix must be turned on to avoid artifacts when using customed AA.
Vertical
Sync must be turned off so that you can have very fast rendering times
when rendering to AVI. Tearing doesn’t appear since they are all shared
with desktop’s V-Sync.
AA-Mode can either use Enhanced or Override to
work, but I prefer Enhanced since I can toggle Antialiasing in MMD’s
option to turn it off if I need to. Override will always force it.
Enhanced is helpful if your GPU is very low and you want to turn it off
during editing.
AA-Setting must be 8xQ and AA-Transparency Settings
must be 8x Sparse Grid Supersampling to use SGSSAA, and 8x is the best
quality to offer. You will want that maximum quality when rendering to
AVI.
Anistropic Filtering must be at 16x to have better mipmapping details.
Texture Filtering Quality must be put at High Quality to have better mipmapping along with SGSSAA.
Driver Controlled LOD should be off and LOD bias (DX) should be at max -3.0. More about LOD below.
Hit
apply and start using MMD and you will notice that it has a very high
quality. On the photo at the upper side, check the yellow box to see the
default MMD Anti-Aliasing and you will notice that it doesn’t cover
everything. Shader aliasing, temporal aliasing, and transparency
aliasing is present. SGSSAA corrects this and does full supersampling
with Sparse Grid method that removes temporal aliasing greatly, and even
better than standard supersampling. Temporal Aliasing is better seen in
motion as temporal means several frames. Standard SSAA doesn’t help
much on Temporal, and only removes it by a little. MSAA doesn’t cover
shader aliasing and texture aliasing. Alpha aliasing is removed in MSAA
if the settings has an option for alpha coverage. SGSSAA also helps on
polygons, and even at 8x, it looks like a lot of sampling is used to
smooth out any aliasing on the image. 4x barely shows temporal aliasing
when I used it on some games, but 8x is a more professional option and
gets rid of more small aliasing. It is compatible with any post
processing effects.
About LOD, it is a subtle difference, and you
can notice it if using a lower resolution, even using 16x Anistropic
Filtering. It’s not as blurry as not using Anistropic Filtering.
However, if you are rendering pictures or video at SD resolution, you
may notice a bit blur on textures. I’ve used -3.0 bias to match how it
is shown on AMD’s 8x RGSSAA method or downsampling the image. I would go
by an integer negative number down on each quality, like -1.0 for 2x,
-2.0 for 4x, and -3.0 for 8x. I mean the LOD blur isn’t really
noiticable on higher resolutions, and trying to compare images on high
resolution seems to be a little difference, so I made this a little more
optional, but I prefer doing this to match fairly with AMD’s method and
how it looks when downsampling.
NOTE: Since MMD-Ray shader only
has its own framebuffer on display, any anti-aliasing has no effect at
all, not even SGSSAA. FXAA and SMAA is our only option, but still
doesn’t help with temporal or spectular lighting aliasing. If you want
to get the best AA method with MMD-Ray, follow the Downsampling post.
Yuki Koriyama in Swimsuit
Yuki decides to show off her swimsuit in the beach. She also wants you
to play games with her like volleyball because she’s really good at it.
Her bikini was done with some bases and models, and poses and beach are from Deviantart
Yuki Story MMD Chapter 9 - Yuki’s Defense - Page 5
Yuki is very aware that Ron wants to get Minoru, but ends up getting caught by her.