Vertex Informations

Posted By: jenGs

Vertex Informations - 05/03/13 10:04

Hi,

I am learning the basics of vertexshader right now.
I successfully implemented lighting to a triplanar terrain,
texture shader.
Now I want to do some additional things. Is there a way to pass some more information with a vertex, for example an individual vertex color?
Or perhaps just an individual ambient value?
Because of the lacking texture coordiantes on my model, I can't use an additional map to look such informations up.

Perhaps this question sounds a bit silly for you shader gurus,
but I am still at the beginning laugh

Greetings,
Patrick
Posted By: qwe

Re: Vertex Informations - 05/03/13 10:33

I think you can, if you use ent_getmesh ,you will get pointer to LPD3DXMESH.then you can use UpdateSemantics method and use LockVertexBuffer to set data.
or
create new mesh then use ent_setmesh.

for more info about LPD3DXMESH

ID3DXBaseMesh
Posted By: MasterQ32

Re: Vertex Informations - 05/03/13 10:51

just modify your texture coordinates via ent_getvertex and ent_setvertex
you can use the texture coordinates for giving additional informations (you don't need to use them as a texture coordinate)
Posted By: jenGs

Re: Vertex Informations - 05/03/13 11:09

Thank you guys for the fast answers.
Didn't thought of that.
Thought that you can't use the coordinates if no maps are assigned. Learned something new laugh

Greetings,
Patrick
© 2024 lite-C Forums