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 /
avatar image
0
Question by kevin0228ca · Dec 14, 2016 at 03:21 PM · vrrendertexturewebcamtextureblendingmultiple cameras

Best approach for alpha blending multiple webcamtexture is renderTexture?

Hi, I want to blend multiple webcamtextures from multiple webcameras to be viewed by a user in VR.

The blend should be able to

  • Fullscreen alpha blend, e.g. 50% cameraA + 25% cameraB + 25% cameraC

  • Area blend, e.g. leftmost 25% is CameraA + middle 50% cameraB + rightmost 25% is cameraC

I am wondering what is the best approach for implementation.

Each webcamera is different in resolution so cannot use one single cameraPlane with multiple materials and shader for blending.

I think each webcam must be rendered to each's own cameraPlane, e.g. cameraPlaneA cameraPlaneB cameraPlaneC and have 3 unity camera camA camB camC each looking at the cameraPlane.

Then render each to a renderTexture, and attach the 3 renderTextures to a single blendedCameraPlane with custom shader to be displayed to the user.

The custom shader then handles the blending of the 3 materials.

Is this the correct approach? Thank you.

Comment
Add comment · Show 2
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 Glurth · Dec 14, 2016 at 04:15 PM 0
Share

What about z- ordering? Usually each camera will render everything in it's view, via Z-order, so that object X shows up "in front of or behind" object Y. If you THEN blend together multiple camera results, you will, effectively, be apply a new z-ordering, by camera, (rather than by Z- "distance from camera position").

Otherwise, I think it's good plan, I like using shaders for processing images like that.

avatar image kevin0228ca Glurth · Dec 16, 2016 at 01:03 AM 0
Share

Hi, thanks for your response. I also considered about z-ordering. If I understand you correctly, you mean setting the clear flag of the game cameras ABC to depth only, then setting the z-ordering of each camera so they render overlay each other. The question I had about this approach is that it seems it will be rendering the whole view by each camera, but sometimes I want to render part, e.g. only render leftmost 50% of cameraB to overlay cameraA, so what is seen is left 50% of viewport is leftmost 50% of B and right 50% is 50% of A. I wonder if this can be done by only changing the z-order. And thanks for ensuring that shaders is a good approach.

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity crashes - multiple cameras with image effects and fade to black 0 Answers

blending colors on a texture: shader, render texture, or other 2 Answers

U.I. rendering multiple cameras in VR 2 Answers

RenderTexture Painting - color blending issues 1 Answer

RenderTexture of VR output in 5.4 beta 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