Mesh Vertex Color in Direct3D 9

Started by
9 comments, last by Anoop Chauhan 11 years, 7 months ago
I want to extract mesh vertex color from X file. I can't figur out how to do that..may be we need to write a custom mesh loader? Actually I want my mesh painted by vertex colors alongside texture
Advertisement
? Anyone
Your first post was at 2:30am (my time), your second at 9:22am. During that time most people in my time zone, or one not too far off it, would be asleep. Aside from that, 7 hours is an awfully short time before a second post like this.

And aside from all of that - what have you tried?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I have a model exported from 3ds Max. Suppose a simple mesh like plane with a simple texture, painted half of it's vertices with vertex paint modifier. The X file template "MeshVertexColor" contains color for each vertx .How to display them on screen with d3d?

vcolor.JPG
Are you using the fixed function pipeline (FFP) or vertex/pixel shaders?

Btw, are you sure that your x-file exporter DOES export also vertex colors set by the vertex paint modifier? (Just to be sure because the exporter I was using didn't do this.)
yup...Model has vertex colors....and I'm using FFP
??
You need to configure the texture blending environment for your fixed-function material.
e.g. setting a blending stage, which modulates the texture colour with the diffuse colour.
It is okay to combine color of texture with color of specified vertex(diffuse) using a blending operation. But D3DXLoadMeshFromX doesnt load vertex color, then what should I do?
If you switch to using the D3DXLoadMeshHierachy APIs, you can control the vertex declaration used to create your mesh in the allocation hierarchy's CreateMeshContainer() method. Then you can be sure you have the vertex colors.

This topic is closed to new replies.

Advertisement