I’m trying to make a single material that can have multiple layered materials on it with different WorldPositionOffsets.
Example is this white sphere with the blue hex. The hex is a second object+material with a larger WorldPositionOffset.
So my question, how can I make this one material, so I can apply it to any object (including landscapes) and it will be white with the blue offset above it?
Or alternatively, how can I make an object utilize 2 materials so I can add the white and then the blue?
I tried material layers but that keeps it as 1 flat material, and adding 2 materials ignores the second one since it wasn’t UV’d that way.
Thanks!
(Note: I’m trying to do this without custom UV’s so I can apply it anywhere including landscapes)
you can mask one of the spheres with vertex colors so only one is affected by the opacity mask and the glow or you can apply a multi-material in your 3d package. how you do that depends on your modeling package.
Sorry if my post wasn’t clear, but I was asking if it’s possible to do that in 1 material, so I don’t need multiple meshes.
Also that way it can be used on a landscape, splines, etc, since you can’t really create your own UV’s for those.
the shader won’t be able to duplicate geometry for you, so doing that through WPO on the same mesh and having it appear as if it were 2 is not possible out of the box - if at all.
you could try getting something similar with bump offset but that won’t affect the silhouette like your screenshot implies you want it to.
maybe look into POM for that. should be able to layer it with a mask. POM material - Rendering - Unreal Engine Forums
If you want to do that all in one material with only 1 sphere mesh, this requires ray tracing in a material. For a sphere this is actually pretty easy, in fact there is a material function called Procedural Ray Traced Sphere. You would basically be doing two procedural spheres. for the outer one you would be lerping between the entry and exit positions, and revealing the inner second sphere by using the opacity mask combined with a check of the inner sphere vs larger sphere exit depth.
Not too hard, but also not quite easy to set up for what could be very negligible benefits. I kind of agree with divi in that you are better off with vertex colors here. If you want it to be one mesh, just merge the meshes together and use the vertex color as a mask to lerp between different radii/behavior.