CUAshaderMod

Plugins CUAshaderMod

Holy heck what a plugin! Saves me so much effort trying to fix weird lighting/shadow inconsistencies that drive me crazy while using postmagic stuff.
 
Hey nice plugin! Iwas trying to use it to modify transparency of an asset, however all the settings I've set get lost upon scene reload and the asset resets to default. Is there any way to preserve shader and transparency set in the plugin?
 
Can you give me this info to reproduce it:
What is the shader name you want to apply? "Sprites/Default" for example
What is the CUA? ... if it's public.
I did test scene save / load with the CUAs that come with VaM: car / sedan, shower and bathroom. Could you test if it works with these?
 
Hey! The asset is the curtain from this pack of assets: https://hub.virtamate.com/resources/locker-room.37359/

I used Marmoset\Transparent\Specular IBL on it to make it have an alpha of 0.95 and 0.00 with triggers. Upon loading scene the settings remain in the plugin, but the asset is at default color\shader\alpha.

I have tried doing the same with Bathroom and upon reloading it didn't work. I guess I'm doing something wrong? I just select the shader I want, color and alpha channel and that's it. Is there something I'm missing?
 
You're doing everything correct.
Loading the shader and plugin settings from the scene does seem to work fine then.
What fails is the part that applies the shader. Could not reproduce it here. I suspect a timing / race condition-problem or I wonder if you used the curtain with triggers to load different 'open' states. That did reload the CUA renderers and materials then. In my head treaded 1 CUA as 1 asset from the assetbundle and only applied the shaders on with the OnSceneLoaded-event or when the user moved shader slider.

Check if this version works:
https://mega.nz/file/fyp2XYZA#HrinJiYIsZ46bS4PZjiUpbsqMEPL-RKPgA04PPKGQBQ
I've added a call in OnCUALoaded to replace all shaders for every time the CUA (or the be precise: an asset from an assetbundle) is loaded now.
So going to the [Asset]-tab and moving the Asset slider will now instantly apply the shader with current UI settings.
Code:
private void OnCUALoaded()
{
    SaveMaterialSnapshot();
    ReplaceWithShader(jShaderChoices.val);   // <-- added
}
private void OnSceneLoaded()
{
    SaveMaterialSnapshot();
    ReplaceWithShader(jShaderChoices.val);
}
I hope this is it. Otherwise it could be a hard to figure out.
 
You're doing everything correct.
Loading the shader and plugin settings from the scene does seem to work fine then.
What fails is the part that applies the shader. Could not reproduce it here. I suspect a timing / race condition-problem or I wonder if you used the curtain with triggers to load different 'open' states. That did reload the CUA renderers and materials then. In my head treaded 1 CUA as 1 asset from the assetbundle and only applied the shaders on with the OnSceneLoaded-event or when the user moved shader slider.

Check if this version works:
https://mega.nz/file/fyp2XYZA#HrinJiYIsZ46bS4PZjiUpbsqMEPL-RKPgA04PPKGQBQ
I've added a call in OnCUALoaded to replace all shaders for every time the CUA (or the be precise: an asset from an assetbundle) is loaded now.
So going to the [Asset]-tab and moving the Asset slider will now instantly apply the shader with current UI settings.
Code:
private void OnCUALoaded()
{
    SaveMaterialSnapshot();
    ReplaceWithShader(jShaderChoices.val);   // <-- added
}
private void OnSceneLoaded()
{
    SaveMaterialSnapshot();
    ReplaceWithShader(jShaderChoices.val);
}
I hope this is it. Otherwise it could be a hard to figure out.
Finally had some time to test it. Works like a charm! I will now wait for official update so I can reference it.
 
Sally Whitemane updated CUAshaderMod with a new update entry:

Version 2

  • Shaders are now applied on every OnCUALoaded event. This gets triggered by using the asset-slider in the [Asset]-tab for example. It takes a snapshot of the original material and then applies the shader. This happens instantly. So don't be confused if the original material is never visible.
  • Changed the shader choice popup style from scrollable to filterable. Added a "Popup always open"-toggle. I'm...

Read the rest of this update entry...
 
Hopefully these shots showcase just how much this helped with this look. Oni's Elizabeth is the definitive version in VaM (or at least on the Hub), but his CUA hair couldn't be adjusted at all with ColorScale or UnityVamifier. While I can't find a shader that affords a nicer diffuse map and better showcases the subtleties of her dark brown hair colors, this is still loads better with the soft alpha/masking at the tips.

1702235544287.png

1702235567804.png


I can't wait to see what other long-suffering issues it fixes!
 
Last edited:
I like the idea, but one thing I'm running into is the lack of ability to affect the render queue, which can be an issue, especially with multiple transparent objects
 
Back
Top Bottom