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.
Mesh to Shader
-
renegadeandy
- Posts: 122
- Joined: Sun May 25, 2008 11:14 pm
- Location: Scotland
- Contact:
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.
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.
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.
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.