Where are my vertex colors?
See original GitHub issueI want to use vertex colors in my shader. After spending a few minutes reading JSON Model format 3.0 I made this model manually:
{
"metadata":
{
"sourceFile": "",
"generatedBy": "3ds max ThreeJSExporter",
"formatVersion": 3,
"vertices": 4,
"normals": 0,
"colors": 4,
"uvs": 0,
"triangles": 2,
"materials": 1
},
"materials": [
{
"DbgIndex" : 0,
"DbgName" : "dummy",
"colorDiffuse" : [0.5, 0.25, 0.25],
"vertexColors" : true
}
],
"vertices": [-100,-100,0, 100,-100,0, -100,100,0, 100,100,0],
"normals": [],
"colors": [6808406,16777215,5197746,5197746],
"uvs": [[]],
"faces": [128, 0,1,2, 0,1,2, 128, 2,1,3, 2,1,3]
}
However it doesn’t work with my shader:
"varying vec4 vColor;",
"void main() {",
" vColor = vec4(color, 1.0);",
" gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);",
"}"
Strangely color is always solid white. I also tried a simple box exported by ThreeJSExported with “Export vertex colors” checked. Doesn’t work either. So what shall I do?
BTW is it possible to include an alpha component in vertex colors?
Issue Analytics
- State:
- Created 12 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Introduction — Blender Manual
Vertex Painting is a simple way of painting color onto an object, by directly manipulating the color of vertices, rather than textures, and...
Read more >How to view vertex' colors? - Blender Stack Exchange
E.g. for 2.79, there is the command: "3D Editor > Vertex Paint mode > Header > Paint Menu > Set vertex colors". @mins...
Read more >Painting Vertex Colors in Blender - KatsBits.com
Once Vertex Paint mode is active, to actually paint click, or click-hold and drag, the mouse cursor across the selected object to affect...
Read more >Using vertex colors in Blender 2.8 | by Ben Olayinka - Medium
2. Hit ctrl-tab and go in to Vertex Paint mode. This will automatically create a Vertex Colors node called 'col' in the object...
Read more >Vertex Paint color not showing up - CG Cookie
Vertex Paint color not showing up · spikeyxxx replied on May 26. Solution. Did you enable it in the Viewport Shading dropdown: Vertex...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@donmccurdy thanks for your prompt response! It was an error on our part - color was being multiplied by 255 in our vertex data
@mooce for help and questions, could you post to the forum? It will also help to include details such as your code or source model (if any) for us to guess why your colors might have large values. 😃