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 Pierre 1 · Nov 21, 2011 at 12:05 PM · shaderskyboxblend

Skybox blending

Hello ! I am trying to use this shader to have a transition between 2 skyboxes: http://www.unifycommunity.com/wiki/index.php?title=SkyboxBlended

However, I must admit I am quite a rookie with Unity and shaders. I don't really understand how to use it.

I created the shader in my Project, copied what was written but...

  • What should I modify in the shader code ? _FrontTex ("Front (+Z)", 2D) = "white" {} : should I replace white or Front (+Z) with my material name ?

  • Should I now apply the shader on some material ? How ?

  • How can I move the "blend" and how can I do this from a script ? skyboxmaterial.SetFloat("_Blend", yourBlend) <= Skybox.material exists, but I don't think this is what is required, considering the SetFloat.

Well, if one could give me an example of how I can use this, he would be most welcome :)

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

3 Replies

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

Answer by DaveA · Nov 21, 2011 at 09:04 PM

Are you trying to modify the shader or use it as-is?

I have not tried it in 3.4, but in theory, you put it on a material, it should let you drop 12 textures on it in the Inspector (6 for one box, 6 for the other), and have a slider that lets you set the blend amount.

Comment
Add comment · Show 2 · 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 Pierre 1 · Nov 22, 2011 at 05:56 AM 0
Share

Ok thank you, that was very simple indeed ^^ I did not really understand the principle of shader, that's why I had troubles.

I'll try to figure out by myselft how to change the blend from a script.

avatar image bentoBAUX · Jan 13, 2019 at 01:58 AM 0
Share

How do we make it blend dynamically in the game itself like a day/night cycle through script?

avatar image
2

Answer by bentoBAUX · Jan 13, 2019 at 02:15 AM

You can refer to: https://www.youtube.com/watch?v=aAtzPTWxEtw for the skybox set up.

The scripting for the blending part is: alt text

  1. Create an empty game object.

  2. Reset its position (0,0,0) [optional]

  3. Drag your Skybox material from the folder where your shader, textures and skybox material is and into the empty material section in the empty game object's inspector.

  4. You are good to go!

alt text


screenshot-57.png (429.2 kB)
screenshot-54.png (68.8 kB)
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 ChunkyToads · Feb 14, 2020 at 06:00 PM 1
Share

@bentoBAUX Searched all over the place for this. Thanks for the clear instructions and screenshots.. endlessly helpful and kind :)

avatar image
0

Answer by Hyvemind · Jan 17, 2012 at 11:01 AM

Can we try setting up three skyboxes using this method? If so what changes will i need to make to the code?

Comment
Add comment · Show 3 · 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 Pierre 1 · Jan 17, 2012 at 12:14 PM 0
Share

I guess that you can change the texture used by the skybox shader.

For example, you have a day skybox that you blend with a dusk skybox. When the dusk is fully visible, you just change the day skybox textures with night textures, and blend back to this one.

If you want to blend 3 textures at the same time, then yes, you need to modify the code, and for this I can't help you.

Anyway, you should ask your question normally, with the ask a question button top right, as nobody will be noticed of your question here except me.

avatar image Pierre 1 · Jan 18, 2012 at 10:58 AM 0
Share

PUNJAAABI !!!!!

avatar image Hyvemind · Jan 18, 2012 at 04:25 PM 0
Share

POOOOONJAAABI!! :D

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

Shader Blending Question 1 Answer

Unity 5 Skybox not Rotating 3 Answers

Represent Land 3D Area End 0 Answers

Decal Alpha Blend 0 Answers

Errors with ENDCG in shaders 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