Jump to content
  • Advertisement
Sign in to follow this  
tomwindcloud

How to use shader fragments within effect??

This topic is 4616 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

I searched microsoft directx SDK and the forum, couldn't find how to use shader framents with effect. I know in SDK have some info about this, but it isn't clear. And the sample in SDK with fragments use pure HLSL, no effect. Basically, i think effects is more convenient than pure HLSL.Now, my quesition is: 1. Use fragment in effect is Ok? or no? 2. How to use Fragments with effect? thanks in advance! tomwindcloud [Edited by - tomwindcloud on November 27, 2005 8:01:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
More accurate, say i have linked a vertex shader with LinkVertexShader function. In SDK doc, i can find this: The vertex shader needs to be set in the effect before rendering.
But how to set the vertex shader in the effect???? I can't find any function or interfaces can do it.

Share this post


Link to post
Share on other sites
Quote:
Original post by tomwindcloud
But how to set the vertex shader in the effect???? I can't find any function or interfaces can do it.

You can use the SetValue() method to do this. It takes a pointer to any kind of data, including shader programs.

Share this post


Link to post
Share on other sites
Quote:
Original post by centipede
Quote:
Original post by tomwindcloud
But how to set the vertex shader in the effect???? I can't find any function or interfaces can do it.

You can use the SetValue() method to do this. It takes a pointer to any kind of data, including shader programs.


thanks!! I'll try it. thanks again.

Share this post


Link to post
Share on other sites
Quote:
Original post by centipede
Quote:
Original post by tomwindcloud
But how to set the vertex shader in the effect???? I can't find any function or interfaces can do it.

You can use the SetValue() method to do this. It takes a pointer to any kind of data, including shader programs.


I try to use SetValue, but failed!. This is as follow:
IDirect3DVertexShader9 *g_pShader. is a right vertexshader.
1. Get the vertexshader buffer .
UINT size;
ID3DXBuffer* pData;
g_pShader->GetFunction(NULL, &size);
D3DXCreateBuffer(size, &pData);
V_RETURN( g_pLinkedShader->GetFunction(pData, &size) );
2. Set the vertexshader in effect.
g_pEffect->SetValue(g_hTestVertexShader, pData, size);
//hTestVertexShader is a D3DXHANDLE
but it failed.

How to do it?? Any suggestions??

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!