Debugging shader

Posted By: Rigoletto

Debugging shader - 09/27/05 20:06

Hi,

it is possible to debug shader i 3dgs? If yes, how? I try to write a perlin noise function but it donīt works and i canīt see why!

Also the noise function from hlsl seems not to work, it is listed on the microsoft pages but other sites say it is not implementet yet.
Posted By: ello

Re: Debugging shader - 09/27/05 21:31

the noise function does something, but i cant figure out exactly what, yet.
it seems like it generates only 0 or 1 , randomly

debugging can only be done manually i think. if there are errors then most of the time there is a precise description given the linenumber..
if you just dont see something than its up to you to figure whats wrong
Posted By: Rhuarc

Re: Debugging shader - 09/28/05 00:12

Noise is for texture shaders.... not really pixel shaders...
Quote:

What is the HLSL noise() intrinsic for?

The noise intrinsic function generates Pperlin noise as defined by Ken Perlin. The HLSL function can currently only be used to fill textures in texture shaders as current h/w does not support the method natively. Texture shaders are used in conjuction with the D3DXFill*Texture() functions which are useful helper functions to generate procedurally defined textures during load time.



- DirectX C++ Documentation.
Posted By: Matt_Aufderheide

Re: Debugging shader - 09/28/05 02:24

To first step in debugging a shader is to first define what the problem is.. do you get compiling errors?

If you get compile errors its pretty easy to track that down,. normally the error window will pop-up telling where the error is and in what line.

If you dont get compile erros and the effect just looks wrong, then you have a logic problem.

To fix logic problems is the hardest thing, but not so hard with simple programs like shaders. First comment out most everything in the shaders and just make it as simpe as possible. Then start adding in stuff, and keep doijg this until the result is not as expected.
Posted By: Rhuarc

Re: Debugging shader - 09/28/05 02:26

Quote:

To first step in debugging a shader is to first define what the problem is.. do you get compiling errors?

If you get compile errors its pretty easy to track that down,. normally the error window will pop-up telling where the error is and in what line.

If you dont get compile erros and the effect just looks wrong, then you have a logic problem.

To fix logic problems is the hardest thing, but not so hard with simple programs like shaders. First comment out most everything in the shaders and just make it as simpe as possible. Then start adding in stuff, and keep doijg this until the result is not as expected.




That right there perfectly describes my debugging process

-Rhuarc
© 2024 lite-C Forums