I need to be able to only show the diamond in this cube, not whats outside of it. heres the cube:
And heres the material function:
I need to be able to only show the diamond in this cube, not whats outside of it. heres the cube:
And heres the material function:
That’s deceptively hard. In a void, it’d be pretty easy, but not if you want to have anything behind it.
The easiest way I can think of that works with complex shapes is to line up the UVs in such a way that the diamond occupies a square of space- preferably in a corner.
Alternatively, for this very specific use case, assuming you have the center of the object at the center, you can use a distance check of local position.
You’ll want a much lower value in size of diamond.
I just made it that high in order to see the results for myself since I didn’t have a mesh like that on hand.
it goes fully invisible if i turn it down too far, too high and it’s fully opaque. I’m assuming what i’m wanting to do is extremly hard. would i be able to apply the logic of the portals, y’know, just the see through stuff, and have that go to somewhere hidden on the map with that diamond inside of it?
EDIT: Render targets i think they’re called. Could i use that?
You’re correct- portals do use render targets.
That’s weird… it works fine for me. Keep in mind the adjustments have to be small and depend on the size of your mesh.
I see what you mean, Would it be possible to make the inside faces be fully opaque, whilst the outside faces be slightly transparent?
Maybe I’m missing something, but why not just hide the mesh of the outer cube? Seems a lot easier …
Yup- just swap the invisible (0 value) to be something like 0.5, and add a dithering node after the if node. That gives it a pseudo transparent property without the performance impact of full-on transparency.
It’s one mesh. Nothing wrong with that approach, but I typically try to avoid suggesting people make structural changes if I can just answer their original question.
Hi! What you just described was great, honestly, but i got weird shading artifacts, so. I’ve decided to make a material that flips the normal of the mesh
It’s extremly simple:
And the player will only ever see it in their edit mode, which looks like this:
Which i think looks pretty cool
But uh, once again, thank you for all your help, I hope you have a great day, thanks!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.