Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The potential of the programmable pipeline
12-05-2014, 09:56 PM (This post was last modified: 12-14-2014 08:02 PM by SkyBladeCloud.)
Post: #1
Photo The potential of the programmable pipeline
Just passing by to share my experience tweaking PPSSPP's shader generator.

As you may already know, the emulator uses OpenGL ES's programmable pipeline to emulate the PSP's fixed one. This is done generating GLSL shaders based on the state of the GE.

Now the interesting thing here is that the shader generator can be tweaked to implement custom blending algorithms or even new lightning models. This is different than custom post-processing shaders, since one can even apply effects based of the actual geometry.

For example, in the following video I show FF Type-0 using a very basic Phong implementation (a per-fragment color illumination model), as opposed to the default per-vertex lightning it originally uses for characters:

dailymotion.com/video/x2buwaw_ppsspp-custom-lightning-model_videogames

Notice how lightning flows through the model. The downside is that PSP games don't normally upload enough material information for complex lightning models to look 100% ok. This is why characters look like porcelain in my video xD. Of course, it can be tweaked further until it matches one's expectations (lowering the specular component on the Phong shading lightning looks more realistic, and not so plastic).

Another example are custom blending models + on-the-fly normal mapping. Given this original scene:

i57.tinypic.com/2ujjfqc.jpg

