Skip to main content
GameDev.net gamedev.net
🔒 Locked

HLSL

Started by thedo Dec 22, 2002 at 3:12 PM 6 replies 450+ views
Original Post
thedo
thedo
just been looking at vs2.0 and am resigned to the fact that i will have to use either CG or HLSL. Now I would rather use HLSL as I'm d3d only but documentation on how to use it is a single (admitedly long) page with no info on how to compile them. The Nvidia website does state that it is compatible with HLSL - does this mean it uses the exact same syntax (ie like using a Borland c++ compiler rather than microsoft VC++) or just that using cg for parts does not affect the ability to use HLSL in others. Has anyone used HLSL and any simple code - a simple vertex transform will do- would be great. Many thanks Neil WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?! [edited by - thedo on December 22, 2002 4:13:02 PM]
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
yzzid
yzzid
Check out vsa.exe and psa.exe in the DirectX 9 SDK. These are the vertex and pixel shader compilers respectively. There is even an option for it to output a header containing the generated code. Interesting!

As for the format of the HLSL I haven''t seen much in the SDK docs. Guess you''ll have to wait until someone writes a tutorial

-dizzy
-dizzyGame Institute InternPlease rate me. :)
EvilDecl81
EvilDecl81
The docs should be available soon. The compiler is fxc.exe.

You can look at the examples in effectedit to get a better idea. If you have any questions, just ask here.
EvilDecl81
JD
JD
I''m not 100% sure but I seem to seen some hlsl code in the ''effects'' section of dx9 docs. There might be some code in the latest dx9 powerpoint slides on ms website www.msdn.microsoft.com/directx in fact I think there is, comparing wood shader from ati in asm to dx9 hlsl, though don''t know if they go over the whole process. It might or might not be that hard to figure out from the reference section I would think. The asm is not so bad, little confusing as the _x extended shaders are nvidia only I presume. I know ati dx9 part supports vs2/ps2 only, from caps posted on beyond3d forum:

http://www.beyond3d.com/forum/viewtopic.php?t=3671
thedo
thedo
quote:

There might be some code in the latest dx9 powerpoint slides on ms website www.msdn.microsoft.com/directx



Yeah there is but I dont have powerpoint at the mo.

quote:

The asm is not so bad



I had my head around vs1.1 but it''s those damned loops that are getting to me. I have an algorithm for skinned meshes in c++ which i thought would be nice in a shader (and vs2.0 is nice because i loop through the bones) but i''m just hoping that converting to hlsl will be relatively painless as it seems quite c-like.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
DrunkenHyena
DrunkenHyena
quote:

Yeah there is but I dont have powerpoint at the mo.



I don''t have a handy link, but if you do a search on Microsoft''s site you''ll find a free Powerpoint viewer.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena</FON
thedo
thedo
Lovely, thanks Ken - I thought there was but had never seen/used it (and certainly didnt think that MS would provide one (although it makes sense to when i think about it)). I may well be back

Neil


WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
thedo
thedo
The depth of field example uses HLSL. I shall try to post a quick tutorial on this thread when I get it working as the docs really suck. I looked at those powerpoints (thanks again to Ken for the tip about the powerpoint viewer (http://office.microsoft.com/downloads/2002/ppView97.aspx)) as there were some useful snippets in there too.

Hopefully I will be back soon (although it may be after Xmas). if there is sufficent interest I will do sooner rather than later

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.