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 BHS · May 12, 2012 at 12:10 AM · renderingqueueskyboxesmoon

Using a Moon with a Skybox, Queue Problem (Pics)

Hi,

We have ran into a little problem. We are developing a weather system and are done with everything. We have one problem though, we switched from a solid color background to a blended skybox We are having issues with the shader working properly with the skybox and fog.

What's happening is that the when we don't disable the fog through the shader the moon looks good, but renders over the clouds, resulting in an unrealistic effect. If we disable the fog through the shader it causes the moon texture to just be the plane shape of the moon rather than showing the texture of the moon itself, but it renders behind the clouds. Only problem is that it doesn't look good and that's where the problem is.

How can we have the texture look good without being washed out from the fog and have it render behind the clouds?

We have used many different queues and cannot find the source of the problem. I think it's a combination of both using a skybox and using fog. How can we get this working? We had it working before we supported skyboxes and Unity's fog.

We took some screens to give you guys a visual of what's happening. Please if anyone can help us out it would be very much appreciated. Thanks!

alt text alt text

RendersInFrontButLooksGood.png (100.1 kB)
RendersBehindWashedOut.png (89.2 kB)
Comment
Add comment · Show 8
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 BHS · May 12, 2012 at 03:30 AM 0
Share

I'm willing to do the work I just don't understand why the above is happening. Even if someone could just point me in the right direction it would be very helpful.

avatar image BHS · May 12, 2012 at 03:59 AM 0
Share

Okay update, I read somewhere that you can have 2 cameras to render different things. Could I not have a separate camera that renders the moon. Example the moon shader will ignore fog and the camera rendering the moon will have solid colors turned on. I did this with one camera and it worked. Could I not keep my skyboxes but do what I explained above using 2 cameras?

If so, how do you go about having 2 separate cameras rendering different things?

avatar image aldonaletto · May 12, 2012 at 04:34 AM 0
Share

Is this skybox the camera background? And what is the moon? A plane?

avatar image BHS · May 12, 2012 at 05:30 AM 0
Share

Yes and yes, the moon is a plane with the moon texture.

avatar image syclamoth · May 12, 2012 at 05:55 AM 0
Share

How exactly do the clouds work? Are they static?

Show more comments

1 Reply

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

Answer by aldonaletto · May 14, 2012 at 01:29 AM

The skybox background is actually the number one in the queue: the screen is cleared with it, thus everything else will be rendered over it. To draw something behind the clouds, the only solution is to use the skybox alpha channel to show the transparent areas - it's 1 at open sky, and 0 at the clouds (the Eerie Sky in the Standard Assets/Skyboxes folder has this characteristic).
The simple shader below (moon material) uses the skybox alpha channel to control its own alpha, and gave this result:

alt text

Shader "RenderFX/Behind Clouds" {
   Properties {
        _MainTex ("MainTexture", 2D) = "black" {}
    }
    SubShader {
        Tags { "Queue" = "Transparent" }
        Fog { Mode Off }
        Pass {
            Blend DstAlpha One
            SetTexture [_MainTex] { combine texture }
        }
    }
}
The moon became somewhat blueish, perhaps because the alpha values for the skybox were lower than 1.
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 BHS · May 14, 2012 at 03:25 AM 0
Share

Thank you for this, it didn't work in my case, but I'm sure it would have if you were using a regular non-blended skybox. You did however make me see a mistake I made allowing me to fix the problem. I changed the queue rendering process through script before hand for another reason which I fixed and I had forgot the script was still attached. I'm sure this will help other though, thank you for the help.

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

7 People are following this question.

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

Related Questions

(HELP) Volume Ray Marching rendered always on top of the other objects 2 Answers

Why shadows disappear with HDRI skybox, even directional light is on ? 0 Answers

Having trouble getting objects to render in the background 0 Answers

Strange hang on load with skybox. 2 Answers

Transparency shader that also writes to Camera Depth Texture 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