Skip to main content
GameDev.net gamedev.net
🔒 Locked

Custom Vertex Format in Visual Basic

Started by Sarky Sep 12, 2006 at 4:24 AM 0 replies 450+ views
Original Post
Sarky
Sarky
Just wondering how to set up a custom vertex format in visual basic managed code that included: Color, Position, Normal, Binormal, Tangent and Texture Coords so that I can do normal mapping. Fine with the getting of the data on the pixel shader end just not sure how to set up the VB structure to hold the data the custom vertex formats don't seem to have this data. Nor do the vertex formats include references to binormal or tangets. Thanks. Not sure if the PositionBlends are vector3s or not for example. At the moment I don't use multiple streams causes I have not quite got my head around them yet. [Edited by - Sarky on September 12, 2006 5:53:49 AM]
TheAdmiral
TheAdmiral
I'm not sure if I understand the problem.
It's done in much the same way it is in C++. Make sure you have the correct order for the components (as defined in MSDN) and throw them into a Type. If you have a sample of C++ or HLSL with an appropriate vertex format definition, you can translate it into VB in the usual way:
float   : Singlefloat2  : Single(2)float3  : Single(3)float4  : Single(4)long    : Longshort   : IntegerVector3 : Single(3)etc.
Use flexible vertex formats (FVF) wherever possible. If you're not sure what data types to use for the various data, then it's in the MSDN somewhere. But it's rarely necessary to look up such details, as if you understand what the datum represents (i.e. how the shaders use it) then the high-level type should be obvious:
Color    : float4Position : float3/float4Normal   : float3Binormal : float3Tangent  : float3TexCoord : float/float2/float3
Other than the possibly confusing Color, these data are obviously vectors and should be stored so.

Regards
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.