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 BigDakaFa7 · Aug 22, 2014 at 07:34 PM · importimageresolution

How to import a high resolution Image file

Ok so i have been having a problem with unitys auto compression for files with the pixel size higher than 1089 x 4096. I am trying to import a image that is going to be used as the 2d ground and its pixel size is 4800 x 18048. Everytime i import this image it auto compresses and looks horrible. My question is, is there a way to import image files of any size and bypass the auto compression because i need this to work so my map looks the way it was intended to look. Thankyou

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
0

Answer by robertbu · Aug 22, 2014 at 07:39 PM

The WWW class will load files bigger than 4K. While I've not specifically tested this scenario (I'm away from my desktop), you should be able to put the file in StreamingAssets folder:

http://docs.unity3d.com/Manual/StreamingAssets.html

You will use the 'file://' protocol. This should work in mobile and desktop, but I doubt it will work on a web build. For a web build, you can pull it off the server.

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 BigDakaFa7 · Aug 25, 2014 at 10:43 PM 0
Share

So how do i import this assest and apply it to a game object that is the same size i said earlier for the img. Because im at a loss on how to use the strea$$anonymous$$g folder

avatar image robertbu · Aug 26, 2014 at 04:22 AM 0
Share

Ultimately you need to thrash around and figure things out, but I'll give you a recipe and a bit of code to get you started:

  • Create a Assets/Strea$$anonymous$$g Assets folder

  • Put a large image in the folder. $$anonymous$$ine image was named 'LargeImage.jpg' and was 5000 x 1000.

  • Crate a Quad (GameObject > Create Other > Quad). Size the quad as appropriate. Using the aspect ratio of the image to be loaded is best.

  • Create a material for the Quad. I used Unlit/Texture for the shader and had the texture set to 'none'.

  • Attach the following script to the Quad


    pragma strict

    function Start() { var path = "file://"+Application.dataPath+"/Strea$$anonymous$$g Assets/"+"LargeImage.jpg";

       var www = new WWW(path);
         yield www;
         if (!String.IsNullOrEmpty(www.error)) {
             Debug.Log(www.error);
             return;
         }
         renderer.material.mainTexture = www.texture;
     }
    
    

The path specifier will vary some from platform to platform. You can get most of that from the reference page for Strea$$anonymous$$g Assets. The path above was tested in the Editor on a PC.

There are other ways of doing the load. For example, rather than yielding, you can do a while(!www.isDone) loop. Your app will hang until the load, but the load will be faster. It all depends on how you need to structure your code. There is also a WWW.LoadImageIntoTexture() function that can be useful for certain kinds of setups.

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

2 People are following this question.

avatar image avatar image

Related Questions

Image resolution wrong on import, how to fix? 1 Answer

A node in a childnode? 1 Answer

unity font error 2 Answers

unity 3.5.1 import more that diffuse texture from 3ds Max ? 1 Answer

How come my 3DS Max files are not being crated through drag-and-drop? 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