• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.

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