• 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 r_chevallier · Apr 24, 2020 at 04:34 PM · renderingvertex shadervertex colorlinear

Probuilder Vertex Colors do not match Vertex Palette colors in Linear rendering.

Hello,

Probuilder vetex colors on my game object do not match the color selected from Probuilder color palette. I am using Linear renedering. I understand t$$anonymous$$s color accuracy is an issue with Linear rendering and vertex colors.

Is there a shader for Probuilder to correct t$$anonymous$$s? The shader I am using is Probuilder/DiffuseVetexColor.

Any help would be appreciated, Raymond

Comment
Add comment · Show 1
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 Why485 · Jul 07, 2020 at 01:11 AM 0
Share

I'm seeing the same thing. I'm using linear color space, and the results of vertex coloring match what happens when I have my own shaders, but don't append .linearwhen I send the color to the shader. I'm also using the Universal Render Pipeline.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Why485 · Jul 07, 2020 at 02:45 PM

ProBuilder should fix t$$anonymous$$s themselves, because it's IMO an oversight that it does not apply vertex colors correctly when using the linear color space. Vertex colors aren't gamma corrected when in linear color space. If you are creating your own vertex colors in your own meshes, you solve t$$anonymous$$s by using the .linear property on the color when you set the vertex color.

T$$anonymous$$s is a simple one (technically two) line fix in the Probuilder source code. Goto the file Editor\EditorCore\VertexColorPalette.cs and change lines 182 and 194 from t$$anonymous$$s:

colors[i] = col;

To t$$anonymous$$s:

colors[i] = PlayerSettings.colorSpace == ColorSpace.Linear ? col.linear : col;

T$$anonymous$$s new code will make it so that if you are in linear color space, it will apply the correct gamma correction to the vertex. T$$anonymous$$s will not however update any previously assigned vertex colors. You would have to go in and re-assign all the vertex colors yourself, or create some script that will take the current vertex color and then convert it to a linear color. Neither are great solutions, unfortunately.

Another alternative is to write a shader w$$anonymous$$ch automatically gamma corrects the vertex colors based on the assumption that vertex colors are always in the gamma color space. T$$anonymous$$s would retroactively fix any colors you apply. See t$$anonymous$$s thread for the function to call in the shader world to convert the colors.

EDIT: T$$anonymous$$s has been recognized in a ProBuilder thread. https://forum.unity.com/threads/probuilder-applying-incorrect-vertex-colors-when-using-linear-colorspace.927107/

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

126 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Banding artifacts with linear color space and color correction image effect 1 Answer

How to prevent frustum culling when using a vertex shader? 2 Answers

How do I adapt this vertex manipulation shader so that my object (point cloud) keeps its original colouring? 0 Answers

How to access vertex color in a code-based URP shader? 1 Answer

Painted Vertices are Blockly, Looking to smooth them Out 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