Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mesh Vertex Color in Direct3D 9


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 15 September 2012 - 07:30 PM

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

Sponsor:

#2 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 16 September 2012 - 02:22 AM

? Anyone

#3 mhagain   Crossbones+   -  Reputation: 7970

Like
0Likes
Like

Posted 16 September 2012 - 03:05 AM

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?

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 16 September 2012 - 09:14 AM

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?

Posted Image

Edited by Anoop Chauhan, 16 September 2012 - 09:17 AM.


#5 Tom KQT   Members   -  Reputation: 1589

Like
0Likes
Like

Posted 17 September 2012 - 02:02 AM

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.)

#6 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 17 September 2012 - 02:11 AM

yup...Model has vertex colors....and I'm using FFP

#7 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 19 September 2012 - 01:38 AM

??

#8 Hodgman   Moderators   -  Reputation: 30384

Like
0Likes
Like

Posted 19 September 2012 - 02:22 AM

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.

#9 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 19 September 2012 - 09:14 AM

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?

Edited by Anoop Chauhan, 19 September 2012 - 09:28 AM.


#10 Steve_Segreto   Crossbones+   -  Reputation: 1530

Like
0Likes
Like

Posted 19 September 2012 - 10:57 AM

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.

#11 Anoop Chauhan   Members   -  Reputation: 115

Like
0Likes
Like

Posted 21 September 2012 - 09:09 PM

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
Posted Image
Posted Image




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS