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
2
Question by cupsster · Jan 08, 2011 at 07:24 PM · runtimenormalmapbumpmap

Normalmap/bumpmap on runtime from www.texture?

Please can anyone enlight me if this is possible? I would like to generate normal map from downloaded texture to minimize bandwidth usage. I know that generating from diffuse texture is quality compromise but I can live with that..

I solved MIPMAP generation already. Source:unitianswers

var www:WWW = new WWW (url);
yield www;
Debug.Log("Converting to MIPMAPS");
var tex1 = www.texture; 
var tex2 = new Texture2D(tex1.width, tex1.height); 
tex2.SetPixels(tex1.GetPixels()); 
tex2.Apply(true);
Debug.Log("Converting DONE");

Searching forums was no help. Doc's neither.

Anyone solved this? SEARCHING FOR NORMALMAP FROM DIFFUSE

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 Eric5h5 · Jan 08, 2011 at 08:25 PM

You don't need to use GetPixels/SetPixels like that to make mipmaps; just create a texture first and then use LoadImageIntoTexture. There isn't any quality compromise, unless you're using jpeg instead of png. And yes, a normalmap is a texture like any other texture, so it's possible. I don't see how this is "minimizing bandwidth usage" though.

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 cupsster · Jan 08, 2011 at 08:38 PM 0
Share

Hi Eric, I want to create normal map like in editor from downloaded color[diffuse] texture. Hence bandwith saving. Cause it is 300+ textures I want to make normal map on the fly from downloaded data.. Not to download separate normal map after diffuse is my goal. Should be easy but I need to point in right direction.

avatar image Eric5h5 · Jan 08, 2011 at 10:59 PM 0
Share

I see...I thought you were talking about downloading normal maps.

avatar image cupsster · Jan 08, 2011 at 11:30 PM 0
Share

nope, that is way to easy :)

avatar image
0

Answer by Noise crime · Jan 08, 2011 at 10:45 PM

There are shaders that can create a normal map from a diffuse texture map, from memory there is one in AMD(ATI) RenderMonkey, but sure you can find plenty of other examples online.

So one method (I guess you need Unity Pro for this though), is to use the shader with renderToTexture to generate your normal mapped textures at runtime. This should be very fast compared to get/set pixel.

Alternatively you can use get/set pixel and simply convert the shader code into javascript/c#.

Edit: You might find this page useful for obtaining better quality normalmap data.

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 cupsster · Jan 08, 2011 at 11:32 PM 0
Share

Thank You. Yep know that link I will try to find suitable shader to converting to javascript.. If you already know about such one can post link here for speed up.

avatar image Noise crime · Jan 09, 2011 at 12:04 AM 0
Share

As I mentioned I'm pretty sure A$$anonymous$$D/ATI Render$$anonymous$$onkey has a normalmap generation script in it, used it myself in the past. Rendermonkey is a free shader editor released by ATI, well worth having around I$$anonymous$$HO.

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

No one has followed this question yet.

Related Questions

Importing and configuring Normal Maps at runtime ? 2 Answers

Normals on procedural mesh 0 Answers

export normal texture at runtime 2 Answers

Bumped Lightmapped not working? 1 Answer

Bump mapping procedural mesh. 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