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.

314 questions
0
votes
1 answer

Per Instance Textures, and Vertex And Pixel Shaders?

How do you implement per instance textures, vertex shaders, and pixel shaders, in the same Vertex Buffer and/or DeviceContext? I am just trying to find the most efficient way to have different pixel shaders used by the same type of mesh, but colored…
e.s. kohen
  • 213
  • 1
  • 3
  • 20
0
votes
1 answer

How does pixel shading work for ambient occlusion volumes?

I'm trying to understand the ambient occlusion technique described here, but I've trouble comprehending what exactly is the pixel shader doing. Is the pixel shader invoked on points that belong to the surfaces of occlusion volumes? Can anyone…
pbp
  • 1,391
  • 14
  • 27
0
votes
1 answer

Scriptable image manipulation

I'm desperately in need of some software. What I'm looking for is some type of image editor that has support for pixel level manipulation by means of some type of scripting language (think HLSL/GLSL pixel shaders.) Requirements: Access to pixel…
Chris_F
  • 3,780
  • 4
  • 27
  • 44
0
votes
1 answer

WP8 Image processing with pixel shader

Is there a way to perform this in XAML app?
Artem Flotsky
  • 29
  • 1
  • 6
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
  • 820
  • 10
  • 33
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
  • 412
  • 4
  • 21
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
  • 412
  • 4
  • 21
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,128
  • 2
  • 16
  • 27
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
  • 194
  • 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
  • 1
  • 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
  • 229
  • 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,043
  • 1
  • 23
  • 36
-1
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
  • 6,416
  • 14
  • 53
  • 91
-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
  • 9,795
  • 5
  • 45
  • 112
1 2 3
20
21