Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Very very simple Shaders with Clootie?

  1. #1

    Very very simple Shaders with Clootie?

    Hi! Does anyone has very simple examples of shaders using Clootie? I'm reading the sample BasicHLSL, but it's still too complicated for me. They have to setup several values, and the code is quite big so I have to scroll up and down to catch the ideas. I just want to see how to make and setup a shader, so I can duplicate the work in my project. Thanks on advance!

  2. #2

    Very very simple Shaders with Clootie?

    Please, don't use me for simple shaders :!:
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Very very simple Shaders with Clootie?

    Quote Originally Posted by Clootie
    Please, don't use me for simple shaders :!:
    But I have to learn first :cry:

    I need some light on shaders.

  4. #4

    Very very simple Shaders with Clootie?

    Will it help: MS description of BasicHLSL sample ?

    Another sample to look: HLSLWithoutEffects.
    Also you can download samples from DirectX Summer 2003, they tend to use assembler coded shaders (but I totally forget that samples to look for them) - so no/less effect formats, constants already have fixed registers, etc.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    Very very simple Shaders with Clootie?

    Quote Originally Posted by cronodragon
    Quote Originally Posted by Clootie
    Please, don't use me for simple shaders :!:
    But I have to learn first :cry:
    I don't mind if you use headers/samples I'm providing. By using ME as a shader?.. :shock:
    There are only 10 types of people in this world; those who understand binary and those who don't.

  6. #6

    Very very simple Shaders with Clootie?

    How the Sample Works

    First the sample loads the geometry with D3DXLoadMeshFromX and calls D3DXComputeNormals to create mesh normals if there aren't any. It then calls OptimizeInplace() to optimize the mesh for the vertex cache, then loads the textures using D3DXCreateTextureFromFile. Next, the sample calls D3DXCreateEffectFromFile to compile the effect text file to a ID3DXEffect* interface called m_pEffect.

    Note that the D3DXCreateEffectFromFile takes flags which are needed to debug shaders with the Microsoft Visual Studio .NET shader debugger. Debugging vertex shaders requires either a reference device or software vertex processing. Debugging a pixel shader requires a reference device.

    The D3DXSHADER_FORCE_*_SOFTWARE_NOOPT flags set various source code debugging options. Setting these flags will cause slower rendering since the shaders will be unoptimized and forced into software. All that is needed to turn these flags on with the sample code is to uncomment the #define DEBUG_VS or #define DEBUG_PS line from near the top of the file. This will also force the device into software processing by adding some code to CMyD3DApplication::ConfirmDevices. See Shader Debugger for more information about debugging shaders.

    In CMyD3DApplication::Render, the sample sets the technique to use with a call to ID3DXEffect:etTechnique and passes a D3DXHANDLE to the technique that was obtained upon initialization with a call to ID3DXBaseEffect::GetTechniqueByName. It is possible to pass a string name instead of a handle, but using a handle improves performance since this high frequency call does not have to spend time on a string compare.

    The sample then sets variables used by the technique such as the World*View*Projection matrix and the time variable with various ID3DXEffect:et* calls. To render, the sample calls ID3DXEffect::Begin which returns the number of passes required by the technique, then loops through each pass calling m_pEffect->Pass(iPass) and rendering the mesh with ID3DXBaseMesh:rawSubset. When all the passes are done, it calls ID3DXEffect::End.
    Hmm, they do more than that in the code, and they don't mention it. :?

  7. #7

    Very very simple Shaders with Clootie?

    Quote Originally Posted by Clootie
    By using ME as a shader?.. :shock:
    I think there is a confussion with your name and the units you wrote... what's the name of those units? I thought it was Clootie too :shock:

  8. #8

    Very very simple Shaders with Clootie?

    When you probably should start from generic description of DXUT framework...
    There are only 10 types of people in this world; those who understand binary and those who don't.

  9. #9

    Very very simple Shaders with Clootie?

    Quote Originally Posted by cronodragon
    Quote Originally Posted by Clootie
    By using ME as a shader?.. :shock:
    I think there is a confussion with your name and the units you wrote... what's the name of those units? :shock:
    Something like Clootie's DirectX headers; MS DXUT / D3DFramework adaptation for Delphi?
    There are only 10 types of people in this world; those who understand binary and those who don't.

  10. #10

    Very very simple Shaders with Clootie?

    Now that's a name... somehow I prefer to call them Clootie :lol: It sounds like a friendly name.

    I found this, but it's for Low Level Shaders:
    http://www.flipcode.com/articles/article_ps20tut.shtml

    (hmmm, I thought Flipcode was dead.)

Page 1 of 2 12 LastLast

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
  •