• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Question Passthrough topic: Is there some material setting so an atom with a flat colour won't receive any shading effect, allowing passthrough effect?

tankson

New member
Joined
Nov 3, 2024
Messages
8
Reactions
1
So the atom will look like a silhouette essentially in whatever colour it's been allocated. This is for creating passthrough portals in a scene.
 
I got this working with a Unity shader:


C#:
Shader[] allShaders = UnityEngine.Resources.FindObjectsOfTypeAll<Shader>();
Shader desiredShader = allShaders.FirstOrDefault(s => s.name == "Custom/Flat");

if (desiredShader != null)
{
    material = new Material(desiredShader);
    material.color = new Color(93f / 255f, 104f / 255f, 93f / 255f, 1.0f);
}

var meshRenderers = theDildo.GetComponentsInChildren<SkinnedMeshRenderer>();

foreach (var meshRenderer in meshRenderers)
{
    meshRenderer.material = material; // Set your material here
    SuperController.LogMessage("Material set for MeshRenderer: " + meshRenderer.gameObject.name);
}
 
Upvote 0
Update: The shader name disappeared from the list of available but the following works:

Code:
Shader desiredShader = allShaders.FirstOrDefault(s => s.name == "UI/Default");
 
Upvote 0
Back
Top Bottom