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 MD_Reptile · Sep 08, 2013 at 03:48 AM · renderingtexture2dtransparencyalphagraphics.drawtexture

Using two fullscreen Graphics.DrawTexture images, overlapping?

I am using two textures, one for terrain, one for the sky, and I want the sky behind the terrain... and I googled this pretty hard before coming here, but I am finding little help in this department...

I tried having a regular unity standard skybox, but the graphics.drawtexture for the terrain seems to not show the skybox behind it (even though some pixels are 0 alpha...it is just black on those pixels? that bugged me, but ultimately I want two "pixelated" textures rather than a whole skybox, so dont worry about that)

I also tried two cameras, main with its script drawing "terrain" with transparent upper half, secondary with its script drawing "sky" texture2d, but changing depth makes no difference... the sky texture seems to always appear on top regardless of which had higher depth.

Is it possible to draw two seperate graphics.drawtexture's with one of them "on top of" the other graphics.drawtexture?

if not, I suppose it would be possible to combine the images, but would have to be constantly updated with terrain being broken up, so a comparison of two pixels arrays which then combine, after iterating through every pixel, every frame... it just sounds like bad news... two seperate textures are sorta what I require...

Comment
Add comment · Show 3
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 Sajidfarooq · Sep 08, 2013 at 08:09 AM 1
Share

Im a bit confused. Are you doing this via code? I.e, are you using the Graphics.DrawTextures? Why not do this without code, directly using cameras and modifying the clear-colour and render-order?

avatar image fherbst · Sep 08, 2013 at 08:13 AM 0
Share

What do you want to achieve eventually?

avatar image MD_Reptile · Sep 10, 2013 at 05:16 AM 0
Share

well you can visit my forum topic here:

http://forum.unity3d.com/threads/198919-Destructible-Pixel-Terrain-Open-Source

and see the project this problem pertains to. I found a solution I think, but I have to test more to see if it will work - I had my texture settings messed up maybe, because setting format to RGBA 32 bit (rather than previous automatic truecolor) allows me to see a regular skybox in the back, so in that case I should be able to do the multiple camera method...maybe... havent had time to check this problem because I been so busy squashing other problems with this project haha

1 Reply

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

Answer by fherbst · Sep 08, 2013 at 08:08 AM

I would just create two camera-aligned quads with different textures.

Comment
Add comment · Show 6 · 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 Sajidfarooq · Sep 08, 2013 at 08:28 AM 0
Share

I would prefer using two cameras. I dislike having stuff in my scene when they are only meant to be background...

avatar image fherbst · Sep 08, 2013 at 08:46 AM 0
Share

Of course, that's personal preference :)

avatar image MD_Reptile · Sep 10, 2013 at 05:17 AM 0
Share

I might end up doing something similar to this, see my comment above ^

avatar image MD_Reptile · Sep 10, 2013 at 11:02 PM 0
Share

I sort of found my solution - but not exactly like I expected to... I ended up drawing the terrain with the main camera and Graphics.DrawTexture, however the sky is drawn on another camera, as a GUITexture... but with the right settings on the image for DrawTexture, it does show transparency, and you can see the background behind... so I will accept your answer felix.

avatar image Sajidfarooq · Sep 11, 2013 at 04:36 AM 1
Share

Yup, two camera approach as I mentioned.

Show more comments

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

17 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

Related Questions

How do I blend a transparent texture with an opaque one? 2 Answers

Fading in/out SVGs without showing the half-transparent SVG-layers 1 Answer

Render part of object with alpha of other object 1 Answer

Unity 4.6 and Grabpass fails 1 Answer

How to make transparent only colliding part of object? 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