• Advertisement
Sign in to follow this  

VertexFormats

This topic is 570 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys and gals, I wanted to ask a question about how you handle multiple vertex formats. I am currently working on my material editor. A material is capable of being used for many different geometry types, i.e static mesh/skinnedmesh/particles/etc. Each one of these geometry types has a separate shader file that provides certain global functions, such as "VertexLayout_GetWorldPosition" which gets the world position based on the given vertex layout and for each geometry type that the material supports, a permutation is generated. As of right now I have a base class called "CVertexLayout" , This class is responsible for managing the vertex declaration, and binding the vertex buffers to the commandlist pipeline. This class also keeps certain information such as; if the vertex layout has a permutation for instancing, or position only , i.e for shadow/depth-prepass techniques. Each of these vertex layouts has a corresponding "EMaterialVertexLayout" enum , such as MVL_StaticMesh, this enum is used to look up the correct shader permutations. As of right now it works fairly well, but I want a somewhat cleaner approach.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement