Advertisement

Learning pixel shaders...

Started by February 12, 2003 11:49 AM
5 comments, last by Hobbiticus 22 years ago
Where should I go? I have no idea where to turn to find information about such an advanced topic. I''m specifically looking for a resource that talks about the applications of pixel shaders for fluid rendering, as I want to apply it to the fluid render of the Torque game engine. Any help would be great. Legends Development Team
Legends Development Team
First of all, pixel shaders do not exist in the core of OpenGL. That is, you have to deal with extensions in order to get pixel shading capabilities.
Mainly, there is :
- NV_register_combiners for nVidia GeForce (also NV_texture_shader available on GeForce3 and GeForce4 Ti),
- ATI_fragment_shader for ATi Radeon 8000 series and higher,
- ARB_fragment_program for all recent hardware (Radeon 9700 and GeForce FX at least).

For other hardware, you can use extensions such as ARB_texture_env_combine and ARB_texture_env_dot3 which is widely supported but is pretty limited.

You can find many info at developer.nvidia.com and www.ati.com/developer.
Advertisement
Hmm..ok, so since I''ll be using extensions, and i have an nvidia card, this is gonna be a little difficult to port to an ati card... How willing do you think ATi would be about giving me hardware to develop on?

Legends Development Team
Legends Development Team
How willing ? hmm. not much I think.

If pixel shading effects can be rendered using ARB_texture_env_combine, ARB_texture_env_add, ARB_texture_env_crossbar, ARB_texture_env_dot3 and ARB_multitexture (ot other ARB extensions) you should stick to them since they''re supported on a very wide range or hardware. The only ARB extension you should escape is ARB_fragment_program which is too recent to be supported in hardware. As I said, only Radeon9700 and GeForceFX can use that extension today (well, nVidia released a software emulation but it is REALLY slow).

Then if you can afford different path, you can use NVIDIA''s and ATI''s vendor-specific extensions. In that case NVIDIA extensions will be easy to test for you. If want to test ATI extensions you either need to get a cheap ATI card or ask ppl here to test it for you.
The best way I think isn''t using extencions directly because you need to learn an assembly like language dificult to port from hardware to hardware.
The best way is using Cg from NVidea, that means C for graphics, and is a special compiler only for GPU''s, for compiling vertex and pixel programs.
The advantage is that you must learn an language that seems like C and is very protable since the program is compiled in run time for the especific hardware.....

Filami

Techno Grooves
Techno Grooves
Well, pixel shaders IS one of the things I''ll hopefully be learning and implementing, so there''s no way around the extensions, as far as i know. So, that''s probably going to be vendor specific.

Legends Development Team
Legends Development Team
Advertisement
It may sound ironic, but if you plan on releasing your software/game in 4-5 years you can afford to stick to the ARB_fragment_program extension. And it that case, the pixel shading becomes vendor-independant.

This topic is closed to new replies.

Advertisement