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
1
Question by felixwcf85 · May 21, 2015 at 08:05 AM · texturescubemap

How to change texture type to Cubemap in script?

My app will download stereoscopic images(.jpg) from server, and convert them into cubemap, applied to material and used as skybox.

How do I achieve in script?

AssetImporter can only be reached from UnityEditor.

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
0

Answer by FortisVenaliter · May 21, 2015 at 04:51 PM

You'll need to find a way to read in the JPG into a Color[] and then use SetPixels() on a new cubemap.

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 felixwcf85 · May 22, 2015 at 02:36 AM 0
Share

It seems like the "Cubemap" that you mentioned is not the one I'm looking for.

For example, when we import image and convert to texture, we can select what is the 'Texture Type' of the texture in the inspector of the Unity Editor: e.g Normal $$anonymous$$ap, Lightmap, Sprite...

and then we can change the settings based on the Texture Type that we choose..

The only way to do it by script is using AssetImporter, which can only be executed in Unity Editor but not in app.

Seems like the only solution is to use AssetBundles.

avatar image
0

Answer by Bunny83 · May 22, 2015 at 03:03 AM

A cubemap is simply a collection of 6 textures. To create a cubemap at runtime you simply use the Cubemap-class like FortisVenaliter mentioned.

The "import type" you're referring to is an editor-only feature. At runtime none of the asset importers are available. So all those "settings" you see in the inspector belong to the AssetImporter and don't exist at all at runtime.

If you import an image in the editor, Unity actually splits / extracts those 6 images from the incomming texture data. Take a look at this.

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 Yum1ng · Jul 28, 2016 at 01:20 PM

Hi, I am having the same problem. How did you resolve this? @felixwcf

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 Rajawat · Dec 21, 2016 at 07:51 AM 0
Share

@felixwcf - If you have any solution can you post it here. I am also facing the same issue.

avatar image Karsnen_2 · Feb 07, 2017 at 04:04 AM 0
Share

Even I need a solution for this. Have search all over internet to find none.

I found editor way of doing it thro' this post in medium.

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

23 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

Related Questions

Blit onto or otherwise edit a cylindrical-mapped cubemap 0 Answers

How does one serialize a Cubemap texture?? 0 Answers

Sprites compression question (their size in build) 2 Answers

Texture lighting and seam issues 1 Answer

(C#) change texture and shadow resolution 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