Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Shaders

This topic is 5372 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

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.

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!