Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Darkforge317 · Dec 04, 2017 at 03:32 AM · maskingrender textureportals

Masking a Render Texture?

Hello everybody!

I've been attempting to mask a render texture and I can't seem to get the hang of it.
I'm making a cheap re-make of Portal (the game by Valve) for a school project and I have a render texture that's being used to render the portals.

However, the render textures are square and the portals are egg-shaped.
This is why I need to figure out how to mask the edges. alt text
First off: My unity version is 2017.1.2f1

I tried watching YouTube tutorials on this matter to no avail. One video showed right clicking on an image, going into "2D Objects" and clicking "Sprite Mask".

It sounded promising until I realized that:

Sprite Mask's only work on Sprite Renderers, and since I'm using render textures they are not sprites. I tried looking at the settings on the texture to see if I could make it into a sprite...
However, there is no option for it since these are render textures, not regular textures. List item

So my question is this.

Is it even possible to mask out a render texture?

If so then how do I do it?
If it's not possible then is there a workaround or a different approach you can recommend to me?

Thanks in advance for your help with this!
PS: Check my comment on this post to see what image I made for the mask.

capture.png (27.3 kB)
capture.png (113.2 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Darkforge317 · Dec 04, 2017 at 03:36 AM 0
Share

I was limited to 2 images on this post. This is the mask I have created. It's just a white egg-shape, The black in the background has since been removed from the image since I learned that it wasn't needed. I'm only showing the black background version for display purposes on this website (since a white egg-shape on a white website background wouldn't show)

alt text

portalmaskdisplay.png (3.0 kB)

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Darkforge317 · Dec 04, 2017 at 10:19 PM

My teacher figured out a good alternative...
Posting it here if others are having a similar problem.

I made a cylinder, gave it a rotation of 90 degrees on the x axis, and then scaled the Y axis down to 0.001. alt text
This makes it so that the cylinder is basically a circle. So applying the render texture to this object gives me the same desired effect. alt text


capture.png (138.9 kB)
capture.png (34.4 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

117 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Building Portal in VR in Single-Pass Stereo shader 3 Answers

Is it possible to see a render texture through another render texture? 1 Answer

is it possible to mask/stencil camera views when using multiple cameras? 0 Answers

UI image hiding another image until moved 1 Answer

is there a way to hide an object synchronously? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges