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
1
Question by Rook3D · Oct 03, 2011 at 10:49 AM · textureshadersblendervertex color

Texture blending Shader using Vertex Coloring with Blender Model

Hi there, I'm trying to set up Texture blending using Vertex coloring with a Blender model ( to blend different texture edges ).

I have done some research on this and come across a few posts describing some of the solutions and some of the problems.

One of the problems seems to be Blender only exporting Vertex Colors using RGB, not RGBA ( if I have understood correctly ) - as mentioned by Jessy in this Post:

http://forum.unity3d.com/threads/15444-fbx-import-messes-up-vertex-colors?p=229027&viewfull=1#post229027

I've tried running that Python script without success, it's from 2009 though so...

I've also come across some shaders posted by Jessy here for blending Texture using Vertex colors :

http://forum.unity3d.com/threads/44749-Vertex-Paint

I've tried both RGB & RGBA versions - the RGB version seems to almost work, but not quite :

It seems to only get a part of the texture color, not the entire texture.

Jessy seems to be the expert on this, so maybe he's around? - if not maybe someone else has encountered this and worked it out.

It seems that the best approach is to convert Blender's exported RGB over to RGBA somehow, and use the better RGBA shader... but I'm no expert.

Also, while we're here, I have a few additional questions about this approach :

  • Are there any lighting or other graphical issues?

  • Is the performance comparable with just using - say a diffuse shader with 2 materials?

  • any other drawbacks / complications?

Thanks for any help.

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 Rook3D · Oct 04, 2011 at 06:02 AM

So, with further research, I've manage to solve the first issue - which is how to get Blender to export a customizable Alpha value for the vertex colors.

This involves modifying the 'export_fbx.py' ( C:\Program Files (x86)\Blender\2.58\scripts\addons\io_scene_fbx\ ):

Replace the existing code block ( search on the first line ), with the one below ( please note - back up the 'export_fbx.py' file beforehand ):

             for col in colors:
                 fakeAlpha = (col[0]+col[1]+col[2]) / 3
                 if i == -1:
                     file.write('%.4f,%.4f,%.4f,%.4f' % (col[0],col[1],col[2],fakeAlpha))
                     i = 0
                 else:
                     if i == 7:
                         file.write('\n\t\t\t\t')
                         i = 0
                     file.write(',%.4f,%.4f,%.4f,%.4f' % (col[0],col[1],col[2],fakeAlpha))
                 i += 1
                 ii += 1  # One more Color


This just sets the Alpha value to an average of the RGB color intensities, so you can just use grayscale painting really.

( Nb: Blender invokes this export script, so it will work just by re-saving the .blend file )

BUT - now I'm back to same issue as I had with the RGB shader, in the using the RGBA shader, comes up with the same lack of texture - it only seems to use the FIRST color of each of the two textures to colorize the entire object.

I'm thinking maybe there is a texture import setting I don't know about...

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 Rook3D · Oct 14, 2011 at 12:32 AM

For anyone else interested in this :

Vertex Alpha for Texture Blending

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

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

Getting a detailed procedural texture in Blender to look the same in Unity 2 Answers

Two-sided Objects from Blender to Unity3d 2 Answers

Trouble with UV Mapping Blender => Unity 3 1 Answer

Blender to Unity texturing problems 1 Answer

Vertex Color Shader Non Linear Blending 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