Thread: pixel by pixel graphics, what's the name of this technique?

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    42

    pixel by pixel graphics, what's the name of this technique?

    A few days ago I was talking with a demo scene enthusiast and he mentioned this piece of software that runs a given function on every single pixel of a bitmap at a given framerate rate, 30fps for example.

    He refered to it as a 'shader' but wikipedia has a different definition for 'shader'. What's the name of such a program?

    It appears to be rather trivial to implement, should also be quite easy to parelelize in a gpu with modern technologies such as CUDA.

  2. #2
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    I have made a few programs that did pixel by pixel shading and I refered to them as shaders/image editors as well. Are you trying to shade 3d space or a 2d bitmap?
    Virtual reality hello world http://www.rodneybrothers.com/vr/vrh...rld/index.html in html and javascript.
    Viewable with dodocase, google cardboard, OR, and other compatible VR gear.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    42
    2d bitmap.

    however, the 3d graphics out there, must be rasterized at some point to my 2d screen. Is this usually left to the graphical card? Is this what is commonly refered as '3d acceleration'?

    Just trying to get abetter understanding of present day graphics technologies.

  4. #4
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    Yea I would say best left to graphics card. If you want to get into 3d shading you can look into HLSL (high level shader language). It's pretty straight forward, but I wouldn't suggest it until you understand the main 3d concepts such was world, perspective, and view matrices. I found a really good tutorial on this a few weeks back ill post the link in a few when I get to my laptop.
    Virtual reality hello world http://www.rodneybrothers.com/vr/vrh...rld/index.html in html and javascript.
    Viewable with dodocase, google cardboard, OR, and other compatible VR gear.

  5. #5
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    I used this one

    Our First Shader: Ambient Lighting - RB Whitaker's Wiki

    Though it is orientated towards having Visual Studio 2010 Express and Game Studio 4.0

    Download | Microsoft Visual Studio 2012
    Download Microsoft XNA Game Studio 4.0 from Official Microsoft Download Center

    It is microsoft specific if you don't use windows then I think GLSL (openGL) is the alternative though I have no familiararity with it.
    Virtual reality hello world http://www.rodneybrothers.com/vr/vrh...rld/index.html in html and javascript.
    Viewable with dodocase, google cardboard, OR, and other compatible VR gear.

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    If you were talking to a demo person, then that person actually understand graphics. The number of these people becomes fewer and fewer.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    A program that operates on texels is a shader in modern graphics terms. Nothing in modern graphics touches pixels save the video card itself. No one is accessing the linear frame buffer directly (Windows XP, Vista and 7 all puke on this). However the term shader can be a bit deceptive. Shaders actually do far more than just manipulate texels. Shaders can be used to create geometry, transform geometry and manipulate texels at the texel level. Shaders can also be used to compute or run a host of other algorithms that are best left to the matrix-based mathematics of modern video cards. In DirectX9 era shaders were composed of a vertex shader and a pixel shader. Since then more types of shaders have been added like the geometry shader and compute shader.

    Vertex shaders are responsible for transforming the geometry from local space to world view projection space. However they can be used to transform from any one space or coordinate system to any other space or coordinate system provided the math is correct. Vertex shaders is also where vertex texturing and vertex displacement is performed. For instance it is possible to render an entire world of terrain with one mesh displaced in the vertex shader based on a heightmap. The output for a vertex shader is passed into the pixel shader sans positional info.

    Pixel shaders are responsible for outputting a single color. This color can be derived from any type of mathematical formulas one desires. You can produce exposure, color cycling, sepia, film grain,...etc. This list goes on.

    Shaders are used to produce effects in games but they are also used for hierarchical animation. They are also used for various post-processing effects like bloom, hdr, etc. As well with deferred lighting they are used to produce the final illumination and appearance of the scene.

    Microsoft XNA requires C# and is not compatible with C++ (save the math library). If you want to mess around with graphics and games in C++ you will need the latest DirectX SDK or the latest OpenGL libraries and documentation. XNA is fine if you want to use C# but keep in mind it is not as fast as DirectX or OpenGL. However the mathematics behind XNA and those used within XNA are the same as DirectX and OpenGL and align with the fundamentals of computer graphics.
    Last edited by VirtualAce; 12-14-2012 at 07:09 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pixel's
    By cgod in forum C++ Programming
    Replies: 3
    Last Post: 03-20-2005, 04:19 AM
  2. Creating pixel graphics in MFC
    By Kristian25 in forum Windows Programming
    Replies: 2
    Last Post: 01-09-2003, 01:39 PM
  3. ...i have a pixel...
    By Sebastiani in forum Windows Programming
    Replies: 1
    Last Post: 09-06-2002, 04:17 PM
  4. Set a pixel...
    By tigs in forum C Programming
    Replies: 16
    Last Post: 08-06-2002, 01:27 PM
  5. Pixel...
    By Vicious in forum Game Programming
    Replies: 12
    Last Post: 05-29-2002, 03:12 PM

Tags for this Thread