Shaders

Started by
14 comments, last by biovenger 20 years, 8 months ago
Alright, I''ve heard a lot about the enigma and need to know how. Of course, I don''t want any code or such, just a few precious links, maybe a few pointers in the right direction. I know the theory behind the shaders, somewhat anyway. A shader is an alternate way to render things through the normal "pipe", right? Well anyhow, I am using OGL right now and just need to see an article or a quick tip on how to initialize shaders and preferably a list over the existing shaders. If it is possible.
-----------------------------Final Frontier Trader
Advertisement
There are lots of docs and such at the nvidia developer site.

http://developer.nvidia.com/page/developer_home

Hope this helps. Try doing a google search for "opengl vertex program tutorial" or similar also.

Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
OK, links to shader resources:

Humus's Site - This lucky guy spent a lot of time at ATi recently, and has some truly cutting edge demos on his site.
NVIDIA's CG Language - C for Graphics, a high-level language for creating impressive shaders which run on a very wide range of hardware.
ARB_fragment_shader - A full description (from the SGI Extensions Repository) of the ARB_fragment_shader extension.


Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]

[edited by - iNsAn1tY on September 2, 2003 11:21:58 PM]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
quote:Original post by iNsAn1tY
OK, links to shader resources:

Humus''s Site - This lucky guy spent a lot of time at ATi recently, and has some truly cutting edge demos on his site.


What do I need to run the demos of the site above?? I have a GeForce4Ti 128Mb.

LizardCPP

I believe that you''ll need a GeforceFX or a Radeon 5900 to run some of Humus''s demos. They really are the very latest stuff. Most of the demos on the main page don''t work on my Geforce 3. You need support for ARB_fragment_shader.

One thing you could try is NV30 emulation. It''ll run slow as hell, but it''ll work. Head over to NVIDIA''s site and look it up...


Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You''re Already Here | The Best Film Reviews ]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Insanity: I think you mean ARB_fragment_program. ARB_fragment_shader is part of the new OGLSL specification, and it's not supported yet except on high end 3Dlabs cards.

ARB_vertex_program would probably be a good thing to learn too.

Both of these are supported on all DirectX 9 capable hardware AFAIK.

[edited by - benjamin bunny on September 3, 2003 8:53:02 AM]

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

Thanks for all the info.

Although, one last question, Cg, nVidia''s language, how does it work regarding integration with C++?
-----------------------------Final Frontier Trader
Programs written in Cg are compiled using the Cg runtime lib, or alternatively compiled to fragment programs before execution.

You can specify uniform parameters such as light position, shininess etc with Cg or OpenGL functions from your C++ program.

Varying parameters such as depth, position and colour are sent along the pipeline in the usual way, with values output from vertex programs being interpolated between vertices to give the fragment_program input values. You just set these using glColorf or whatever when you specify the vertices.

AFAIK the Cg runtime is the best option, since it makes setting parameters easier, and allows you to compile a program for specific hardware if necessary.

____________________________________________________________
www.elf-stone.com | Automated GL Extension Loading: GLee

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

quote:Original post by benjamin bunny
Insanity: I think you mean ARB_fragment_program. ARB_fragment_shader is part of the new OGLSL specification, and it''s not supported yet except on high end 3Dlabs card.
Bugger. Note to self: check extension wording.

Another good thing about Cg is that if you download Everything.zip from the Cg Downloads Page, you get the compiler, a viewer, and a whole bunch of ready-made shaders which demonstrate everything from bumpmapping to cel shading to shadowmapping. They''ve been very useful to me in understanding how Cg works. It''s a huge download (around 263MB), but like it''s name suggests, it has everything you need. If that download''s too big, you can download just the bits you need...


Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You''re Already Here | The Best Film Reviews ]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Thanks for all the replies, there is however one last thing I don''t understand...

If I compile a program with the Cg runtime library, what kind of output does that provide? Also, how would I then call the program from my engine to alter the pipeline?

Another thing... It is a question that has been nagging me, but probably is very stupid. What is the advantage in coding shaders in Cg, aren''t programs in normal C++ just as efficent? All the code in the Cg examples seems just like normal C++ code with a little different syntax.
-----------------------------Final Frontier Trader

This topic is closed to new replies.

Advertisement