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 Macro · Sep 03, 2015 at 10:16 AM · unity5skyboxcubemap

Dynamically setting cubemap for shader skybox/cubemap in unity 5

I wont bore you with the scenario but I am trying to dynamically create a skybox based upon the scene.

So I put a camera in the center render it out to a cubemap using RenderCubeMap then create a new Material using the skybox/cubemap shader. This all seems to work but I cannot figure out how to set the actual cubemap texture, I have tried using materialSetTexture("_Cube", myCubemap) tried changing the name to "Cubemap" tried setting the mainTexture even tried to use the index based method passing in 0, just nothing ever seems to show up in the texture for the material thats been created.

I cannot find any documentation on what the shaders vars are, other than the unity default _Cube name, so am I doing anything obvious which is wrong? if not can anyone confirm if the texture name in the shader.

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

1 Reply

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

Answer by nikpundik · Sep 03, 2015 at 02:37 PM

Hi @Macro, try with _Tex

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 Macro · Sep 03, 2015 at 06:58 PM 0
Share

Thanks, this solves it!

avatar image Macro · Sep 03, 2015 at 09:01 PM 1
Share

Although this now adds the texture it only seems to render 1 side of it, I have tried passing in 63 as the face$$anonymous$$ask, but was leaving it as default too, have even tried using RenderTexture as the container (with isCubemap) rather than a direct Cube$$anonymous$$ap, still no luck :(

Upon further investigation if I set dont clear it does seem to be outputting everything, but I am not sure if it is somehow just culling everyone off the screen or something when it does the renderToCubemap...

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

28 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

Related Questions

Having static objects in scene disables skybox reflections. 0 Answers

Failed to find compatible Skybox shader 1 Answer

Skyboxes missing from standard assets in unity 5 3 Answers

Download 6 textures from the web, create a cubemap and set it as skybox in runtime 0 Answers

Calculating position of projected object in reflection 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