Advertisement

DirectX9 Can only scale up and now down when drawing vertexes :(

Started by August 25, 2022 09:50 AM
14 comments, last by JoeJ 2 years, 2 months ago

sodaboy581 said:
I've been using levels 0. I should have been using levels 1.

Interesting : ) Makes sense even, but i would not have thought of this.

sodaboy581 said:
EDIT: Without mipmaps, the quality of downscaling seems worse tho'.

If your down scaling factor is ≥ 0.5, you should not need mip maps.

But you must make sure bilinear filter is on, and a texture sample is taken exactly at the corner point where 4 texels meet. Then the bilinear sampler should return the desired average of those 4 texels.

I'm not sure if mip maps are calculated on CPU or GPU with DX9, but if it's the latter, the performance hit of calculating the mips should not be that big.
But it's still redundant work. If you already have a downsampled mip level, it is wasted work to sample the texture with a pixel shader. Because the first mip level already is exactly the result you want. So maybe there is a way to get this directly.

I definitely do some downscaling more than 0.5.

For SSAA 4x as well as some downscaling which is done with Bloom/DOF.

DX9 looks like it does Mipmapping on the GPU, though. I do notice GPU usage go up slightly when using it.

Also, when you use mipmaps (at least autogenerated ones), you can't pick the texture level to sample from. You always still gotta use 0. (But DX handles which one to feed on it's own, so you don't need to change any code.)

I've noticed, though, when I set my level to 1 and downsample, even if I'm just downsampling by 2x (0.5), the result looks cleaner when I use the flags to autogenerate mipmaps.

Very peculiar!

I think I will just ride with autogenerated mipmaps for the win.

Advertisement

sodaboy581 said:
For SSAA 4x as well as some downscaling which is done with Bloom/DOF.

You mean you do true multisampling, using 4x4 samples per pixel?

That's quite unusual. I did this once, but for an offline software rasterizer to generate 3D product packaging images.
Nice image quality. But modern TAA can get even further for a fraction of the cost. At least for still images ;D

Though, if your gfx are so simple and fast you can effort such high resolution, you could try TAA but without it's problems.
You could render 16 sub frames, jitter the camera like with TAA, but also transform the scene for each render respecting sub frame time.
Then you would get the same AA quality, but true motion blur as well. I'd love to see that in motion. Nobody ever tried this, it seems.

Yeah, so, I render to a render target which is either 2x or 4x the back buffer resolution then downsample it down and put it on the back buffer.

I just noticed the downsample result looks much better if autogen mipmapping is on vs. not…

Also, TAA is only good if your game runs at over 45fps, right? The project I work on only runs at 30fps. (Actually, I'm working on an old online game client and adding new features and such to it.)

But yeah! Just some more background. :P

sodaboy581 said:
Also, TAA is only good if your game runs at over 45fps, right?

Most games since PS4 used it, lots of them targeting 30 fps.

But i rarely see it used by smaller devs using their own custom engines. Probably because its complexity and issues. The issues also affect production and content generation, requiring a lot of tweaking and workarounds, they say.

However, if we can render at very high framerate, so we get enough samples within a single frame, the temporal issues and complexity would go away completely. We would not even need motion vectors, and implementation becomes trivial.
For visuals like Quake 3 or Counterstrike on a modern GPU it should work. Counterstrike on RTX 3090 at 1080p gives 900 fps, that's 15 subframes at 60 fps. So 4x4 multisampling + motion blur would work.
Ofc. only rich kids pay premium for such GPUs, but it seems there are a lot of them. And 3x3 AA on a reasonable midrange GPU is fine too. And with true motion blur, 30fps become a lot more practical as well.

To enable this for state of the art visuals, decoupling lighting from framerate could do the trick. Oxide Games just released a paper talking about their approach of the worlds first texture space rendering engine, this time supporting FPS not just top down RTS.
This could be used to do lighting at 30 or less fps, so multisampling ideas would become a lot more practical as the cost of generating the image goes down.

But we will see. Personally i believe the days of discrete GPUs are counted. Too much money, too much powerdraw, too much performance just to play games.
Things like Apple M1 or Steam Deck make a lot more sense than big tower PCs. Ryzen 6800 APU has a 3.5 tf GPU which is enough, Intel works on this too with even twice the GPU power afaict.
I guess people will prefer APUs over limited raytracing effects with even more temporal issues, and machine learning acceleration which isn't used at all.
If so, we can no longer rely on the assumption compute power goes up to infinity for free, and then we can't effort brute force solutions like multisampling but need to work harder.

This topic is closed to new replies.

Advertisement