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 JeffreyBennett · May 11, 2021 at 07:37 AM · skyboxskyboxessky

HDRP Rotate Skybox in Time DeltaTime

This should be simple, and every time I cannot find anyone addressing my question it means I'm overlooking something everyone else thinks is obvious.

Working in Unity 2020.3 High Definition Render Pipeline

Turn on Project Settings in Edit > Project Settings Then, in **Project Settings > HDRP Default Settings > HDRI Sky (checked) > HDRI Sk**y is using a cubemap for a skybox dragged from the Assets folder into the slot in the Settings Panel.

Below that are some settings: - Enable Distortion (unchecked) - Intensity Mode - Exposure - ROTATION <--- Can I animate this? If I can then I could slowly rotate my skybox in the game, right?

Just below Rotation are Update Mode and Update Period which don't appear to do anything as far as I can tell.

How can I animate the Skybox with a slow rotation?

I've tried the following script, added as a component to an empty game object in the hierarchy, which again does nothing as far as I can tell:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class RotateSky : MonoBehaviour
 {
     public float speed_Multiplier = 0.01f;
     
     // Start is called before the first frame update
     void Start()
     {
         
     }
 
     // Update is called once per frame
     void Update()
     {
         RenderSettings.skybox.SetFloat("_Rotation", Time.time * speed_Multiplier);
         //To set the speed, just multiply Time.time with whatever amount you want in the speed multiplier.
     }
 }







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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Koyemsi · May 11, 2021 at 11:20 AM

You can try this :

using UnityEngine;
public class SkyAnim : MonoBehaviour { public Material skyboxMat; float rot = 0f;
void Update() { skyboxMat.SetFloat("_Rotation", rot); rot += Time.deltaTime * 10f; } }

Please note that I used a 6-sided skybox for this, because I had no cubemap to play with, but I assume it will work the same.

Comment
Add comment · 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
0

Answer by JeffreyBennett · May 11, 2021 at 01:06 PM

That probably would work if you have a material for your skybox. In the HDRP you don't use a material for the skybox, and you don't attach it to the camera or anything like that.

In the HDRP the Project Settings accepts your cube map, not really a material, and uses that for the Skybox. In fact, I have no idea how you change the skybox from one scene to the next, or in a new volume or anything, because the project settings are at the project level and seem to be global for the whole project. HDRP is weird that way!

So your script, I don't know where it gets the material from to animate. And also I don't know what to attach it to. Your public variable skyboxMat would logically point to the skybox cubemap that is in the Project Settings, but there is no way I can see to refer up to the map in the project settings. You cannot, for example, drag and drop the project settings panel into the public variable in the Inspector.

Thanks for the attempt @Koyemsi , but it looks as if I still have a lot of work to do to figure this out.

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 Koyemsi · May 11, 2021 at 01:10 PM 0
Share

You're welcome. Actually I never used the HDRP, so I wasn't aware of these particularities. Sorry I couldn't help, wishing you good luck.

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

119 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

Related Questions

Unity 5 procedural skybox with working bottom 1 Answer

creating skybox material problem 1 Answer

Changing skyboxes? 1 Answer

Skybox uses 1.7k Tris and 5.0k Verts even if occluded? 1 Answer

Custom procedural skybox 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