#1 Members - Reputation: 305
Posted 22 June 2012 - 06:06 AM
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.
#2 Members - Reputation: 305
Posted 22 June 2012 - 02:58 PM
Thanks.
#3 Members - Reputation: 3828
Posted 22 June 2012 - 03:49 PM
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 Members - Reputation: 305
Posted 26 June 2012 - 12:40 PM
Thanks - I was previously given the impression that accessing directly would be significantly faster, although I may not have interpreted what was said correctly.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.
If it's not significantly faster, I'll focus on more critical areas of my code.






