• 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.

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
Messages
8
Reactions
1
Points
3
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