Dolphin, the GameCube and Wii emulator - Forums

Full Version: ANyone know any hacks to speed up transparency rendering!?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone!

This is my first post on the Forum! Smile
Iv'e just managed to compile Dolphin for Orange Pi 5 Linux. A rk3588 system.
I'm testing some of my old favorite games and they run pretty well!

Until,
I come across any transparent surfaces like the big fire in the first village of Resi 4.
Or the large bluish walls screens in Metroid Prime.

I know transparency is generally quite costly but here it really breaks the games for being very playable to not being playable.

Does anyone know any tricks I could do to work around these transparent shaders!?
Some different blend modes, or way of doing transparency?

I'm not afraid of going in and hacking a little bit of code.


Cheers!
What driver are you using? The closed source driver, the LLVMpipe, or the Panfrost driver?
Two things typically make transparency slow - you've got to draw things in the right order to get the colours right so you've got to sort draw calls by depth (whereas for opaque stuff, the z-buffer means you can draw stuff in any order) and you have multiple fragments contributing to the final pixel colour which all need colouring in, meaning lots of overdraw (whereas for opaque stuff, you've only definitely got to colour in the one nearest fragment in a pixel, and modern GPUs have systems to do exactly that and no more work).

If you're okay with things looking a bit wrong, you can theoretically skip the depth sort for transparent draw calls, but that's going to require specific hacks for each game, and depending on how things are implemented, may not be feasible even for a PowerPC reverse-engineering expert. The overdraw's not practically something you can do anything about, though.
Hi!

I'm using the Armbian bundled 'Panfork' driver.
Which is a custom rockchip version Panfrost. Regular Panfrost does not support the gpu apparently.

Thanks for the overview of transparency rendering in gl. I had a little read up as well yday.
Im certainly no expert reverse engineer but I can do a bit of hacking around.

I found a place where I could change the global blending mode with glBlendFunc() but of course that broke everything.
It might be possible to insert something faster like additive blending at certain points but then I have no clue how to insert at the right point in the gl stream.
I don't even know how and where the 'game' turns into a open gl stream.

I also tried to intercept some shader generation to see if I could change the Alpha shading there but the only shaders I managed to intercept were some gui ones and one that seems to do the final framebuffer/surface display.

Maybe I could open the game ROM and find the shaders there and somehow figure out which are the shaders I want to play with?

I also read some article about transparency optimization but it was pretty technical and seems involved.
But it mentioned a shader thing,
#define MAX_FRAGS 4
Could that help?
Actually hold on a minute...
I just tried moving forward toward the village bonfire in Rasi 4 and as I get closer the frame rate picks up again.
At first when I am far away its 15 out of 25. But gradually it becomes better as I'm moving closer. Hmmm.
Could it be that its doing some slow texture loading and its not the Alpha blending?
I would expect the Alpha blending to be worse as it covers more screen?
Could just be bad LOD, so when you're far away, everything's on the screen and needs drawing, but when you're closer, some of it's off to the sides and can be skipped, and the game's not drawing lower-quality versions of things when you're far away and can't tell the difference.