Results 1 to 7 of 7

Thread: Questions about different shader languages

  1. #1

    Questions about different shader languages

    Investigating about loading shaders, I found the basic one: pixel shader assembly. This is loaded using D3DXAssembleShaderFromFile. Ok! Now I have these silly questions:

    1. I supposed there would be its counterpart, the vertex shader assembly, but haven't found it. Does it exists?

    2. What I have found instead is high level vertex shader. But which function do I use to load it? Maybe it is D3DXCompileShaderFromFile, isn't it?

    3. Is the same function, D3DXCompileShaderFromFile, used to load high level pixel shaders?

    4. And I found there is a .fx file, that seems to be loaded with D3DXCreateEffectFromFileW... what kind of shader is that?

    Thanks on advance!

  2. #2

    Questions about different shader languages

    1. D3DXAssembleShaderFromFile - assembles any assembler coded shader
    2. D3DXCompileShaderFromFile - compiles any (pixel or vertex) HLSL shaders to code.
    3. -> (1), (2)
    4. ".fx" files "effect" files encapsulate render states, pixel / vertex shaders in simgle "effect". Which can be: multipass; different render techniques for different hardware (for example one for GeForce3 with ps.1.1. and another for HW with PS.3.0. support)
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Questions about different shader languages

    Thanks! I have another question: is it better to do all the transforms with vertex shaders, or in the old way, doing the transformations in the main programming language?

  4. #4

    Questions about different shader languages

    If you do only transform and no fancy things when the "old HW T&L way" is always equal or better. Or by "in the main programming language" you meant transforming on CPU? Today you should definetly use GPU's for that.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    Questions about different shader languages

    Interesting thanks!

  6. #6

    Questions about different shader languages

    NVidia advices that developers should override the fixedfunction pipeline. it could possibly calculate a whole lot of crap like lighting and other stuff you maybe don't need.. well up to you. you're at least not going to lose anything on using shaders(unless you're a bad coder)
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  7. #7

    Questions about different shader languages

    JSoftware
    Well, if you are enabled lighting, and do not need strict behaviour / precision of "standart" lighting -> when you are somethat right.

    But from the other side: fixed function T&L setup on modern chips translated to vertex shader, but it's often more optimized than it's possible by using standart vertex shader assembler syntax. You can verify it by youself looking at results of D3DRightmark - often used by www.digit-life.com, www.beyond3d.com and some other sites.
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •