Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / Problems with dot3 cgShader on differend profiles Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

April 09, 2005, 08:26 PM


I've implemented a dot3 cgShader and it works fine on my GeforceGT 6800 with vp/fp40. But i've got several problems with running that shader on older hardware ...

After some tests i've figured out, that the fragmend program is the part which will not run. Here is my code:

  2. // input structure
  3. struct vert2frag
  4. {
  5.     float2 TextureCoords      :TEXCOORD0;
  6.     float3 TangentSpaceLightPos   :TEXCOORD1;
  7. };
  9. void main(const vert2frag IN, out float3 oColor:COLOR,
  10.         float4 AmbientLight,
  11.         float4 LMs : TEXCOORD4,
  12.         const uniform sampler2D NormalMap,
  13.         const uniform sampler2D DecalMap )
  14. {
  15.    // normalize Light
  16.    float3 normTangentSpaceLightPos = normalize(IN.TangentSpaceLightPos);
  18.    // Do Dot3 calculation (N.L)  (multiplication for more reflection)
  19.    float3 nmap= 2*(tex2D(NormalMap,IN.TextureCoords)-0.5).rgb;
  21.     //adding decal color (multiplication for better color results)
  22.    oColor = dot(, normTangentSpaceLightPos)*tex2D(DecalMap,IN.TextureCoords);
  23. }

On fp30 i got no compile failures but i see nothing. I've checked the code and it's rendered ... On fp20 i got the compile Error that normalize will not work ... but i can't belive that this simple and nesessary function will not work ...

Knows anyone whats happend and could help?
Thanks in advance,

This thread contains 1 message.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.