Camera Background Color

Plugins Camera Background Color

Sally Whitemane

Well-known member
Featured Contributor
Messages
272
Reactions
1,041
Points
93
Patreon
sallyw
Sally Whitemane submitted a new resource:

Camera Background Color - Set any color as main camera background.

Plugin to change the background color of the main camera.

A simple Plugin in response to a forum post - tested in desktop mode only.
https://hub.virtamate.com/threads/how-to-change-backgound-color-from-default-black.27733/

The background color should be saved per scene and should reset if the Plugin is 'destroyed'.
The skybox must be disabled under [Scene Lighting].
In case you need a transparent color for chroma...

Read more about this resource...
 
Had me worried about you, till I read the text. Thought you might have created a Bob Ross look.
 
Guide - Green Screen Passthrough with your Virt-a-Mate model using Quest 2
by Reddit user Prestigious_End_1784

Currently it's black and white passthrough on Quest 2, but take a look at the example video below. It's pretty mind blowing to be in the same room as the model you create in VaM and even pretending you're fucking her.


Here's how you set this up using ALVR/ALXR:

Install and run the ALVR server code on your PC that you're running VaM on

https://github.com/alvr-org/ALVR/releases/download/v18.2.3/ALVR_Installer_v18.2.3.exe

2. Sideload the modified ALXR apk to your Oculus Quest 2 -- this uses green for passthrough instead of black:

https://github.com/JelloMaze/ALVR/r...ed-8cf5f6ca3619198fd66b/alxr-client-quest.apk

3. Make sure you've downloaded the camera background color changer plugin:

https://hub.virtamate.com/resources/camera-background-color.24185/download

4. On your PC, launch VaM

5. Once you're in VaM, use the Left Menu + Right B button combination.

6. Now add the background color changer plugin as a Scene plugin and set it to a shade of green that you'd like to use for passthrough.

This will fill in the green areas with passthrough and make the model look like she's in your room. You can also try Left Menu + Right A button which will blend both and make her appear like a ghost.

Note: You may need to adjust the exact shade of green you're using to prevent the model from having too much of a green outline. Unfortunately some green outline is unavoidable due to using this method but it can almost eliminated. Have fun!
Just in case Reddit deletes this info this spoiler is a backup.
 
Last edited:
The background color doesnt change in VR, only in desktop. Doesnt anyone else have this issue?
 
@qpwoalsk
Did you load a scene where the skybox is enabled and set to 100% dark? It's easy to fall for that and assume it's a black background. :)
Any 3D object, including the skybox, blocks to view to the actual background.

Before I published the plugin I did ask a user on Discord to confirm it works in VR. I do not own VR hardware.
If it's not working, VAM may use another Camera-object for VR. But I doubt it. Has been out for a long time.

I can't get rid of the green line completely, what should I fix?
Not sure what green line you are referencing. I assume you use it for a passthrough.

MSAA Anti-Aliasing is off? Did you avoid anything that 'mixes' pixels?
I think effects from other Post-Processing plugins could cause this too. Or it's from the external software used ... if it scales the image rendered by VAM.
Can only answer this "in theory" up to the point where VAM should render an image where the background and all 3D objects are clearly separated.
It's not a plugin made for myself.
disable MSAA Anti Aliasing.png
 
@Sally Whitemane

Thank you for your response. I think it's not a problem with the background color plugin, but with the ALVR program I'm using. I don't know how it works, but...
 
Sally Whitemane updated Camera Background Color with a new update entry:

Version 3

The skybox will now be disabled automatically by default. This should prevent users from falling into the 'skybox pitfall' - leaving them confused and thinking that this Plugin does not work. I think in this case it is safe to assume we want it disabled to prevent it from blocking the view on the background color.
  • Added 'Show Skybox' Toggle [default=off]
Creators: In cases where a scene does use the Plugin and you want to keep the Skybox on you can either save the scene with the 'Show Skybox'-toggle on or simply keep using Version 2.

