c++ - Can't figure out Shaders for DirectX11? -


so, have no idea how use shaders. coding them easy, not using them. msdn useless me, meaning have worst tutorials out there. reading frank luna's direct3d 11 book, , part draw stuff. exciting, except fact doesn't work. boxdemo - i'm sure worked 3 years ago when book made, of new directx stuff - omitting directx sdk , using "windows sdk", fx being deprecated, no more d3dx libraries... frustrating. went ahead , downgraded directx 2010 sdk - can use tutorial. every d3d tutorial out there uses d3dx libraries.

anyway... question. visual studio has option make .hlsl files. but, has ability make .fx files (if type .fx @ end of file name creates .fx file). so, use deprecated .fx way , learn how use of tutorials teaching - or can learn new hlsl way, , have hardest, frustrating time trying learn no tutorials.

i know both use hlsl language. both used in program differently. (createeffectfrommemory, compilefromfile, etc). kind of hope learn new way, if don't fine. although, pretty have entire program using .fx file. i'm sure work, need building , utilizing "effects11.lib".

sorry dragging on post - in fact, sure not replies while - if - due length. pretty frustrated because learning directx has put programming career on massive hiatus past month, 2 months. please , thank help

the file extension .hlsl vs. .fx arbitrary. it's difference between .cpp , cxx. historically .fx used hlsl shaders included vertex shaders, pixel shaders, , effects (fx) techniques/passes, , .hlsl file didn't include effects (fx) techniques/passes, convention. there's plenty of both used out there.

what matters how file compiled. if use fx_5_0, requires effects 11 runtime use them. nothing special. invoke same compiler each combination of compile statements provided effects (fx) techniques/passes , bundles meta-data. in fact, can invoke fxc compiler on .fx file containing techniques/and passes using vs_5_0 or ps_4_0 , compile appropriate stage-specific shader if parameters right.

re: effects11

the main issue effects 11 requires d3dcompile dll @ runtime because uses extract metadata required wire state , shaders. d3dcompile dll not usable windows store apps in windows 8.0 , windows phone 8.0 when deployed app, when developing app. thus, effects 11 wasn't usable platforms.

this no longer technical issue windows store apps windows 8.1 or windows phone 8.1, compiler support fx_5_0 still deprecated. has few issues fixed other profiles vs_5_0, etc. such, it's if want use or not long understand it's limitations.

the latest version of effects 11 on codeplex , address limitations there. there simple tutorials use it, few samples. version of effects 11 doesn't need legacy directx sdk @ all.

in short, ymmv w.r.t. effects 11 can still use win32 desktop apps, windows store apps windows 8.1, windows phone 8.1 apps, , in theory xbox 1 apps too.

re: d3dx

i can understand frustration, it's common issue book publishing industry , technical books being way behind ball in terms of changes. directx 11 introduced in 2008. transition windows 8 sdk came in 2012 , developers less book publishers completed missed it. have notes on book on blog.

for complete list of 'modern' alternatives, see living without d3dx.

for win32 desktop apps, can continue use legacy directx sdk. main thing note windows 8.x sdk comes vs 2012 , vs 2013, include , lib path orders reversed vs 2010. see msdn details.

re: learning direct3d 11

have looked @ directx tool kit?

getting started direct3d 11

direct3d feature levels

hlsl, fxc, , d3dcompile

as tutorials , samples, try directx sdk samples catalog.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -