Compiling shaders

This is a discussion on Compiling shaders within the Game Programming forums, part of the General Programming Boards category; I've looked on MSN all day and night to no avail. Has anyone been able to use the MSVC 6 ...

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590

    Compiling shaders

    I've looked on MSN all day and night to no avail.

    Has anyone been able to use the MSVC 6 IDE to compile shaders using fxc? It would be nice if the IDE would let me specify a compiler for the current file and use that as well as it's error reporting.

    I shudder to use fxc from the command line because debugging a shader is going to be like trying to code in C using a command line compiler. Not cool.

    How am I supposed to debug these shaders? Do I have to do it outside of the IDE and are there any extensions in the DX9-12-10-2005 extras to do this for me?

    I have two help files on my system now. I have the entire DX9 SDK and the DEC 05 update. Obviously they are not the same. It seems the DX has been updated, but other things like DirectInput (now XInput), DirectShow, etc. have not. So I use the help for DX9 and D3DX from 12-10-2005 and the older helps for the other portions of DX?

    What a version hellhole they've created.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    It seems that the shader debugger is only available through VS .NET. Guess I'll have to upgrade. It would be nice if we could use shaders as part of our project and specify fxc.exe to compile them (or even a Cg compiler).

    I'm sure that's not far off with DX10 being purely shader oriented. But my card only supports VS 1.3 and PS 1.3, so I guess it's time to skip rent and upgrade the card.

    The only way to use shaders so far in DX I've found is:
    D3DXCompileShader()
    D3DXCompileShaderFromFile()
    D3DXCompileShaderFromResource()

    or through the Effects framework.

    UPDATE:
    This article may be of some interest:
    http://www.cc.gatech.edu/grads/z/How...sualStudio.htm

    Perhaps I can do this for HLSL in VS.

  3. #3

    Join Date
    May 2005
    Posts
    1,041
    I do not have enough knowledge about the topic to be able to issue an adequate answer.

    I thought I'd at least say that because otherwise I don't think anybody here'd respond
    I'm not immature, I'm refined in the opposite direction.

  4. #4
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I'm getting a new graphics card this week. Then I can actually play Quake 4 and CoD2.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Well I've got to get a jump on this shader stuff since DX10 will be pure shaders. So I might as well become the NOOB again and hit it hard so I don't get lost in the technology tornado that is approaching.

    I have 3 books on shaders and have ordered one more from amazon. Also Frank Luna has a new book coming out and he does more with his terrain rendering, although I think I know how to do the frustrum culling already. I cannot do models yet because I simply suck at creating them and Blender is a bugger to use.

    So I must face it that I'm an engine programmer and alas I need a modeling dev team to work on models for me. Hey you can't be good at everything.

    Thank God the days of programmer's attempting to do the voice acting in their own game have long since past. We might be good programmers but that doesn't mean we are good actors, artists, modelers, or even story board people. Maybe just maybe that's why the credits list for a game is so long.

    And this Zelda clone has taught me one thing. Estimating how long it will take to implement this or that feature is definitely a lost art. And I so suck at it.

    And I hope this board is prepared for the literal onslaught of DX10 related questions on how to do lighting and the like. DX10 is going to be pure shaders, no more fixed function pipeline. So you will have to learn HLSL to even transform your vertices. We will get swamped with these types of questions. I've a feeling OpenGL may move in the same direction as well.
    Last edited by VirtualAce; 01-18-2006 at 09:30 AM.

  6. #6

    Join Date
    May 2005
    Posts
    1,041
    The OpenGL 2.0 specification is pretty much just that: it lets you use built in lighting but it's biased towards programming the graphics pipeline with vertex/fragment programs, and it has a bunch of other stuff (GLSL specification, two-sided stencil buffer for shadowing stuff, etc).
    I'm not immature, I'm refined in the opposite direction.

  7. #7
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    I think HLSL and GLSL will prove to be much easier once we all get used to it. I love the fact that you can do very complex operations in one line of code via data swizzling in the asm shader code that results.

    All muls, subs, etc, operate on 3 to 4 values at a time which is extremely powerful. Games are going to really start looking life-like as we approach this new era of computer graphics.
    I'm very excited about it, but it is going to cause me to re-think my design and re-think engine architecture. It's also going to require yet more research and reading to get it down pat.

  8. #8
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I've got pretty much 0 experience game programming, but that thing about DX10 being pure shaders sounds quite interesting. Applications are just going to look better and better, which (I guess) is a good thing for the industry - I certainly know I like (almost prefer) a game with kick-ass graphics, as well as good gameplay.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    I believe that we will quickly see a few libraries of shader programs that implement common tasks. It might even come with the APIs (D3DX or GLUT). Not everyone wants to program the shaders.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. shaders: directx/opengl
    By Raven Arkadon in forum Game Programming
    Replies: 5
    Last Post: 08-24-2006, 09:19 AM
  3. Problem Compiling
    By Flakster in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 01:09 AM
  4. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 01:24 PM
  5. Pixel Shaders.
    By Cheeze-It in forum Game Programming
    Replies: 1
    Last Post: 05-21-2002, 01:16 AM

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