Mesh to Shader

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mtest
Posts: 10
Joined: Mon Feb 18, 2008 8:41 pm

Mesh to Shader

Post by mtest »

I was wondering how exactly I might pass a mesh to a shader, and derive a matrix, as I can do with textures, for say, blending.

Also, the only way I can even achieve this is if the texture has already been associated with the node itself, you know, setMaterialTexture(0,1,...
as I'm not sure how to pass a texture directly (any myriad of things seem to not work.) and then 'addconstant' a referece to the index - which in turn lets me obtain the tex.

I'm not even sure how to pass a mesh to an ISceneNode; I was hoping that someone could point me in the proper direction, thanks.
renegadeandy
Posts: 122
Joined: Sun May 25, 2008 11:14 pm
Location: Scotland
Contact:

Post by renegadeandy »

what do you mean pash a mesh to an iscene node??

IScenenode* node = smgr->addAnimatedMeshSceneNode(shizzle???)???

im not sure i understand you!
mtest
Posts: 10
Joined: Mon Feb 18, 2008 8:41 pm

Post by mtest »

Thanks for the (amazingly) prompt reply - always a bonus.
OOPS///
I mean, I can addCubeSceneNode, but I'm not sure how to apply the mesh loaded from that function to the ISceneNode, so I seem for the moment to be stuck with the default 'outputs', like cubes, and spheres.

actually know what!
///
THat is EXACTLY how to do it.

I did not in fact, seem to actually READ that. Err... thanks again.

I knew that.

I was ultimately wondering If I could pass a mesh to the vertex shader like a texture.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Irrlicht sends mesh vertex data in to video driver automatically and it also set different attributes based on your material settings. You do not have to sent mesh to shader yourself. You can access vertices in vertex shader than ...thats what that shader do ...one vertex per time.

If you hoverer want to know how vertex data are passed in to video driver you have to learn OpenGL or DirectX. But unless you want to modify Irrlicht sources I don't see reason to do so.
Post Reply