Read the rest of this update entry...
 
Last edited:
Hi Sally, firstly, can I say what a useful plugin this is !
I have it set up as a session plugin with background colour set to my passthrough preference.
However, I don't use passthrough all the time so I disabled the plugin, then saved the session defaults so that it would load in the disabled state.
However, the plugin is not recognising the fact that it is disabled and changes the backgound colour regardless, instead of leaving it black.
I know this is a very minor bug but I would be grateful if you could fix it sometime. Thanks !
 
Could be. I don't use this much myself. So I tend to find less bugs in this one.

Did you use this version here (saves color in scene json) or the Session Plugin version (saves in Saves\PluginData\CameraBackgroundColor\default.json)
Because technically the first one can be loaded as session plugin too - but it should be unable to remember the color choice then.

Only did a very quick test here with both versions by loading the default scene and doing a VAM restart. Somehow can not replicate it. Both did keep the background black when loaded in disabled state. There is a Start-function that does set the color - but it's only executed here if the Plugin has the 'enabled'-state. So either this one behaves different for you and needs a simple extra if (enabled)-check or something is fishy ... can you rule out that you not accidentally loading two Plugins? Session Plugin as disabled and another somewhere forgotten in a scene maybe?

Have to finish other things for now - will figure it out another time.
Send you a friend request on Discord. Can send you a fixed version to test once I'm on it.
 
Last edited:
Sally Whitemane updated Camera Background Color with a new update entry:

Version 4

  • Merged session- and scene-plugin versions.
  • Fixed logic related to enabled / disabled state. The UI is no longer accessible in disabled state. Important for creators: In disabled state it's no longer possible to set a color or toggle the skybox with scene triggers or the UI.
  • Fixed error for scenes without WindowCamera atom
  • Fixed OnEnable()-NullReferenceException appearing in VAMs logfile
  • A warning will now show if multiple...

Read the rest of this update entry...
Hopefully the last update ever. Tested a lot.
 
This is an experimental Version 5.
It adds a quick toggle to disable/enable all renderers by UI or [Control + R] shortcut.
A quick way to hide/unhide scene objects.
The idea is from user @hijku here. Code is different.

These atom are excluded:
Person, WindowCamera, CoreControl, VRController, InvisibleLight
Because I cannot test VR there is a chance it will hide atoms that are supposed to be visible in VR.
In that case I would need info from VR users to exclude this atom type.
For that reason I left debug messages enabled to print out what gets toggled.

*outdated link removed - update here*
External link because forum currently blocked zip and var.
 
Last edited:
This is an experimental Version 5.
It adds a quick toggle to disable/enable all renderers by UI or [Control + R] shortcut.
A quick way to hide/unhide scene objects.
The idea is from user @hijku here. Code is different.

These atom are excluded:
Person, WindowCamera, CoreControl, VRController, InvisibleLight
Because I cannot test VR there is a chance it will hide atoms that are supposed to be visible in VR.
In that case I would need info from VR users to exclude this atom type.
For that reason I left debug messages enabled to print out what gets toggled.

https://mega.nz/file/PuwwHJDS#bN5NIvNphW4uoZeqmJ83mZ5HxFZ22tICLyGTtc60IGE
External link because forum currently blocked zip and var.
Just gave it a quick try in VR, awesome. A good way to just switch your muse into your room w/o all the cleaning needs. Thx!
Video looks shite bc too less light in the room.

I'll test it later on some different scenes to see if I find something.
But for this particular scene: the VamStory buttons remain, which is good bc you can still use them in passthrough. Same would apply to VAM internal triggers (UIButton, Slider etc.), I guess?
 

Attachments

  • VirtualDesktop.Android-20231124-161523.mp4
    47.8 MB
