Thread: Where to get started with directx shaders

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    Where to get started with directx shaders

    I have been wanting to program pixel and vertex shaders using c++ and hlsl and I've gotton them to work using examples posted here:

    http://www.codesampler.com/dx9src/dx9src_8.htm

    But I don't know how to move forward. The language is awkward and strange honestly, and I just want some more resources on this stuff.

    Does anyone have any advice about web resources and even books that I can get? because I just need to get this stuff straight

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    HLSL is about as close to C/C++ as you can get. In fact more and more keywords are becoming reserved so I'm hoping for object oriented shader code to pop up very soon.

    Getting good books like the ShaderX series or other books about shaders is a very good place to start.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    70
    Speaking of ShaderX2, it's out of print and now free for download off of GameDev.net.
    http://www.gamedev.net/reference/pro..._DirectX_9.pdf

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Wow, and X2 is the introductions and tutorials one Great!

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

  6. #6
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    So I'm making the conversion into the world of shaders, and it seems that all my lighting code must be implemented as shader effects now? It seems to kill all of my primitive lighting code when I use the effect passes. I'm just confused, I haven;t read any books or anything yet but it seems weird already

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    70
    Pretty much. Luckily ShaderX2 has a couple chapters on this. The advanced lighting and shading chapter deals with light on objects. I would use shadow maps for relatively easy shadows, and there is another chapter on that.

    edit:
    I was going through the shadow maps chapter, and he doesn't use HLSL. You could probably find an example of a HLSL implementation in the DXSDK.
    Last edited by Drac; 03-12-2009 at 09:34 AM.

  8. #8
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    www.humus.name

    A lot of his demos are implemented with HLSL. Might be useful - it was to me with GLSL.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  9. #9
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Thanks, I definitely started reading into the x2 intro book, it's really good!

    I swear I was gonna bug you guys until no end about how I was having so many misunderstandings but I figured it out, haha. I like the first chapter of the shader x2 intro, it had an explanation of varying input/shader output which was messing with me, it's a really good introduction!

    Anyways, I'm havin fun with this, screenshot :P

    Attachment 8762

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. shaders: directx/opengl
    By Raven Arkadon in forum Game Programming
    Replies: 5
    Last Post: 08-24-2006, 09:19 AM
  2. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  3. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  4. Help in getting started with DirectX
    By dxfoo in forum C++ Programming
    Replies: 2
    Last Post: 10-22-2005, 08:43 PM
  5. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM