Dolphin, the GameCube and Wii emulator - Forums

Full Version: [Wii] Donkey Kong Country Returns
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Well I found the shaders and I played a lot with GLIntercept (x64).
But I couldn't fix it..

Maybe I didn't find the correct shader.. It has a function that flashes the image that is manipulated from the shaders.
But let's say that this happens and outputs the result to another shader, then it doesn't flash.
Nevermind found it.

Proof of concept:
[Image: SF8P01-73.png] [Image: SF8P01-63.png]

Sweet Bloom FX!!
Wow, nice! The downside is that this is different for every game, right?
And what exactly is it you changed and can it be used by anyone? Is it like an extra file we put in the game folder or whatever? If it's a shader file, let me guess, it's not allowed to be shared because there's copyright on it, eh?
*Careful: Wall of text and technical bits*

Yes, per game.

Again some more info (all procedures below are simplified) after examining the shader.
The game sends 4 copies of the same EFB copy (2nd stage in a previous post of mine).
And also sends 4 different positions (x.y) and 4 pairs of texture matrices (x and y have separate matrix).

It uses these to transform the texture and then blend it. All of this is done serially by Wii's TEV (Texture Environment Unit) process.
It uses the result of the previous tev to blend each of the 4 images. The 1st image use the original input image.
Also the side images have less brightness than the 2 centered images, to create a fade out effect.

What I did was that I changed the positions of these images to make them more compact.
The original distance is indeed correct. In 640x480 you cant actually see the 4 images that are used for Bloom like effect because of low pixel count.
It looks, like it's really blurred on  all 4 directions.

In bigger resolutions it correctly creates a scaled distance. 
With a bigger internal resolution we have a lot of pixels now and we can clearly see the 4 images used.

If retro studios wanted to create a more smooth shader, they could use 6, 8, 10, etc TEV stages.
Let's explain this in transparency instead of brightness and in 6 TEV stages:

Let's move to your questions:
It can only be used with the same UID shader cache. Otherwise it needs a somekind of a hash function that when it finds the same shader to change it with one provided.
Well it may support this. I ddn't check actually.

So, this is an interceptor for OpenGL (yes you guessed it, must be used in OpenGL backend).

Let's go to the critical question. Can this shader or the UID cache be shared?
Yes. Gamecube/wii don't actually use shaders because it don't support it. It has a set of 16 TEV stages and you can use many in a serial way.
What you actually see as shaders and as UID shader cache, is translated vertex and pixel, plus TEV stages process, translated by Dolphin.
It's only illegal to share the original code that was translated to these. Well good luck extracting it from your rip files xD

For example, to share the UID shader cache from Wii U's game, is actually illegal.
Because WiiU has real custom vertex/pixel shader units. So some bits of the code is only translated to fit OpenGL/DirectX/Vulkun requirements.
Anyway, legislation on these is weird. (For example, wii SDK is legal to share since november of 2013, because the console stopped selling worldwide).

Some final thoughts,
Because my hands are "itchy", I will try to do both fixes above and keep the best. And then check if it can be done on the fly.
Nice, I (having no clue about programming and all that mumbo jumbo) could actually mostly follow your explanations ^_^
I thought you were just a texture creator but it sounds like you might also be helpful in the dev team Smile
Well I was always trying to explain as much as I can, because not all people know or care about technical things.
And it's true and logical. It's useless info if you don't use it.

Dunno about being helpful for the devs..
Actually my knowledge of Dolphin and Wii/gamecube is quite limited. I started learning only yesterday how some things work in Dolphin and wii shaders.

But I'm quite good in Linux/android kernel development. Smile
So mostly C. Useless for Dolphin.
Hmmm I did the more TEV stages way and also made the newer bigger brightness of the effect, the same with original.

It turned out pretty nice and sweet.
It went from this[Image: blurMethod02.png] to this [Image: blurMethod03.png]
Yeah, that's definitely an improvement Smile
Here's how it looks like:

[Image: SF8P01-64.png] [Image: SF8P01-74.png]

The end result uses 8 TEV stages.

Still didn't figured out how to auto change them..
Yeah, that's sweet. What do you mean by 'auto change'? Getting it to work for the rest of the game?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23