Jump to content
  • Advertisement
Sign in to follow this  
adder_noir

Hi I'm confused about Pixel Shaders & Effect files

This topic is 2507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

I'm ok getting a vertex shader to work using the effect file format. I just use the handy DX functions to load the effect file.

BUT!

I'm told a pixel shader can also be used with the effect file format!

Now as far as I know you can have or have to have a vertex shader and a pixel shader active simultaneously. That sounds ok. I'm getting confused though.

1)If you're using an effect file is the vertex shader and pixel shader combined into one .fx file?

2)If 1) is not the case do you need to call the Effect->BeginPass(int) for both the vertex shader and pixel shaders or can you combine both into one BeginPass call?

Pretty sorry state of affairs but I really need with this one :rolleyes:

Thanks so much for any clarity anyone can offer :)

Share this post


Link to post
Share on other sites
Advertisement

1)If you're using an effect file is the vertex shader and pixel shader combined into one .fx file?

Yes

Share this post


Link to post
Share on other sites
Yup, a simple format might look like (with some stuff ommitted for clarity):struct PSInput
{
...
};

struct VSInput
{
...
};

float4 MyPS (PSInput Input) : COLOR0
{
...
}

PSInput MyVS (VSInput Input)
{
...
}

technique t0
{
pass p0
{
VertexShader = compile vs_3_0 MyVS ();
PixelShader = compile ps_3_0 MyPS ();
}
}

Share this post


Link to post
Share on other sites
Great! I love straightforward replies!!! That's so good it means I can simplify the way light and materials are handled in the application now :D :cool:

Thanks so much - now back to learning for me :wub:

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!