Page 1 of 1

shader

Posted: Wed Jun 07, 2006 1:04 pm
by luigi2004
how can i deform a mesh in irrlicht 1.0 through vertex shading?

im stuck with the setup.

With rendermonkey it all looks simple but when it comes to irrlicht im stumped.

Posted: Wed Jun 07, 2006 1:54 pm
by hybrid
Probably the same way as all shaders are working in Irrlicht. Did you manage to change the shaders in the shader tutorial? Did you give all those shader extensions from the project forum a try? What problems do you face when using the shader.

Posted: Wed Jun 07, 2006 2:16 pm
by luigi2004
im stuck on accessing my model data or simple deforming it and yes i try the tutorial and had the pixel shader working great but im reading alot books and one had a shader to flatten your model and do other things to it
but it isn't working irrlicht and i use rendermonkey alot so i think the shader is correct since it does work there

Posted: Wed Jun 07, 2006 2:31 pm
by Baal Cadar
You still fail to provide informations we can work with.
What does "doesn't work" mean specifically?
Do you get an error message? If yes, what is it.
In what way does the result you get differ from the result you want?
What does the shader look like and how do you try to use in irrlicht?

Learn how to ask questions.

Posted: Wed Jun 07, 2006 2:39 pm
by luigi2004
im sorry it just doesnt do what is expected its like the shader is disable and nothing changes in the scene is there a special way to grabe the data from the mesh?

Posted: Wed Jun 07, 2006 4:17 pm
by vitek
is there a special way to grabe the data from the mesh?
A vertex shader gets the data for each vertex as a parameter. You just need to tweak the position on the output side.

Code: Select all

VS_OUTPUT vs_main(
                      in float4 vPosition : POSITION,
                      in float3 vNormal   : NORMAL,
                      float2 texCoord     : TEXCOORD0 )
{
   VS_OUTPUT Output;

   Output.Position = mul(vPosition, mWorldViewProj);

   // do something to tweak position..
   Output.Position.z *= 2.f

   // more stuff here
	
   return Output;
}

Posted: Mon Jun 12, 2006 11:11 am
by luigi2004
i tried that do i need to recompile the app or something?

Posted: Mon Jun 12, 2006 11:30 am
by Baal Cadar

Posted: Wed Jun 14, 2006 6:40 pm
by SwiftCoder
Also, make sure that your card supports vertex shaders.

Posted: Thu Jun 15, 2006 12:15 am
by Maize
If his card didn't support the Vertex Shaders, it wouldn't work in render.MONKEY.