Home Technical Talk

Pixel Shaders?

JordanN
interpolator
Offline / Send Message
JordanN interpolator
I'm very new to 3D graphics so excuse my lack of knowledge.

So from what I understand, there does exist a technique that modifies each polygon's/sprite's colour at an individual pixel level. So in theory, it should be possible to tell a computer to colour each character/object as according to a concept art right?
Mve0Weh.jpg

However, I assume there are limitations right? For example, what if the camera rotates? Do you have to set up values for each possible position? Also, how performance heavy is it? Also, how do you know to use pixel shaders and not other rendering techniques?

For example, say I wanted to render this glass cup as close to the real thing as possible? Would you use pixel shaders, ray tracing, some kind of material shader, a whole combination of them or what?
BFXT9tO.jpg

Replies

  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    Hi

    to make this more easy, please tell us what you know about 3d graphics, and what you want to do with it. because creating 3dmodels from concepts and rendering a realistic glass is are 2 very different things
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    I know shaders are associated with things such as normal maps which are RGB images saved from high polygon meshes. I've also rendered scenes before in a 3D programs but I didn't truly understand what I was doing (I did a Global Illumination pass with soft shadowing on a model of a Hourglass and it gave me options like how many times to sample the scene).

    I guess what I'm trying to say is, like how the concept art has all the colours nailed down, can pixel shaders take that information and interpret it in a scene that already has models and textures? Like how the characters in the Toy Story art are very brightly lit from the back, does there exist a shader (or could I make one) that does the same thing but with models?

    Or with the glass, the rims specifically refract light realistically. Can I do the same (through a shader) for a 3D Glass model?
  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    well thats a hard one.

    basically a pixel shader is a program that is executed on specialized hardware (gpu) wich utilizes alot of hardware functions, to speed things up.

    you could execute shaders ion the cpu too, but thats slower.

    to change the apperience of the whole scene, you usually use deferred shaders (which is also a pixelshader, but applied to the images produced by the renderer) you can do pretty much everything that computergraphics can do in deferred shaders, but the more complex it gets, the slower it executes.

    so basically you could write a raytracer in a deferred shader , with the renderer objects being part of the shader.(but thats some very specialized stuff)

    i redomend this site:
    http://www.iquilezles.org/
    it contains alot of information about shader programming and algorithms

    hope this helps
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Interesting. So the pixel shader is not what actually lights/modifies a scene but it's deferred shaders?

    I think I found something to better get my point across. I remember Valve released a thesis about the lighting in TF2. You see how the character has "rim lighting" and that it specifically targets "edges" of the body? That's something I want to do. But instead of it always being "rim lighting" it could be "glass refracting" or "backlighting".
    5vNOnnr.png

    Does that mean I'm going to have to take up programming to achieve what I'm talking about? I was hoping these things already existed in 3D programs and that I could make modifications from there.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    it means you're going to need to read some books.

    if you're wanting to render stills / video then the chances are you can do what you want in one of the major offline renderers already . if you want it in a game engine then you're probably going to need to get your hands dirty to do anything very specific.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    I would say UDK is good for this. But you need a "basic" knowledge about shaders and UDK materials if you want to make similar things.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    poopipe wrote: »
    it means you're going to need to read some books.

    if you're wanting to render stills / video then the chances are you can do what you want in one of the major offline renderers already . if you want it in a game engine then you're probably going to need to get your hands dirty to do anything very specific.
    Can you explain what you mean by "get your hands dirty"?

    Obscura wrote: »
    I would say UDK is good for this. But you need a "basic" knowledge about shaders and UDK materials if you want to make similar things.
    Do you know any links to get me started?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    UDK material examples:
    http://udn.epicgames.com/Three/MaterialsCompendium.html
    Custom lighting in UDK (this is what you need if you want to make your "own shader"):
    http://udn.epicgames.com/Three/CustomLighting.html
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Good luck with it.
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    The rim lighting should be acheivable with the fresnel node in UDK
Sign In or Register to comment.