Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 MarkenhXu · Apr 30, 2020 at 01:11 AM · graphicsblit

Graphics.blit 3 texture

Hi guys

I am very puzzled.

Set up this code in an empty scene. and set up the scene similar to the screen shot. so 3 camera each can only see 1 object. and each camera will render what it sees to a rawImage. the expect result is raw image 1 sees the cube, raw imge 2 sees the cube and the sphere and raw image 3 sees cube sphere and capsule. but image 3 is where it gets weird. it sees cube and capsule instead.

     [SerializeField] Camera CameraA;
     [SerializeField] Camera CameraB;
     [SerializeField] Camera CameraC;
 
     [SerializeField] RenderTexture textureA;
     [SerializeField] RenderTexture textureB;
     [SerializeField] RenderTexture textureC;
 
     [SerializeField] RawImage rawImageA;
     [SerializeField] RawImage rawImageB;
     [SerializeField] RawImage rawImageC;
 
     private void Start()
     {
         textureA = new RenderTexture(CameraA.pixelWidth, CameraA.pixelWidth, 1);
         textureB = new RenderTexture(CameraB.pixelWidth, CameraB.pixelWidth, 2);
         textureC = new RenderTexture(CameraC.pixelWidth, CameraC.pixelWidth, 3);
 
         CameraA.targetTexture = textureA;
         CameraB.targetTexture = textureB;
         CameraC.targetTexture = textureC;
 
         rawImageA.texture = textureA;
         rawImageB.texture = textureB;
         rawImageC.texture = textureC;
     }
 
     // Update is called once per frame
     void Update()
     {
         Graphics.Blit(textureA, textureB);
         Graphics.Blit(textureB, textureC);
     }

alt text

screen-shot-2020-04-29-at-60500-pm.png (52.7 kB)
screen-shot-2020-04-29-at-60553-pm.png (27.9 kB)
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
0

Answer by Bunny83 · Apr 30, 2020 at 10:34 AM

We have no idea what the clear flags of your 3 cameras look like. Since you have a solid background we can assume that at least one camera is clearing the background with a solid color. We also don't know how large the area of the 3 cameras are and if they render to the full screen / rendertexture or only a part of it. Graphics.Blit will copy the entire content of the first texture ontop of the second texture.


It's also not clear if you used a layer mask for any of your cameras / objects. Though what is the most disurbing is that you use a 1 bit depth buffer for the first rendertexture, a 2 bit depth buffer for the second and a 3 bit depth buffer for the 3rd. Note that only depth buffers values of 0, 16 or 24 are actually supported.

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 MarkenhXu · Apr 30, 2020 at 05:05 PM 0
Share

I thought the depth is like an order. ok let me try. but what would be the correct settings needed to get the images to show up as expected. The background is actually an image. all three camera are depth only clear flag.

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

141 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 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

How to (efficiently) make an image pixelated? 3 Answers

URP Blit Material Renderer Feature - Breaks the Inspector Asset Preview Window 0 Answers

Change the camera RenderTexture before rendering it to screen? 1 Answer

Manual Graphics.Blit 3 Answers

Blit into Texture2DArray slice not working in WebGL 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