Questions tagged [pixel-shader]

Pixel shaders, also known as fragment shaders, compute color and other attributes of each fragment. Pixel shaders range from always outputting the same color, to applying a lighting value, to doing bump mapping, shadows, specular highlights, translucency and other phenomena.

Pixel shaders, also known as fragment shaders, compute color and other attributes of each fragment. Pixel shaders range from always outputting the same color, to applying a lighting value, to doing bump mapping, shadows, specular highlights, translucency and other phenomena.

They can alter the depth of the fragment (for Z-buffering), or output more than one color if multiple render targets are active.

In 3D graphics, a pixel shader alone cannot produce very complex effects, because it operates only on a single fragment, without knowledge of a scene's geometry. However, pixel shaders do have knowledge of the screen coordinate being drawn, and can sample the screen and nearby pixels if the contents of the entire screen are passed as a texture to the shader. This technique can enable a wide variety of two-dimensional postprocessing effects, such as blur, or edge detection/enhancement for cartoon/cel shaders.

Pixel shaders may also be applied in intermediate stages to any two-dimensional images in the pipeline, whereas vertex shaders always require a 3D model. For instance, a pixel shader is the only kind of shader that can act as a postprocessor or filter for a video stream after it has been rasterized.

310 questions
0
votes
1 answer

Error when writing a very simple HLSL pixel shader

I am writing I SlimDX application to test color contrast sensitivity thresholds of the human visual system. The subject is presented with a large letter that is at low contrast with with the background and asked to identify the letter. However I…
Alexander Van Atta
  • 870
  • 11
  • 34
0
votes
0 answers

Can the position of pixel be changed from Pixel Shader in XNA 4.0?

I need to change the position of each pixel: ex. (33,30) -> (40,55) and so on. Can it be done inside Pixel Shader in XNA 4.0?
ali
  • 529
  • 4
  • 26
0
votes
1 answer

How to pass a Texture2D object to Pixel Shader in XNA 4.0?

I want to capture each frame and change the position of each pixel according to a lookup table. So for example pixel (30,35) -> (40,50) and so on. So what I have done is to capturing a frame by RenderTarget2D and going through each pixel and set…
ali
  • 529
  • 4
  • 26
0
votes
2 answers

pixel bender 4-color shader

I have no experience with Pixel Bender, and shading languages seem like gibberish to me, so I was wondering if anybody could help me rewriting the following as3 code to function as a Pixel Bender filter/shader. The way it works is that I want to…
Johannes Jensen
  • 1,228
  • 2
  • 18
  • 28
0
votes
1 answer

How to get SamplerProperties of a ShaderEffect in wpf?

In WPF, when defining ShaderEffects, we use ShaderEffect.RegisterPixelShaderSamplerProperty() to introduce pixel shader sampler properties (the ones that are fed to the actual pixel shader, and are of type Brush); but how can these properties be…
Arash
  • 203
  • 1
  • 8
0
votes
2 answers

PixelShading in C#

I hope I do not make my first mistake with my first post. I am writing a library for several graphical effects and filters (for example Sobel or Gauß mask). Because of the low Speed, doing this on the CPU, I wrote some shaders with the Shazzam…
Simon Rühle
  • 229
  • 3
  • 12
0
votes
1 answer

CGFX shader outputing vert data multiple times

How can I output something from the vertex shader to the pixel shader multiple times. Eg I need to output the vertex color as a float 4 to the pixel shader 4 times after performing some different math operations on the vertex color in the vert…
fghajhe
  • 239
  • 1
  • 2
  • 8
0
votes
2 answers

Transparent objects covering each other

For an academic project I'm trying to write a code for drawing billboards from scratch; now I'm at the point of making them translucent. I've managed to make them look good against the background but they still may cover each other with their…
kamilk
  • 3,829
  • 1
  • 27
  • 40
-2
votes
1 answer

GLSL shader to boost the color

Is their any GLSL shader that can help me to "boost" the color of a texture ? How to write such shader ? I would like to do something like the picture below :
zeus
  • 12,173
  • 9
  • 63
  • 184
-2
votes
1 answer

Using pixel shader to perform fast computation?

I wish to run a very simple function a lot of times. At first I thought about inlining the function (its only four lines long), so I figured that placing it in the header will do that automatically. gprof said that was a good idea. However I heard…
AturSams
  • 7,568
  • 18
  • 64
  • 98
1 2 3
20
21