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 Jason-RT-Bond · Mar 13, 2012 at 10:59 PM · cameraiosiphonewebcamvsync

WebCamTexture and VSync (iPhone 4)

I've got the camera displaying using the WebCamTexture class, and with a bit of tweaking to the requested width, height and FPS, it everything seemed to run very nicely on an iPhone 4S and an iPad 2.

HOWEVER, the very same code on an iPhone 4 results in horrendous screen tearing. This ONLY affects the WebCamTexture, not other game elements, so it's not a VSync problem with the actual screen, but rather between the camera and the WebCamTexture.

There is a minor amount of tearing on the iPad 2 and iPhone 4S, as well, but it's quite bearable.

I have tried adjusting the WebCamTexture settings available to me, but none seem to affect this.

Is there any way to force a WebCamTexture to only update when the camera has gotten a complete frame? Or am I missing something else that might be causing this?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by cbaltzer · Mar 20, 2012 at 10:08 PM

I've had this issue as well. Performance seems to be very poor with it. The only way I've been able to avoid tearing is to not provide a requested width/height, but only set the frame rate to 30 fps. As a result, the texture ends up being very small (192x144 or something), but doesn't tear.

I'm just curious what settings you've been using if you can get a smooth video feed at a higher resolution?

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
avatar image
0

Answer by Jason-RT-Bond · Mar 21, 2012 at 12:07 AM

I get fairly smooth performance on the iPhone 4S and iPad 2 with the size of the texture set to the screen size (which seems appropriate for AR apps to me) and the frame-rate set to 30 (which I think is the max for those devices).

On the iPhone 4 (not S), I had to set the desired width and height to 16 (which oddly produces something much larger than 16x16 in appearance, though noticeably blurry) in order to avoid the tearing issue. I consider this a bit of a hacky fix (especially since I don't see the direct correspondence between set size and appearance), though, and can't see why we are unable to pull the full camera resolution at 30 FPS without tearing like other camera-centric apps. Maybe this feature is simply buggy as it is new with 3.5? It might explain the sparse (some would say "well-buried") documentation on the subject, although I was hoping that I was just missing something.

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 reistiago · Jun 06, 2012 at 01:49 PM 0
Share

Hey. Im trying to display the camera texture in a way that will fill the screen but Im not being able to get it right. Can you share any indication on how you did it?

avatar image
0

Answer by cenk5355 · Dec 04, 2012 at 10:30 AM

You can specify the desired dimensions-->new WebcamTexture(Screen.width,Screen.height).After applying this I got the good results. Also you should apply the right values for your background and cam,here is the link that u can have an idea about it:

http://answers.unity3d.com/questions/280467/ipad-camera-aspect-ratio.html#answer-358311

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

6 People are following this question.

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

Related Questions

,iOS WebCamera Texture GetPixels() call returns only black colours? 1 Answer

iPad Camera Aspect Ratio 2 Answers

iOS camera and terrain size 0 Answers

How to access Camera Feed (iOS and Android) 1 Answer

Mini Mac - Can this Compile Unity? 2 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