Skip to content

Draw item icons at native resolution - #1190

Open
Maiz19 wants to merge 49 commits into
117HD:masterfrom
Maiz19:native-item-icons
Open

Maiz19 wants to merge 49 commits into
117HD:masterfrom
Maiz19:native-item-icons

Conversation

@Maiz19

@Maiz19 Maiz19 commented Sep 27, 2026 •

Copy link
Copy Markdown

Renders item icons at native resolution, making them look like their ground items. Setting in experimental and off by default.

With Stretched Mode enlarging the interface, item icons are drawn from the
items' models at the screen's resolution, instead of stretching the game's
36x32 icons. Experimental, off by default.
@Maiz19 Maiz19 changed the title Draw item icons natively in enlarged interfaces Draw item icons at native resolution Sep 27, 2026
Maiz19 and others added 27 commits September 29, 2026 17:14
# Conflicts:
#	src/main/java/rs117/hd/HdPlugin.java
#	src/main/java/rs117/hd/HdPluginConfig.java
…eir items aren't cut out after a popup draws over them
@Jin-Jiyunsun

Copy link
Copy Markdown
Contributor

Been running this for a while now and I've yet to come across any issues since the bugs I reported were fixed :)

@Mark7625

Copy link
Copy Markdown
Contributor

I think if we do add this (we should as it performs better) we should add some support for loading my custom item rotations and also animation parity from my plugin imo

@Jin-Jiyunsun

Copy link
Copy Markdown
Contributor

I think if we do add this (we should as it performs better) we should add some support for loading my custom item rotations and also animation parity from my plugin imo

rotation maybe a bit much for being built into 117hd but rotation sounds good

@Jin-Jiyunsun

Copy link
Copy Markdown
Contributor
java_S3yDmqIMB8

This happens when hopping worlds, was reproducible every time on my end.

@Maiz19

Maiz19 commented Oct 18, 2026

Copy link
Copy Markdown
Author

thanks for letting me know its fixed now!

@Jin-Jiyunsun

Copy link
Copy Markdown
Contributor
java_sabY3V4oVt.mp4

Noticed dragged items revert to their old low resolution version

Maiz19 added 10 commits October 23, 2026 18:02
…nventory too, before cutting out the items under it
…ce, also where text covers part of them, and keep animated icons from reverting
…e next to the dragged item with the same tag
…ts smaller, instead of drawing them all again on every resize
…cut out, like Inventory Grid's slots, so a see-through side panel doesn't show a square around the dragged item
… instead of painting it over, and keep its see-through shadow as the game drew it
@aHooder

aHooder commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

There are some interesting ideas in this. I'm wondering whether it would be possible to rasterize these HD icons entirely on the GPU instead. I'm thinking something along these lines might work:

  1. Fill buffers with models to render any time the inventory changes.
  2. Render that to a texture on the GPU, with icons positioned just right to be shown through holes cut in the UI. Also render these to a black & white mask.
  3. Read back this mask texture from the GPU.
  4. In a RuneLite overlay, apply the mask to cut holes.
  5. Render this icon texture just before rendering the UI.
  6. Repeat from 1 whenever the inventory changes.

Does this sound like something that could work? If so, I think the file cache could be skipped. This should be doable for any other UI element too, and I'd prefer if you could keep everything in one texture unit ideally.

Might it also be possible to read the icon's zoom & offset from the cache? E.g. via client.getIndexConfig().loadData(10, itemId) and some manual opcode reading. https://abextm.github.io/cache2/#/viewer/item/

@Maiz19

Maiz19 commented Nov 9, 2026

Copy link
Copy Markdown
Author

i'll look into it

…ead from the cache, instead of fitting them on the CPU and keeping them on disk, with everything in one texture unit
… keeping the game's blocky one, which showed like an outline under them
…game's stretched ones in the interface, and work out a see-through shadow's colour from the shadow itself when its layer never showed it opaque

The stack size's pixels share the slot's cell of what's drawn over the item, so they take no extra texture layers. A see-through shadow is still taken out when a few of its pixels don't fit.
@Maiz19

Maiz19 commented Nov 10, 2026

Copy link
Copy Markdown
Author

There are some interesting ideas in this. I'm wondering whether it would be possible to rasterize these HD icons entirely on the GPU instead. I'm thinking something along these lines might work:

  1. Fill buffers with models to render any time the inventory changes.
  2. Render that to a texture on the GPU, with icons positioned just right to be shown through holes cut in the UI. Also render these to a black & white mask.
  3. Read back this mask texture from the GPU.
  4. In a RuneLite overlay, apply the mask to cut holes.
  5. Render this icon texture just before rendering the UI.
  6. Repeat from 1 whenever the inventory changes.

Does this sound like something that could work? If so, I think the file cache could be skipped. This should be doable for any other UI element too, and I'd prefer if you could keep everything in one texture unit ideally.

Might it also be possible to read the icon's zoom & offset from the cache? E.g. via client.getIndexConfig().loadData(10, itemId) and some manual opcode reading. https://abextm.github.io/cache2/#/viewer/item/

Hey, I checked it out and it works great.

The icons are now rasterized on the GPU, only when something changes, and drawn just before the UI. The file cache is gone and everything is in one texture unit. Zoom and offsets are read from the cache with loadData(10, itemId).

The one thing I did differently is that I don't read a mask back from the GPU. The holes are cut with the game's own icon, which saves a readback. It's only item icons for now, I haven't looked at other UI elements yet.

…ead of only within its own layer, so a bank item dragged over the tabs isn't left behind their icons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants