Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX 9/SlimDX - Vertex/PixelShaders


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 22 June 2012 - 06:06 AM

Faster than using Effect, by all accounts, but I'm lacking on the "how to get at them". Need to know either:

1) How to get them from the Effect (handle string is non-obvious, unless it's the file name, which I probably should have tried).
2) How to load them myself.

Thanks.

Sponsor:

#2 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 22 June 2012 - 02:58 PM

I think I stuck this in the wrong forum. Could a mod move it, or should I just recreate it?

Thanks.

#3 mhagain   Crossbones+   -  Reputation: 7345

Like
1Likes
Like

Posted 22 June 2012 - 03:49 PM

Looks OK by me.

Anyway, the "HLSL Without Effects" sample in the SDK provides all you need to know for C++; I don't know about SlimDX versions of these calls though, but would assume that they do exist since Effects is just a wrapper around the raw vertex/pixel shader API. I see from it's documentation that it does have a PixelShader class, for example, so it should be just a matter of translating the calls.

Faster than Effects? Maybe, maybe not. Obviously you don't have the overhead of the wrapper to contend with, but that overhead is really quite minimal. Also, with the raw API you have to do certain things yourself that Effects will automatically manage for you - such as buffering up constants and sending them in bulk to the driver just before draw calls, for example.

So I'd personally stick with Effects if it's working well enough for you and if you don't have a specifc use case that goes beyond what it does.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 26 June 2012 - 12:40 PM

Looks OK by me.

Anyway, the "HLSL Without Effects" sample in the SDK provides all you need to know for C++; I don't know about SlimDX versions of these calls though, but would assume that they do exist since Effects is just a wrapper around the raw vertex/pixel shader API. I see from it's documentation that it does have a PixelShader class, for example, so it should be just a matter of translating the calls.

Faster than Effects? Maybe, maybe not. Obviously you don't have the overhead of the wrapper to contend with, but that overhead is really quite minimal. Also, with the raw API you have to do certain things yourself that Effects will automatically manage for you - such as buffering up constants and sending them in bulk to the driver just before draw calls, for example.

So I'd personally stick with Effects if it's working well enough for you and if you don't have a specifc use case that goes beyond what it does.

Thanks - I was previously given the impression that accessing directly would be significantly faster, although I may not have interpreted what was said correctly.

If it's not significantly faster, I'll focus on more critical areas of my code. :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS