Page 1 of 1

Mesh wont appear after applied shader.

Posted: Wed May 13, 2009 6:07 am
by Eagle_Eye
for some reason, my mesh disappears when i apply my shader to it. it should at least show it, no? I don't get if it's the shader, or my code. any ideas on what it could be?

i've added my shader code here for you to see so MAYBE you could tell me what's wrong with it. Irrlicht doesn't give me any errors in the console so it's setting the shader right but for some reason, it doesn't show it.

Code: Select all


float4x4 matViewProjection : ViewProjection;

struct VS_INPUT 
{
   float4 Position : POSITION0;
   float2 fTex     : TEXCOORD0;
};

struct VS_OUTPUT 
{
   float4 Position : POSITION0;
   float2 fTex     : TEXCOORD0;
};

VS_OUTPUT Effect_Group_1_Effect1_Pass_0_Vertex_Shader_vs_main( VS_INPUT Input )
{
   VS_OUTPUT Output;

   Output.Position = mul( Input.Position, matViewProjection );
   
   Output.fTex = Input.fTex;
   
   return( Output );
   
}




texture my2DTexture_Tex
<
   string ResourceName = "..\\Meshes\\Level_One\\crate.jpg";
>;
sampler2D Crate = sampler_state
{
   Texture = (my2DTexture_Tex);
};

float4 Effect_Group_1_Effect1_Pass_0_Pixel_Shader_ps_main(in float2 fTex : TEXCOORD0) : COLOR0
{   
   return tex2D(Crate,fTex);
   
}

has that ever happened to any one?

Posted: Wed May 13, 2009 8:17 pm
by Eagle_Eye
Ok, i figured out why it didn't show, because i had a black back ground. for some reason, the mesh is black after i applied the shader to it, any ideas?

Posted: Wed May 13, 2009 10:52 pm
by B@z

Code: Select all

texture my2DTexture_Tex
<
   string ResourceName = "..\\Meshes\\Level_One\\crate.jpg";
>; 
does irrlicht support that kinda things? O.o
i think it doesnt support texture load. you can just use the textures of the node

and if its full black then its shader problem ;)