We can generate in-shader normal maps (reading surroinding texels) and apply them to slightly increase the level of detail. Possibilities are endless, here is one possible result (and yeah, I messed up character's shaders on this one lol):

i58.tinypic.com/xbfl1h.jpg

Again, tweaking the shader generator it's possible to achieve different (and most likely better) result. In this case, there was no light information for static meshes, so normal mapping hardly works with hard coded lights, showing a crispier image.

Aaaand.... here's is a mix of both, to kinda keep the original color feel ^_^":

i59.tinypic.com/2por78k.jpg

I bet many games could benefit from alternative (probably game-specific) shader generators. One could argue if possible improvements do worth it, considering you'd be getting altered results, which is opposed to the concept of emulation. At least type-0 looks pretty good like this, and I think I'm gonna use it to finally (win!) play the game ^_^".

UPDATE: Video showing some cool effects:





Regards:

~Sky
Find all posts by this user
Quote this message in a reply
12-06-2014, 08:56 AM
Post: #2
RE: The potential of the programmable pipeline
Very informative post. Thanks.
Find all posts by this user
Quote this message in a reply
12-06-2014, 12:22 PM
Post: #3
Thumbs Up RE: The potential of the programmable pipeline
This is just... wow Exclamation

Chill and Go with the flow ~d[o_o]b~

@YT - youtube.com/user/SuperHack333/videos

Specs:
MDL: Dell G7 15 7590 (Laptop)
OPS: Windows 10 Pro 64-bit
CPU: Intel Core i7-9750h @ 2.60 Ghz ~ 4.50 Ghz
GPU: Nvidia GTX 1660 Ti 6GB GDDR6 @ 1455 Mhz ~ 1590 Mhz
RAM: Micron Tech. 8GB DDR4 @ 2666 Mhz (4x2)
Find all posts by this user
Quote this message in a reply
12-07-2014, 09:58 AM
Post: #4
RE: The potential of the programmable pipeline
Moved.

♦ Intel Core i7-6700HQ | 16 GB RAM | NVIDIA GeForce GTX 960M | Debian Testing
♦ Intel Core i7-2630QM | 4 GB RAM | NVIDIA GeForce GT 540M | Debian Testing
♦ PSP-3004 | 6.60 PRO-C2
Find all posts by this user
Quote this message in a reply
12-12-2014, 05:08 PM
Post: #5
RE: The potential of the programmable pipeline
Could it, for example, add ENB Series effect? Lol

Phones: Poco F3 8GB/256GB (Snapdragon 870 5G) and Redmi Note 6 Pro 4/64GB (Snapdragon 636)

PC: AMD Ryzen 5 3600 / 16GB RAM DDR4 3600MHz / NVIDIA GTX 1660 Ti 6GB / Windows 10 Pro
Find all posts by this user
Quote this message in a reply
12-13-2014, 03:08 PM
Post: #6
RE: The potential of the programmable pipeline
This looks awesome.
Find all posts by this user
Quote this message in a reply
12-14-2014, 12:27 AM (This post was last modified: 12-14-2014 12:56 AM by SkyBladeCloud.)
Post: #7
RE: The potential of the programmable pipeline
(12-12-2014 05:08 PM)GuilhermeGS2 Wrote:  Could it, for example, add ENB Series effect? Lol

haha, not sure if it's a joke but something similar can be done, in fact, let me try to do some cool stuff...

...
Find all posts by this user
Quote this message in a reply
12-14-2014, 08:01 PM
Post: #8
RE: The potential of the programmable pipeline
Here, looks pretty cool IMO ^_^"





~Sky
Find all posts by this user
Quote this message in a reply
12-14-2014, 10:33 PM
Post: #9
RE: The potential of the programmable pipeline
No, was not a joke. ^^
Nice job, keep up. Can it be used on all games?

Phones: Poco F3 8GB/256GB (Snapdragon 870 5G) and Redmi Note 6 Pro 4/64GB (Snapdragon 636)

PC: AMD Ryzen 5 3600 / 16GB RAM DDR4 3600MHz / NVIDIA GTX 1660 Ti 6GB / Windows 10 Pro
Find all posts by this user
Quote this message in a reply
12-14-2014, 10:42 PM (This post was last modified: 12-14-2014 10:52 PM by SkyBladeCloud.)
Post: #10
RE: The potential of the programmable pipeline
Yes, as long as new shaders are compatible with the target game (which ultimately depends on the vertex type used by that game). One could also completely rewrite the shader generator to support these effect. In such case, game specific shaders would be automatically generated with new effects on them.

About EMB Series, the main issue is that those are HLSL shaders, and I'm currently using OpenGL (which uses GLSL), so some translation is required...

...
Find all posts by this user
Quote this message in a reply
12-15-2014, 04:56 AM
Post: #11
RE: The potential of the programmable pipeline
(12-14-2014 08:01 PM)SkyBladeCloud Wrote:  Here, looks pretty cool IMO ^_^"





~Sky

Damn great great job man looks amazing Big Grin

Chill and Go with the flow ~d[o_o]b~

@YT - youtube.com/user/SuperHack333/videos

Specs:
MDL: Dell G7 15 7590 (Laptop)
OPS: Windows 10 Pro 64-bit
CPU: Intel Core i7-9750h @ 2.60 Ghz ~ 4.50 Ghz
GPU: Nvidia GTX 1660 Ti 6GB GDDR6 @ 1455 Mhz ~ 1590 Mhz
RAM: Micron Tech. 8GB DDR4 @ 2666 Mhz (4x2)
Find all posts by this user
Quote this message in a reply
12-15-2014, 12:59 PM
Post: #12
RE: The potential of the programmable pipeline
(12-14-2014 10:42 PM)SkyBladeCloud Wrote:  Yes, as long as new shaders are compatible with the target game (which ultimately depends on the vertex type used by that game). One could also completely rewrite the shader generator to support these effect. In such case, game specific shaders would be automatically generated with new effects on them.

About EMB Series, the main issue is that those are HLSL shaders, and I'm currently using OpenGL (which uses GLSL), so some translation is required...

...

OK, thanks for the reply. I really don't understand anything about programing, so I have no idea how this works. Big Grin

Phones: Poco F3 8GB/256GB (Snapdragon 870 5G) and Redmi Note 6 Pro 4/64GB (Snapdragon 636)

PC: AMD Ryzen 5 3600 / 16GB RAM DDR4 3600MHz / NVIDIA GTX 1660 Ti 6GB / Windows 10 Pro
Find all posts by this user
Quote this message in a reply
12-22-2014, 09:08 AM
Post: #13
RE: The potential of the programmable pipeline
Dolphin does this with it's "per-pixel lighting" functionality - it reformulates the lighting equations to run in the pixel shader instead of the vertex shader. PPSSPP could indeed do the same, and as you have shown also do other interesting things.

Patches welcome, as long as they take care not to slow down the "regular" path Smile
Find all posts by this user
Quote this message in a reply
12-22-2014, 10:50 AM
Post: #14
RE: The potential of the programmable pipeline
(12-22-2014 09:08 AM)Henrik Wrote:  Dolphin does this with it's "per-pixel lighting" functionality - it reformulates the lighting equations to run in the pixel shader instead of the vertex shader. PPSSPP could indeed do the same, and as you have shown also do other interesting things.

Patches welcome, as long as they take care not to slow down the "regular" path Smile

ohohoho Cool

Seems like this feature might be implemented sooner... can't wait to test this on PPSSPP Big Grin

Chill and Go with the flow ~d[o_o]b~

@YT - youtube.com/user/SuperHack333/videos

Specs:
MDL: Dell G7 15 7590 (Laptop)
OPS: Windows 10 Pro 64-bit
CPU: Intel Core i7-9750h @ 2.60 Ghz ~ 4.50 Ghz
GPU: Nvidia GTX 1660 Ti 6GB GDDR6 @ 1455 Mhz ~ 1590 Mhz
RAM: Micron Tech. 8GB DDR4 @ 2666 Mhz (4x2)
Find all posts by this user
Quote this message in a reply
12-23-2014, 05:27 PM
Post: #15
RE: The potential of the programmable pipeline
Could this effect make colors more natural instead this sepia? I think would look better. Smile

Phones: Poco F3 8GB/256GB (Snapdragon 870 5G) and Redmi Note 6 Pro 4/64GB (Snapdragon 636)

PC: AMD Ryzen 5 3600 / 16GB RAM DDR4 3600MHz / NVIDIA GTX 1660 Ti 6GB / Windows 10 Pro
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: