Mesh wont appear after applied 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
Eagle_Eye
Posts: 16
Joined: Sun Feb 08, 2009 11:04 pm

Mesh wont appear after applied shader.

Post 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?
Eagle_Eye
Posts: 16
Joined: Sun Feb 08, 2009 11:04 pm

Post 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?
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post 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 ;)
Image
Image
Post Reply