Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by mccosh · Feb 06, 2013 at 04:05 AM · shadermeshdepthmask

Creating Mesh for DepthMask Shader

I'm having a bit of trouble with an effect I am trying to make. I want to have a second camera view inside the first camera that I can toggle. This is similar to the ShapeWipe (http://wiki.unity3d.com/index.php/ShapeWipe) expect instead of having the view shrink or grow to transition from one camera to another, I just want a constant sized circle that shows the second camera view inside the first. Here is the link to my original question with a bit more detail of the effect I'm going for, http://answers.unity3d.com/questions/389145/partial-texture-swapping-in-real-time.html.

I've taken a look at the code for ScreenWipe and ShapeWipe and it looks like I need to apply a depthmask shader to a mesh. However, I've never really used any shaders and I'm not sure how to create a circular mesh.

I found code to create a mesh from code at http://docs.unity3d.com/Documentation/ScriptReference/Mesh.html but I don't know what it wants for mesh.vertices, mesh.uv and mesh.triangles especially for a circle.

So any ideas how to create a circular mesh to use in a ScreenWipe type situation?

Thanks.

Comment
Add comment
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

1 Reply

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

Answer by Eric5h5 · Feb 06, 2013 at 04:29 AM

Just make it in a 3D app. In Blender, it's Add->Mesh->Circle.

Comment
Add comment · Show 1 · 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
avatar image mccosh · Feb 11, 2013 at 01:46 AM 0
Share

Ultimately this is the best answer but I didn't have access to any 3D modeling software at the time of this post. I needed a circular mesh to use in a script. Fortunately I was able to click on the little + icon next to the slot for the $$anonymous$$esh variable in script's inspector. I could select from available assets, including a default sphere which gave the desired effect once I scaled it.

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

10 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

Related Questions

What are normals? 1 Answer

Depth mask with alpha / adding alpha to frag grabpass shader 0 Answers

How to realize Unity Editor Scene Filter View Effect in my game. 0 Answers

GPU performance with tris and verts 1 Answer

My mesh didn’t appear in Unity 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