Ishiiruka icon indicating copy to clipboard operation
Ishiiruka copied to clipboard

Fog/VFX Forced Lighting Fix

Open MrMendelli opened this issue 4 years ago • 17 comments

Would it be possible for the Forced Lighting (GFX tab 2) to include or recognize textures with an alpha channel? This would help some forced lighting problems when developing custom texture packs. If it is possible, could it also be made an independent option from tessellation settings?

MrMendelli avatar Apr 19 '20 23:04 MrMendelli

can you give me more detail on a game where i can test this?

Tinob avatar Apr 20 '20 03:04 Tinob

This was found through testing textures and material maps in Metroid Prime Trilogy. Our lead artist is testing textures and has Forced Lighting turned up, but as a side-affect the alpha channel for textures are rendering solid like the rest of the texture: R3ME01-1 R3ME01-2 R3ME01-3 R3ME01-7

MrMendelli avatar Apr 20 '20 20:04 MrMendelli

thanks, I can advance with this info.

Tinob avatar Apr 21 '20 13:04 Tinob

can you share some of those tetxures to test the issue?

Tinob avatar Apr 23 '20 02:04 Tinob

~~Yes, but I will have to email them over. You should have one in your inbox shortly.~~

MrMendelli avatar Apr 23 '20 02:04 MrMendelli

After some discussion last night, it was found that there was a clerical mistake with the art department. The game uses a chroma key and so traditional transparency used for the alpha channel was the cause of the visible boxes on the example screenshots. However, our lead artist is still interested in Force Lighting to be enabled independently from tessellation.

MrMendelli avatar Apr 23 '20 20:04 MrMendelli

It's not completely accurate to say that MP uses chroma key, those textures that are causing those boxes are blended additively (black means 0 alpha). You can tell because of the two strips on either side of the hud, those are used to block out the gauges.

Antidote avatar Apr 24 '20 08:04 Antidote

can you try this version to see if it fixes the issue? https://drive.google.com/open?id=1E1hgYK_u8Xgbx4t3y9lm26Wo_UTC1y0_

Tinob avatar Apr 25 '20 12:04 Tinob

can you try this version to see if it fixes the issue? https://drive.google.com/open?id=1E1hgYK_u8Xgbx4t3y9lm26Wo_UTC1y0_

I'm getting a 404, is it a public link or did you redact the upload?

MrMendelli avatar Apr 25 '20 19:04 MrMendelli

https://drive.google.com/open?id=1yKqPFXkLCYIbUM-iVUTIGtIwN3-6mZyE

Tinob avatar Apr 25 '20 23:04 Tinob

Thank you Tino, we will get back to you as soon as we can with our results.

MrMendelli avatar Apr 26 '20 00:04 MrMendelli

Hi Tino, I tested the latest update you made to the emulator regarding decoupling forced lighting from Tesselation. However, the option no longer appears to be working at all now.

image The Image Above shows forced lighting working properly with the Rim Lighting parameters. However, this only works when the tesselation option is enabled as well. Disabling tesselation disables any effect that Rim Lighting as on material maps (particularly Normal and Bump) essentially turning off the Forced Lighting as shown below:

image

This turns off the rim lighting from interacting with the normal map entirely. Due to the lights being static largely and not dynamic, we are relying on Rim Lighting implemented via Forced Lighting to make normal maps visible. This has been working great for us except the added requirement of tesselation creates issues with the geometry. One such issue primarily being the tesselation breaking the Fog volume geometry in some areas of the game as seen in the image below.

image

Please do let me know if you require any material maps to aid you with the process, I'd be happy to provide you with any number you need. Moreover, really appreciate your help with this project, things certainly would not be looking as good as they are now without your implementation of material maps and lighting into Dolphin. https://imgsli.com/MTUwNzg

Regards

Ray3D96 avatar Apr 26 '20 02:04 Ray3D96

my patch was not meant to detach teesselation from forced ligthing. that is imposible withthe actual code, I use the tesselation shader to calculate surface normals for the surcfaces that has no normals to force ligthing on them. this patch should fix forced ligthing with additive blending interaction to avoid the square artifacts. the fog issue is different will take a look and try to fix it.

Tinob avatar Apr 26 '20 02:04 Tinob

Hi, I appreciate the really quick reply. I did try the test version with Tesselation as well, however, it didn't seem to work with tesselation enabled either. No need to worry about the additive blending interaction, I can have the art team that by forcing an alpha channel to the effect texture. I much appreciate your effort with regards to this. Thank You for looking into the fog. This has been a tremendous help. Here are some details that I have gathered regarding the fog: This type of fog volume occurs only in certain rooms. Those rooms being Root Tunnel in Tallon Overworld and any room with Lava in the Magmoor Caverns. Here is a 100% save file for you to free roam and explore with ease.

MetroidPrimeTri-100-Save.zip Here is a save state for Root Tunnel in Tallon Overworld: Hotkey: F5 https://drive.google.com/open?id=1E06gFpn2LAaTUjj8AE2Nqb4C4Ma_W0RT

Once again, Thank You for your help. If there is any assistance I can provide, do let me know.

Regards

Ray3D96 avatar Apr 26 '20 03:04 Ray3D96

https://drive.google.com/open?id=1ukXXwjp3WdV5guRXQeEkJuUDieXJ39lV can you test if this version make it work again with tesselation

Tinob avatar Apr 26 '20 03:04 Tinob

Hi Tino, I tested the build and, image

Yes, the Forced Lighting is working fine with tesselation enabled now and properly showcasing the material maps. Thank You :D

Ray3D96 avatar Apr 26 '20 03:04 Ray3D96

ok now will take a look at fog

Tinob avatar Apr 26 '20 04:04 Tinob