Jump to content
  • Advertisement
Sign in to follow this  
CastorX

Shaders

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HY! I have a GF4 Ti4200 (supports: VS1.1, PS1.3), and i would like to write HLSL programs. I've tried to write in ps 1.3. Q1: in a tutorial was this: (PS 1.3) PS_OUTPUT RenderPST(float2 TextureUV : TEXCOORD0,float3 Normal : TEXCOORD1) { PS_OUTPUT Output; Output.RGBColor = tex2D(DiffuseTexture, TextureUV.xy)*dot(lDir,Normal); Output.RGBColor.w=1.0f; return Output; } Why is the normal declared as TEXCOORD1? I cannot create specular mapping, there is allways an error, if I put a new tex2D(...) into the 4th line, or I multiply it with the RGBOut parameter. Q2:With the :NORMAL it's unable to comply.Is there many differences between the PS 1.3 and the PS 2.x? Q3/4:Does it worth to by a new vidocard, if I want to program in HLSL? Can I put an AGP16x card into an AGP4x motherboard? Or I must to by a new MB, I dont want to spent too much money. Bye!

Share this post


Link to post
Share on other sites
Advertisement
Its declared as texcoord, since afaik ps accepts only texcoords as inputs (and colors). Also, in old hardware - your case - inputs are clamped to 0-1 range.

You should be able to perform up to 4 texture lookups in ps_1_3 and up to 8 arhmetic operations ( more precisly - 8 asm instructions).

And yes, its worth to buy new card. There is vast difference between ps 1_x and 2_x. According to docs:

ps_1_4: 6 texture + 8 arithmetic per phase

ps_2_0: 32 texture + 64 arithmetic

ps_2_x: 96 minimum, and up to the number of slots in D3DCAPS9.PS20Caps.NumInstructionSlots. See PS20Caps.

ps_3_0: 512 minimum, and up to the number of slots in D3DCAPS9.MaxPixelShader30InstructionSlots. See PS20Caps.

----

Also you get more input registers, they are not clamped and you get code branching in vs.
And yes - you can use video card with slower. I was using 8x with 4x MB. No problem. But slower.

Share this post


Link to post
Share on other sites
when you write shader you can use every data as you want.
Vertexshader must return at least a float4 with position usage. After that you can fill any data as you want. Usually the programmer use texturecoordinate to pass data from vertex to pixelshader. They are only number, you can use them for every calculation that you want to use. In this case he want to calculate light in pixel shader and then use texturecoordinate1 as a normal.

the difference from 1.3 to 2.0 are a lot from lenght of the code (up to 64 instead of 12) to instructions (like the possibility to use any type of vector as texturecoordinate).

a modern videocard is better for programming (now there are video card with pixel shader 3.0 at lowprice).

yes, if you want to use pci-express videocard you must change mobo. There are a lot of videocard that use agp (also nvidia 6800GT) and then work but the best is to use pce-express for performance.

Share this post


Link to post
Share on other sites

True, AGP 16x is PCIe... im too old for all this :D
RobyDX is right - you cant fit pcie card into agp port. Except while using a big hammer. But if you sell your old MB and video, switching to pcie bases system should be cheap.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!