Where to get started with directx shaders

This is a discussion on Where to get started with directx shaders within the Game Programming forums, part of the General Programming Boards category; I have been wanting to program pixel and vertex shaders using c++ and hlsl and I've gotton them to work ...

  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

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    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!

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

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

    http://img7.imageshack.us/img7/440/greatsuccess.th.jpg
    Attached Images Attached Images  

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  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

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  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,070
    www.humus.name

    A lot of his demos are implemented with HLSL. Might be useful - it was to me with GLSL.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  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

    Name:  teef sm.JPG
Views: 186
Size:  59.5 KB

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

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, 06: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-24-2004, 11:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21