Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / What really are shaders?

Author
Message
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 21st Dec 2003 21:00
I understand what polygons, edges, verticies and textures are. I understand bump mapping. I have a good understanding of 3D world coordinates etc.

What I can't seem to figure out is this: What are shaders? I've seen examples of what they can do on Nvidia's and DBPro's website.

Is it a piece of code that describes the surface of material but doesn't acually have a texture? What the difference between pixel and vertex shaders?

Success does not come with meeting the minimum requirements.

Visit Chromaware Interactive Studios @ www.chromaware.com
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 21st Dec 2003 22:49
Pixel Shaders make objects look beautiful (here's an screenshot from morrowind)




Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Dec 2003 23:12
As I understand it......

Pixel shaders change the appearance (think of them as a programable texture)

Vertex shaders change the shape (think of them as programs that animate the shape)

The vertex and pixel shaders often work together,look at the bubble shader example in the help files, it undulates because the vertex shader (a program realy) cycles the shape to make it move like a bubble, and the appearance is altered by a pixel shader, the two work in unison to give that reflective-transparent-wobbly bubble effect where the highlight moves about.

You can make 400 bubbles as simply as making 400 spheres and adding the shader to them (pity the shader ignores the z buffer....it seems to have a programming error) , as for where you get them, try Nvidia`s dedicated shader site and ATI`s site may have some, there are also shader sites that talk about and display demo`s of nothing but shaders.

AFAIK you need to make a few alterations to make them work in DB, but it`s just altering a few of the initial lines or something, (not tried em myself yet...apart from the DB examples).

The reason you get the shader to do the work rather than the program or running an animation, is that the GFX card has specialised registers and mini cpu blocks just for handling colour and 3D data that mean the GFX card can take all the load out of handling the shapes automaticaly, and the PC can get on with running the game.

Also the card may have a slower GPU clock speed than your PC`s CPU but it can do the calculations faster than any CPU could do since it is made just to do 3D and colour, the CPU couldn`t even come close to the speed of the GPU on a graphics card (think of how much slower and worse software renderd images are compared to what the same images look like rendered on even a pretty basic ATI or Fx card)

Some of the video card researchers are currently developing cards that will do realtime raytraceing (caustics and refraction etc) in the hardware, as well as including instruction sets to allow them to handle physics and collision from properties supplied to the shader data for that shape, that should increase the speed and realism of the next-but-one generation of cards even further.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 1x160Gb HD (using 2 overheats ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800 128mb.
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 22nd Dec 2003 00:36
I was able to open a .fx file in notepad and see the code. Now I understand the basics...Very cool thanks!

Success does not come with meeting the minimum requirements.

Visit Chromaware Interactive Studios @ www.chromaware.com
Darkflame
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location:
Posted: 24th Dec 2003 22:23
Quote: "AFAIK you need to make a few alterations to make them work in DB, but it`s just altering a few of the initial lines or something, (not tried em myself yet...apart from the DB examples).
"


This is the bit I get stuck on....what alterations?
Its not documented anywhere i can find, i really dont get how people are using these things.

"The man who says it cannot be done is generally interrupted by someone doing it." ~ Elbert Hubbard
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 25th Dec 2003 18:46
What is the URL to Nvidia's shader site? I can't find it..

Success does not come with meeting the minimum requirements.

Visit Chromaware Interactive Studios @ www.chromaware.com
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 25th Dec 2003 22:12
out of those two screenies i like the bottom one better... it fits in so much more witht the rest of scenery, it does look almost real but it seems to broken up and distracting.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Dec 2003 22:26 Edited at: 25th Dec 2003 22:32
http://developer.nvidia.com/page/home

and

http://www.cgshaders.org/

as for the modifications, you just need to alter the header a bit or something, it`s getting fixed in a later patch I think, it was mentioned on the forum a few times so if you can get the search to work then you may be able to find the thread.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800 128mb.
Eldar
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 7th Jan 2004 21:59
There are two different types of shaders, fragment and vertex. Vertex shaders operate on every vertex in a model and can change their position, color and normal. Fragment shaders operate on every pixel in the scene and can change each pixels color(some advanced porfiles can also change depth).

3.1 ghz Pentium 4
Geforce FX 5800 ultra @ 535/1300
DX 9

Login to post a reply

Server time is: 2024-09-21 15:47:09
Your offset time is: 2024-09-21 15:47:09