Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Differences Of Shader Version

Author
Message
puppysss
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 7th Aug 2010 07:40
Hello , Recent I have a matter that differences of shader version.
I heard that lower vesion could run lower graphic cards.
But I really don't know about that.
Also I wonder that hlsl code has differences in other versions.
Umm... I want to know that.

Knowledge Is Well-Known Wisdom.
So Wisdom Is Very Absolute.
Four Dimensional
18
Years of Service
User Offline
Joined: 11th Jun 2008
Location: lost in thought
Posted: 8th Aug 2010 11:59
Perhaps you mean the shader model version?
In HLSL, you can specify different versions of the vertex and pixel shader to use. As I believe you stated, lower versions are more compatible with lesser graphics cards: my nvidia 5000 series runs shader model 2.0, which allows for both pixel and vertex shader 2.0 at max (and surprisingly not 2a or 2b). The benefit to using higher versions however is more space for instructions. Lower versions simply don't allow many calculations to be performed, which is unfortunate when one wishes to incorporate such shaders as ambient occlusion, parallax mapping, chromatic aberration, reflection, refraction, etc.

Imagine this: there may exist infinite parallel universes, all similar to ours, but we may never be able to encounter or even interact with them.
Duke E
17
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 10th Aug 2010 11:04
Here is a comprehensive compare of different shader models.
http://en.wikipedia.org/wiki/High_Level_Shader_Language

Code wise the big differences i have come across in my few months using hlsl are the instruction limits. Squeezing in the functionality you want in a shader can be challenging.
Also the lack of bitwise operations are somewhat hampering.

@Four Dimansional
SM 2.0a & 2.0b are the graphics card developers special shader versions to show off some special feature of their cards (NVidia and ATI respectively) i figure it should be able to run SM2.0a.

On a side note.
I read the Wiki link from that page for the GeForce FX series. Surprisingly it seems like it was sub-par compared to ATIs cards at that time, for example Half-Life 2 when released had SM2.0 turned off for the FX series altogether reverting to DirectX 8.0 shaders (1.1) as it could not run SM2.0 fast enugh :-|.
I had a FX5900 Ultra (RIP) that had some improvements over the early FX cards, figured it was pretty good afterall.

Regards
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Aug 2010 11:43 Edited at: 10th Aug 2010 11:44
Quote: "Also the lack of bitwise operations are somewhat hampering."


Are you sure? Extract from the MS DX9 SDK docs:

Quote: "Bitwise Operators
HLSL supports the following bitwise operators, which follow the same precedence as C with regard to other operators. The following table describes the new operators.

Operator Function
~ Logical Not
<< Left Shift
>> Right Shift
& Logical And
| Logical Or
^ Logical Xor
<<= Left Shift Equal
>>= Right Shift Equal
&= And Equal
|= Or Equal
^= Xor Equal

Bitwise operators are defined to operate only on int and uint data types. Attempting to use bitwise operators on float, or struct data types will result in an error.
"


Although I wonder what the word "new" refers to.

Seems like a good opportunity for writing a simple test shader.
Duke E
17
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 10th Aug 2010 23:13
@GG,

<=SM 3.0 wont compile with those. Though it is documented it is not implemented, it has something to do with hardware dependency i have read and/or lack of full integer support, not sure (round is documented also but wont compile).
I have just been working on packing four variables in an object's UV set to get more data in to my particle shader. It would have been so much easier with left/right shifts and And's .

Regards
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Aug 2010 13:32
@GG
Those operators only work with int and uint types, and graphics cards didn't support int or uint types until SM3.

[b]
puppysss
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location: UnCyber Space
Posted: 11th Aug 2010 18:56
Oh I realized of that! More instructions can be made into surprising
effect in vast calculation range!
So, If shader model is lower ... theres operators are very simply logic and veeery high speed! Ofcourse in the case , programmer will should give up about most effect like skinning , tessellation , ocean per vertex ... etc.
Anyway , I Appreciate Your Helps ! Thanks So Much!!



Knowledge Is Well-Known Wisdom.
So Wisdom Is Very Absolute.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Aug 2010 19:51
Quote: "@GG
Those operators only work with int and uint types"


Indeed. From the quoted extract I gave earlier:

Quote: "Bitwise operators are defined to operate only on int and uint data types."


Login to post a reply

Server time is: 2026-07-25 07:07:26
Your offset time is: 2026-07-25 07:07:26