Thanks for testing and feedback! (y)
... buttons remain, which is good bc you can still use them in passthrough. Same would apply to VAM internal triggers (UIButton, Slider etc.), I guess?
It looks like all the UIButton, UIToggle, etc... are rendered with a "CanvasRenderer"-object.
Despite it's name it's not inherited from the "Renderer" class, which is what the script hides.
It was not indented, but yeah these should probably stay visible anyway. :unsure:

Think I fixed one bug after uploading the version above yesterday. It did not unhide when the plugin got disabled.
 
Last edited:
Any chance you could skip dildos or add is as an option to plugin?
 
Last edited:
Any chance you could skip dildos or add is as an option to plugin?
What comes to my mind: the plugin collects all the scene atoms, make a list out of it and you can choose what to hide or not. Good idea...
 
Depends on the count I guess? If you can group them and have reasonable count then it would make sense.
 
And I found small issue: it doesn't hide all atoms:
Reflective group like: ReflectiveSlate, Mirrors.
Misc group as well and stuff like WebBrowsers, ImagePanel.
Lighting group and TechnoLights, CyberpunktLight etc
 
I guess excluding the 4 build-in toys by default is a good idea.
What comes to my mind: the plugin collects all the scene atoms, make a list out of it and you can choose what to hide or not. Good idea...
Will keep that idea in mind. For now I will try to come up with good default 'filter' settings.

Concerning the other objects that refuse to hide: They don't seem to have any Renderer-objects.
Looked at a TechnoLight-atom. Oh boy that thing is build out of a bazillion little pieces.
I suspect what draws these is this DAZSkinV2-object. It has a similar function named renderSuspend that I haven't tested yet.
Looks promising. Should be possible to hide too. I'll get back to this after I finished other exciting plugin stuff.
Clipboard01.jpg
 
I forgot where/who made a plugin for selecting multiple objects/atoms in vam scene list (so that we can delete with one lethal click a long list of custom unity assets, for instance) if anyone has the hub link would be appreciated ... maybe it was a freeware not patronized, but I am not sure :rolleyes:
 
I forgot where/who made a plugin for selecting multiple objects/atoms in vam scene list (so that we can delete with one lethal click a long list of custom unity assets, for instance) if anyone has the hub link would be appreciated ... maybe it was a freeware not patronized, but I am not sure :rolleyes:
I use this one for such
 
Here is an update.
https://mega.nz/file/Cqpz0IBa#W3ClLOu9edKSdQxrhZwusZY1AUP1wfd3bk84dlKJPVM
A lot has changed. Named this "Version 5 experimental 2" to avoid confusion if questions come up.

The list of excluded atoms changed to:
Person, WindowCamera, CoreControl, VRController, Dildo, Padle, ToyAH, ToyBP, Button, UIButton, UIButtonImage, UIToggle

InvisibleLight got removed because all light calculations still happen if hidden and it's already invisible *doh*. All four build-in toys where added and I had to add the interactive UI-elements now too ... because the new code would now hide them if I did not. There could still be more atoms that should be excluded by default. For example I'm thinking about the speech bubbles that where used in many older scenes for example.

On top of the Renderer's it now hides additional object type:
MirrorReflection, DAZSkinV2, CanvasRenderer, Terrain
I guess the CanvasRenderer included the UI-elements, which is why they are now excluded.

If you are wondering why the Plugin user interface got so ugly squeezed on the left side - it's because there is unfinished broken filter-list code inside. That filter-list would appear on the right side then.

Btw. I noticed glitchy behavior with clothing if the person atom gets hidden. Cannot recommend in case someone tinkers with the code.
 
Last edited:
Works perfectly now! I can switch from my messy script :D
So now the only piece that I couldn't figure out is: how to apply background color to person atoms (e.g. only to a male in the scene) but in a way the lighting doesn't add shadows.
 
If i uncheck renderers, it hides all my buttons in my scene aswell as atom-linked hair pieces and body parts. is that intended? i donwloaded the latest one.
 
Back
Top Bottom