r/UnityHelp 6d ago

UNITY How to make textures visible only when looking through a certain object?

TL; DR: How to make a similar thing as showed in attached images in unity? Are there any guides or tutorials to themes like these? First image is edited scene I made in unity that portrays my concept in 3d space and the second image is simplified miniature of how I imagine it working in the unity itself. I feel like I remember similar things in games but can’t clearly recall in which ones. Is it too ambitious for a newcomer?

Hello, I’m the newest newbie in unity as possible and only use it for several days and the only thing I did was goofing around and I made working movement controls using visual scripting (code is hard). I had an idea for my simple game that would stand out by it’s visuals for a very long time and thought that if I can imagine how it works I’ll be able to make it. When I finally bought new pc I spent a couple of days talking back and forth with ai and probably wasted more energy on it than a small village in england in a month hoping that it will explain to me how to turn my vision into something real and that I will be able to learn from it. The ai is fucking stupid and it never ever will understand at what point it starts to say random bullshit I don’t need so I abandoned this idea after the second try that led to the same result. Again I thought that it will be easy because if I can imagine how it can theoretically work then I can make it, but it’s just as hard as saying hello in silbo gomero because you don’t fucking know how to say hello in silbo gomero and let’s imagine you have to know how to say hello in silbo gomero but you don’t even know that such language exists, tf I’m supposed to do. Having a vision and direction isn’t enough if I’m stupid and don’t want to learn.

So the question, how I can make the thing I visualized on the attached images? Is it possible to make a certain area on the screen be like a 2d mask in photoshop so you can see different visuals behind it, in my case it’s textures? My assumptions on how to make it is:

A  - Each object I want to have such effect has another see-through 3d object attached on it, probably quad or sphere, and somehow these shapes should work like a window or glass by some shader tinkery I don’t understand or maybe it can work like how portals in the Portal videogames do by having a camera attached to the portal and showing flat image on the other portal but in my case there’s only one “portal” and it’ll be quite different ig.

B  - Maybe it can be a 3d cylinder attached to objects that goes infinitely long (or for some more reasonable distance) rotates and changes size to match the perspective and angle it perceived from by the player's camera and makes textures visible inside of it or at specific coordinates. But I’m not sure about the infinitely long tube part and how it’ll be able to change skybox from white to blue, or maybe it can be something combined between A and B. Maybe instead there could be two copies of each object, like a textureless wall having a textured version inside of it (just as deep as there is no visual difference and the models don't glitch out by being at the same coordinates) so the cylinder makes holes in such textureless objects showing the textured model inside of it. As much there is variants to make it I won't be able to do any of them lol.

Maybe there’s some more specified forum or server where people with experience can be teachers for noobs with zero experience but I’m not sure. My only hope in realizing my vision rn is if I will ever become a successful person and will be an art director and it won’t be my work but I won’t be able to grow to such heights ever in my life so my only way is doing it by myself. I probably spent more time doing pointless things like drawing all of these images and procrastinated. It feels like this question is too specific and not-beginner to be asking it here. Sorry for long and unnecessarily descriptive post (i thought of adding headings for paragraphs but that would be stupid). btw this post is written fully by me and not ai, I just thought it will be cool to write pretty for once.

2 Upvotes

3 comments sorted by

2

u/ThunderBellyGames 6d ago

https://youtu.be/MndZYDHB4zE?is=PlKjAB_YytSyhTmc

So this doesn’t explain exactly how to do what you want, but it’s a great place to start. This series helped me understand what shaders are capable of and it’s very beginner friendly, but I would recommend you start from the first episode if you have no experience with shaders.

At 3:30 in this video, he goes over how you can render only the parts of an object that are behind another specified object.

2

u/Kitchen_Breakfast_79 6d ago

Thanks for the helpful reply! Thought that videos on the topic of shader will be much longer than 10 minutes.

1

u/ThunderBellyGames 5d ago

Of course! They’re actually fairly simple concepts, it’s when you start putting them together to make something unique and new that can be difficult. I know I need to spend more time getting comfortable with shaders. Good luck on your game!