PDA

View Full Version : Did you say fragment shaders?



vince
04-15-2003, 10:28 AM
Hi,

I implementes vertex shaders with no problem on both ATI Radeon 9700 and GeForce4 TI 4600, using the extension GL_ARB_vertex_program. That works fine. But when I try to use the extension GL_ARB_fragment_program, I get errors... I know both cards support vertex and fragment programs, so any idea why they appear like they dont support it? Calling glGetString( GL_EXTENSIONS ) does return GL_ARB_vertex_program, but not GL_ARB_fragment_program.

I tried CG as well and it doesn't appear to help at all. BTW, do you know if a program built with CG would run on an ATI card?

Thanks

titan
04-15-2003, 10:34 AM
Actually the only nVidia product supporting fragment programs is the GeForceFX and above. That's why your GeForce4 doesn't claim it supports it!

With more recent drivers from nvidia they included a GeForceFX emulator. So you can then run fragment programs on your GeForce4, just in software and therefore very slowly. You must turn on GeForceFX emulation first though.

The 9500+ support fragment programs, but only in recent drivers. Get yourself the latest drivers and you should see it listed in the extensions.

vince
04-15-2003, 10:57 AM
Hummm, I didn't think I was already outdated with my GeForce 4 TI4600. Anyway, I tried the emulator and it works. Thanks for the idea.

But unfortunately, I already have the latest drivers for the ATI and it still doesn't tell me the extension exist...

gstrickler
04-15-2003, 11:47 AM
Your GeForce4 will support the extensions GL_NV_texture_shader* and GL_NV_register_combiner* (could be more than one, thus the *). These extensions support fragment shaders, and in particular Cg shaders. They are limited in size, but they do work. I've implemented projective texture shadow casting with ambient lighting in the shadow this way.

Don't know about ATI.

vince
04-15-2003, 12:20 PM
I like the ARB extensions better since I develop for more than one card. But it's true NV has a few interesting extensions.

Humus
04-15-2003, 12:37 PM
The 9700 most definitely supports the GL_ARB_fragment_program, and has done so for quite some time. If the extension isn't exposed, then make sure you haven't done any tweaking with any tweaker apps that may have turned it off.