The CustomGeometry component itself can only define single 2-dimensional UV’s, by using DefineTexCoord() function for each vertex.
If you define vertex / index buffers yourself, like the dynamic geometry example “from scratch” part does, you could define your vertex declaration just like you want, for example using multiple UV’s, 3D UV’s etc.
I wonder if anybody have the example on what are possibilities with vertex/index buffer.
This topic is not quite documented. I guessed some things around, looked-up some things in AssetImporter,
but that all doesn’t make single picture. What I’m mostly interested in is relation between
Model, Geometry and Vertex/Index buffer. Some combinations do not work, i.e. one can’t have lod vertex buffer separate. There are many such examples. Because of that procedural generation of assets is very painful thing,
as it does have too much of trial and error. There are people who understand this stuff, but they are silent.
For example, I try to split Model in 2 using some criteria, this looks like insane task, as I don’t know too many things,
like how bone transforms are represented, how morphs are represented, the limitations (4 boneindices per vertex), etc.
Another thing is generating model with LODs - what are relations of LOD geometries with normal geometries,
can I have LODs in separate IBs or they should be the same, etc.
So as I see somebody written all this cool stuff and forgot all about it and now somebody else need to guess it all out,
like archaeologists guessed Egypt hieroglyphs before Rosetta stone was found. But there is no Rosetta stone for this case.
After a while I found a good way to do it.
Only problem is the fact that the color is gray for some reason and when you move your camera above it it turns black.
What Vector3 value should the Normals be?
Because right now I do
geometry->DefineNormal({0,0,0});
It sets the triangle to black no matter what color I set the vertex to
Basically anything but all-zero.
It should preferably be a normalized vector (hence the name), which means it should have a length of 1. In most cases you’ll want it to be perpendicular to the surface, pointing out. In the DynamicGeometry sample the normals are calculated after the vertex position data is collected.
Also, sorry for changing the subject but I didn’t think it would be a good idea to post tons of threads onto a subforum.
Lighting doesn’t seem to work with it.
Here’s a few rectangles I’ve drawn: http://prntscr.com/fdiheu
There is lighting been shown at them but no shadows show and the edges aren’t visible.
Incase it was just a lighting glitch I also tried red lighting: http://prntscr.com/fdiins
That doesn’t work either.
The normals are calculated correctly, too, I believe so I don’t know the issue
It’s because You’re using unlit material. I don’t think that there is build in lit material with vertex colors, You have to create new one using one of the VCol techniques