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 mokus · Feb 20, 2017 at 07:37 PM · texturegraphicsrendertexturedepth buffer

Graphics.CopyTexture not working?

Hello, I need to combine multiple depth textures into one atlas. I'm trying to achieve that using Graphics.CopyTexture. It's not working for me, so I decided to simplify my code and here are my results:

When I'm using Graphics.CopyTexture(_depthCamera.DepthTexture, _depthCombinedTexture); It works fine, but obviously it's useless in my case

When I'm trying to make a copy using: Graphics.CopyTexture(_depthCamera.DepthTexture, 0, 0, 0, 0, _depthCamera.DepthTexture.width, _depthCamera.DepthTexture.height, _depthCombinedTexture, 0, 0, 0, 0); it has to do the same, but it does nothing. Textures are the same (the same size too).

I've checked SystemInfo.copyTextureSupport for my hardware - all options are available. What am I doing wrong or should I use any other option to combine textures?

Comment
Add comment · Show 7
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 RobAnthem · Feb 20, 2017 at 08:31 PM 0
Share

I've never used the CopyTexture method, but you could always swap the pixels.

 Color[] colors = myTexture.GetPixels();
 myOtherTexture.SetPixels(colors);
avatar image mokus RobAnthem · Feb 20, 2017 at 08:41 PM 1
Share

I didn't mention - it's for RenderTexture, so unfortunately GetPixels/SetPixels is not an option.

avatar image Bunny83 · Feb 20, 2017 at 09:45 PM 0
Share

What's your target platform and Texture type(s)? CopyTexture seem to have additional restrictions based on the format as you can read in the documentation

What exactly is "_depthCombinedTexture"? I guess it's also a RenderTexture? Does it have the RenderTextureFormat "Depth"?

I barely used RenderTextures so i can't say much about it's limitations ^^. Just to be sure: You said you checked SystemInfo.copyTextureSupport. What numerical value does it have? "31" / "0x1F" or something else?

avatar image mokus Bunny83 · Feb 20, 2017 at 09:49 PM 1
Share

$$anonymous$$y target platform is PC. _depthCombinedTexture is also a RenderTexture with the same format as _depthCamera.DepthTexture - both are depth textures. And just for testing I've also made them the same size (256x256).

And copyTextureSupport == 31

avatar image Bunny83 mokus · Feb 20, 2017 at 10:45 PM 0
Share

Wow, i think that's the first time someone answers all my counter-questions in one go. $$anonymous$$ost seem to only read the first or the last question ^^. Unfortunately that means we ruled out most potential issues and i have no idea what else might be the problem. $$anonymous$$y only other guess would be that the method might expect some odd parameter "ranges" for srcElement, src$$anonymous$$ip, dstElement, dst$$anonymous$$ip, though it's unlikely. $$anonymous$$aybe the method has trouble to apply those parameters to textures that don't have multiple layers / slices or mip levels.

I guess your best option is to contact the support. Either via the contact page or by filing a bug report with a repro-case. The bug-report is most likely the better option. If you have the time you could setup a seperate project that reproduces the problem and write a detailed description of the problem. Bug reports usually get the most attention and they are easier for the support to verify / check. Bug reports also contain your hardware and OS specs which makes it easier to find edge-case problems.

ps: Have you tried creating a build of your application? Sometimes there are strange limitations inside the editor but i doubt this is the case here.

Show more comments

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

6 People are following this question.

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

Related Questions

Graphics.CopyTexture not working 1 Answer

Alternative for Graphics.CopyTexture() ? 2 Answers

Best way to convert particles and sprites in a single sprite at runTime 1 Answer

ReadPixels returns RGBA(0,0,0,0) 0 Answers

Texture missing data 1 Answer


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