Sign in to follow this  
Anoop Chauhan

Mesh Vertex Color in Direct3D 9

Recommended Posts

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 - [url="http://mattgemmell.com/2008/12/08/what-have-you-tried/"]what have you tried[/url]?

Share this post


Link to post
Share on other sites
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?

[img]https://lh6.googleusercontent.com/-hhWrd6Zk2lU/UFXrHUC3AsI/AAAAAAAAALk/9-Ww79fkGwc/s640/vcolor.JPG[/img] Edited by Anoop Chauhan

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
You need to configure the [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb206241(v=vs.85).aspx"]texture blending[/url] environment for your fixed-function material.
e.g. setting a [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb204870(v=vs.85).aspx"]blending stage[/url], which modulates the texture colour with the diffuse colour.

Share this post


Link to post
Share on other sites
D3DXLoadMeshHierarchyFromX loads the animation data and frame hierarchy from a x file.I dont think it mean anything to vertex color.After all I did it, simply By using D3DXLoadMeshFromX. But it doesn't look like that of 3dsmax model. Perhaps every vertex color I specified , has been combined with it's diffuse color and finally put into material buffer, Can anyone guess why vertex colors seems to be zigzag. thanks guys anyway
[img]https://lh5.googleusercontent.com/-HWzFolj8Q50/UF0khjuNU6I/AAAAAAAAAL0/GYjHGhzOKWk/s400/Capture2.JPG[/img]
[img]https://lh4.googleusercontent.com/-W_MW-d3hLeU/UF0kqO8OqCI/AAAAAAAAAL8/wQkoHiChDlw/s400/Capture.JPG[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this