shader

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
luigi2004
Posts: 12
Joined: Sat May 27, 2006 3:49 am

shader

Post 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.
Last edited by luigi2004 on Wed Jun 07, 2006 2:10 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Last edited by hybrid on Wed Jun 07, 2006 2:31 pm, edited 1 time in total.
luigi2004
Posts: 12
Joined: Sat May 27, 2006 3:49 am

Post 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
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post 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.
No offense :)
luigi2004
Posts: 12
Joined: Sat May 27, 2006 3:49 am

Post 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?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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;
}
luigi2004
Posts: 12
Joined: Sat May 27, 2006 3:49 am

Post by luigi2004 »

i tried that do i need to recompile the app or something?
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

No offense :)
SwiftCoder
Posts: 32
Joined: Thu Jan 15, 2004 7:33 pm
Location: Carribean

Post by SwiftCoder »

Also, make sure that your card supports vertex shaders.
Maize
Posts: 163
Joined: Sat Oct 29, 2005 12:12 am
Location: In a cave...
Contact:

Post by Maize »

If his card didn't support the Vertex Shaders, it wouldn't work in render.MONKEY.
Post Reply