Jump to content

Upscaling textures


RoNin1971

Recommended Posts

For the last few months I've been playing around with AI Upscaling for graphics. Enlarging image resolution using AI technology. Which gets pretty good results if you double up your 2K's to 4K's.

As I'm using a free, web based AI, to do the enlarging, it takes some work to get any transparency properly enlarged, as it doesn't support the alpha channel.

 

So, for those interested, I wrote this 'guide' on how to do it. (for this particular AI, at least)

 

p.s. If you know of any free AI upscaler (capable of going to at least 8K) that supports alpha channels, let me know, I'd love to try it out.)

 

- - -

 

How to upscale your transparent texture, using free, webbased AI Upscaler [edit: No longer free, so ... :sad: ]/ (without support for alpha channels) and Gimp.
...and get optimum results.

 

52537461-1634176447.png

1. Open your image file with Gimp. (open dds textures without mipmaps, we don't need those)
- You should now have 1 layer, containing the image data.
2. Duplicate the layer.
- Select the layer and make sure you have the colors white and black as fore and background colors.
3. Right click the layer and select: Alpha to selection.
4. Go to 'Edit' and click 'fill with FG color' (white)
5. Go to 'Select' and click 'invert'
6. Go to 'Edit' and click 'fill with BG color' (black)
7. Select none.

You should now have your alpha channel as a black & white image. (Black = 100% transparency, white = 0%)
52537461-1634177562.png

 

Save it as a .png file and upload it to: [edit: No longer free, so ... :sad: ]
Select how many times you wish to increase the resolution: 2x, 3x, 4x etc.
Start processing ...
and download the result.

Now for the colors.
Return to your image in gimp. you can hide or delete the black&white layer, as we won't need it anymore.
1. Duplicate the layer, up to 10x, depending on how transparent it is. Keep duplicating until you see no more transparency, except for 100%.
- You can use black and/or white background layers to get a better view.
2. Merge all visible layers.
3. Duplicate the layer again, and select the bottom layer.
4. Select 'Filters' - Blur - Gaussian blur. Default settings are ok.
5. Duplicate this blurry layer about 3 or 4 times.
6. Add a black background layer at the bottom.
7. Merge all visible layers again.

You should now have your colormap ready for up-scaling.

52537461-1634177662.png

 

Save it as a .png file again and upload it to: [edit: No longer free, so ... :sad: ]
Select how many times you wish to increase the resolution: 2x, 3x, 4x etc.
Start processing ...
and download the result.

Now for the final step:
1. Open up the up-scaled colormap with gimp.
2. add the up-scaled alpha map as new layer, on top.
3. Select the alpha layer, go to 'Colors' and click 'Color to alpha'. Default (white) is ok.
4. Set the layer mode from 'Normal' to 'Erase'.
5. Merge the visible layers.

You now have an exact copy of the original, with the exact same transparency etc. as the original, just x times bigger :smile:

52537461-1634177756.png

 

You might need to further adjust and refine the result (the bigger the upscale the worse, of course) but the results can be astonishing.

Good luck on your up-scaling projects :smile:

 

edit:

As of 17 Oct. the website I mentioned appears to have been changed. You can no longer upload images beyond 3K (so, no more 4K -> 8K) & you only have 4 free 'trials'. Where as before you could upload anything and upscale to 100mps (a bit beyond 8K)

So, I removed the link. If you know an alternative, let us all know !

Edited by RoNin1971
Link to comment
Share on other sites

I guess that's what DLSS and FSR do, but instead of upscaling the base textures they upscale the textures in run-time.

Not so sure about that as it takes quite some time. A few minutes to go from 2 to 4K, on 1 texture. A lot more for 8K.

(not to mention the result preferably still needs some manual correcting, as there will likely be some 'anomalies', jagged or 'staircase' edges, etc.)

Link to comment
Share on other sites

Yeah, of course there will be some advantages and disadvantages from using pre-rendered or run-time upscaling, but both start from the same idea, upscaling textures using AI in combination with other techniques.

I didn't tested DLSS nor FSR with proper implementation which, as I understand it, would be upscaling textures as needed, but I tested FSR over the whole final image thanks to an implementation for Proton, and it makes wonders with the upscaling. The only drawback of this implementation is that if your CPU doesn't have enough "horse power" to upscale in-time you get some artifacts when there's a lot going on in the screen.

Link to comment
Share on other sites

Yeah, of course there will be some advantages and disadvantages from using pre-rendered or run-time upscaling, but both start from the same idea, upscaling textures using AI in combination with other techniques.

I didn't tested DLSS nor FSR with proper implementation which, as I understand it, would be upscaling textures as needed, but I tested FSR over the whole final image thanks to an implementation for Proton, and it makes wonders with the upscaling. The only drawback of this implementation is that if your CPU doesn't have enough "horse power" to upscale in-time you get some artifacts when there's a lot going on in the screen.

Well, it sure could help keeping file sizes down for games in the future. 100+ gigs is no exception nowadays.

Link to comment
Share on other sites

Yeah, it's crazy how heavy the games are now. I recall when I bought my first PC, it had 6.4GB of HDD and I was like -dude, I'll never fill up this drive-, and that was not that long ago, in 1998, at that time the bigger games used 3 CDs (around 2GB). Indeed those techniques will help supporting those crazy resolutions that the industry is trying to make standards, like 4K and 8K. I'll keep using 1080 for now, not worth the difference imo, unless you use a 40+ inch display, which I'm not, 24 inch is quite big already for me.

Link to comment
Share on other sites

Yeah, it's crazy how heavy the games are now. I recall when I bought my first PC, it had 6.4GB of HDD and I was like -dude, I'll never fill up this drive-, and that was not that long ago, in 1998, at that time the bigger games used 3 CDs (around 2GB). Indeed those techniques will help supporting those crazy resolutions that the industry is trying to make standards, like 4K and 8K. I'll keep using 1080 for now, not worth the difference imo, unless you use a 40+ inch display, which I'm not, 24 inch is quite big already for me.

Dude, I played 'Doom', using 3 PC's! (well, actually. my first game, was THE first game. Pong! as a baby/kid ;) but anyway, back to 3D PC games :P )

you could join them into 1 game with a master and 2 slaves. one looking straight, one left, one right.

 

It came on 4 1.44MB diskettes... but ok, we've come a long way since ;)

 

I'm using a 34" inch at 3440x1440 ultra-wide. Fallout 4 wasn't actually build for it, but modding helps ;)

and I must say there's absolutely a difference between 2 and 4K. But to stress your GPU with 8K usually doesn't do much. You need to get real close to objects and study them to see and enjoy the extra details. Not worth the much heavier load.

 

It also depends on how they are applied.

Most of my grass textures are still just 1 and 2K. There is no need for anything higher there. You will never notice (except the drop in FPS)

My plants are all 4K, more then enough but less fussy as the standard 2K's.

The mapletree02 texture on the other hand still looks a bit fussy in 4K, mostly because they tried putting to much into 1 texture, and apply small parts on big objects.

So, I'm currently using the 16x8K version to see how my rig handles it. (pretty good so far)

Link to comment
Share on other sites

I was talking about the screen resolution actually, whilst you are talking about the texture resolution.

In the past we were limited to the movement of the camera, so it was easier to optimize the texture resolutions, but now we have more freedom of movement in games, especially in VR, so that games need higher texture resolutions everywhere to avoid blurriness in cases where in the past we would be unable to look that close. So I think that a run-time upscaling is an awesome solution to save storage resources, but at the cost of processing resources. At the end of the day optimization keeps being the key, a good balance between storage and processing resources is, in my opinion, the best choice.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...