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 robincornelius · Aug 06, 2011 at 02:53 PM · importmaterialscollada

Collada import material Main Colors

I'm importing some trivial test cases of collada in to Unity 3.4 and finding an issue with the material generation. My test scene has some simple cubes with two textures on them. Unity loads these textures in fine but the Main color it assigns to the material seems random and on large imports its quite often (0,0,0) and this is blended with the texture making the entire scene black. On the test cubes the Main color is (204,204,204) but i've seen other values as if its a wild internal variable.

Now the really interesting thing is, if i hack the collada to generate a phong diffuse color AND texture on the same material it works and i can control the material color with the tag and the texture works as expected two and they blend as expected. The problem is this is not valid collada and other collada importers do not like this and fail to display textures and materials etc.

So with a partial example the following is correct collada but results in a seemingly random Main Material color

      <phong>
         <emission>
           <color>0 0 0 1</color>
         </emission>
         <ambient>
           <color>0 0 0 1</color>
         </ambient>
         <diffuse>
           <texture texture="tex-89556747-24cb-43e-sampler" texcoord="CHANNEL1"/>
         </diffuse>
         <specular>
           <color>0 0 0 1</color>
         </specular>
         <shininess>
           <float>0</float>
         </shininess>
         <index_of_refraction>
           <float>1</float>
         </index_of_refraction>
       </phong>


Where as if we break the collada spec and do (note the extra color on the diffuse) :-

      <phong>
         <emission>
           <color>0 0 0 1</color>
         </emission>
         <ambient>
           <color>0 0 0 1</color>
         </ambient>
         <diffuse>
           <texture texture="tex-89556747-24cb-43e-sampler" texcoord="CHANNEL1"/>
           <color>1 1 1 1</color>
         </diffuse>
         <specular>
           <color>0 0 0 1</color>
         </specular>
         <shininess>
           <float>0</float>
         </shininess>
         <index_of_refraction>
           <float>1</float>
         </index_of_refraction>
       </phong>

Unity is very happy with it.

So, is there any other way to set this Material Base Color when importing, doing it by hand is not a real option as this process may be repeated for hundreds of materials on many scenes. But i wonder if there is some other collada field that unity uses.

It appears this is a bug in the importer and that unity is looking always for a diffuse color and if it is actually a texture this value becomes wild and can be anything from 0 - 255. If this is a bug it would be nice to fix it by defaulting the color to 255 and still accepting this invalid collada as its actually quite helpful to be able to tint textures this way from the collada.

I can send/paste some complete trivial collada examples if anyone would like them to test

Many thanks

Robin

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

0 Replies

· Add your reply
  • Sort: 

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

Collada Import and shared materails 2 Answers

COLLADA import with textures 3 Answers

Updating UV in imported mesh without having to re-material 0 Answers

Importing meshes with materials or assigning in unity 1 Answer

unity 2020 preserve full collada names 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