• Hi Guest!

    Please be aware that we have released another critical security patch for VaM. We strongly recommend updating to version 1.22.0.12 using the VaM_Updater found in your installation folder.

    Details about the security patch can be found here.
CUAshaderMod

Plugins + Scripts 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
 
Hello! I tried using this for a CUA hair, but I changed the wrong one and am trying to get back the default look. Is there a way to undo the changes we did? Or stop the plugin from automatically replacing all shaders?
 
Read your post, but unfortunately don't have the time for VAM right now due to job.

The plugin has two functions to apply shaders on VAM based events:
VAM has completed loading a CUA: OnCUALoaded() gets called.
VAM has completed loading a scene: OnSceneLoaded() gets called.
The second one is definitely needed to restore a modified shader for saved scenes using the plugin. So I can't really remove it without breaking compatibility. Those scenes would no longer load with the modified shader then.

! Did not test this: !
Commenting out ReplaceWithShader(jShaderChoices.val); in OnCUALoaded() could maybe work. You could then go back to VAM's CUA user interface, reload it, and the plugin will no longer auto replace the shader.
C#:
private void OnCUALoaded()
{
    Log("OnCUALoaded()");
    SaveMaterialSnapshot();
    // ReplaceWithShader(jShaderChoices.val);  // DISABLED
}
Try it out. Save the attached modified script file into <VAM>\Custom\Scripts\ somewhere. Load it from there instead from the .var -package.
 

Attachments

  • CUAshaderMod.cs
    14.5 KB · Views: 0
Back
Top Bottom