When is the best time to learn vertex/pixel shading?,
Members - Reputation: 106
Posted 18 June 2008 - 05:45 PM
Crossbones+ - Reputation: 4972
Posted 19 June 2008 - 12:43 AM
Members - Reputation: 1258
Posted 19 June 2008 - 01:17 AM
In some ways, shaders are actually easier to learn than fixed-function graphics. There might be more actual work in shaders, but conceptually, I find them easier to deal with. You write code, which the GPU executes. That's a model a programmer should be familiar with at least. [wink]
There are no hidden tricks, no magic. You tell the GPU exactly what to do, and as long as you understand the math involved in putting triangles on the screen, you just have to code it.
On the other hand, the fixed-function pipeline is a big mystical black box you're never quite in control of. I found it a lot harder to actually get a feel for what was going on there.
But of course, ymmv.
Of course, the fact that the fixed function pipeline doesn't even *exist* in DX10 is a strong hint that Microsoft at least don't see a need for it *at all*, not even for beginners.
And I agree.
Members - Reputation: 182
Posted 19 June 2008 - 04:06 AM
but keep this in mind. DirectX 10, and the upcoming openGL(is it gonna be 2 or 3?) both do away with the fixed function pipline and rely solely on shaders, so it's getting to the point where you're not gonna have an option
GDNet+ - Reputation: 133
Posted 19 June 2008 - 06:13 AM
Members - Reputation: 1172
Posted 19 June 2008 - 12:05 PM
When is the best time to learn vertex/pixel shading?
The witching hour, hands down [wink]
Seriously though, as others have posted shaders are the way forward. I personally found shaders a big relief anyway, since you can just code whatever you want to do with your vertices and pixels instead of having to shoehorn everything into the fixed function pipeline. I'm a happy camper not having to mess around with the TextureStageStates anymore, for example.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Crossbones+ - Reputation: 1416
Posted 06 January 2013 - 06:40 AM
Should I learn it early on (like on the early stages of a first game)? Or later (like mastered the DX fixed functions and have created some games)? Should I learn the assembly like way first then HLSL, or HLSL first then the assembly like way?The challenge in graphics is understanding the math going on behind the scenes, not mastering any given API, whether DX, OGL, HLSL etc. Using shaders, or GPU acceleration in general, is just a matter of getting the same things done faster. The advice I have been given by my professor is to do everything on the CPU while you are figuring it out - keeping things simple and nice to debug - and move it to the GPU later if and when you actually need performance.
In short, I think messing with shaders is quite likely going too far into technical detail for a first game.
Edited by Stroppy Katamari, 06 January 2013 - 06:41 AM.
Crossbones+ - Reputation: 7275
Posted 06 January 2013 - 10:29 PM
What does he mean when he says the "assembly way", I thought it was all HLSL?
HLSL is an easier (higher level) method of implementing shaders. Prior to HLSL you could just write GPU targeted assembly and assemble it the same way HLSL is compiled now. The assembly methods still exist and function correctly, but they don't really allow you to do much that HLSL doesn't unless you're really really into fiddling with individual registers and such. It's not even the same kind of assembly that you'd write for the CPU - it's a specific assembly language developed for use almost the same way that you'd use HLSL. In the end it's just a more complicated way of doing the exact same things.
Edited by Khatharr, 06 January 2013 - 10:31 PM.
There are ten kinds of people in this world: those who understand binary and those who don't.