A program that runs on the GPU to determine output colors for pixels. Also known as a fragment shader.

learn more… | top users | synonyms (1)

3
votes
1answer
176 views

Multiple pixel shader passes

I currently have a pixel shader that calculates the texture and I have another that calculates the light. I want another shader that does both. What I would ideally like to do is instead of creating a ...
3
votes
1answer
305 views

How to access the nth element in a 2d texture from a pixel shader in XNA

How can I access the nth element in a texture2d from a pixel shader? For example if I wanted to get the 5th vector4 from 10 x 10 texture2d
1
vote
1answer
312 views

Pixel Shader - apply a mask (XNA)

I'd like to apply a simple few masks to few images. The first mask I'd like to implement is mask like: XXXOOO I mean, that on the right everything is masked (to black), and on the left everything ...
7
votes
5answers
2k views

What rendering techniques would I use to draw a drop shadow effect for cards in a card game?

What type of shading algorithm might be used to create shadows like these? the one I'm making is similar but it is all done with a 2D drawing API powered by OpenGL so there is no Z coordinate. In ...
2
votes
1answer
382 views

How to use Pixel Bender (pbj) in ActionScript3 on large Vectors to make fast calculations?

Remember my old question: 2d game view camera zoom, rotation & offset using 'Filter' / 'Shader' processing? I figured I could use a Pixel Bender Shader to do the computation for ...
5
votes
1answer
1k views

2D Line drawing with Pixel Shaders

Recently I asked a question, what is the fastest way to render 2D lines using DirectX, and one of the answers mentioned this paper on Fast Prefiltered Lines which uses Pixel Shaders to accomplish ...
3
votes
0answers
404 views

How to achieve supersampling / anti-aliasing in pixel shaders?

I am trying to write a couple pixel shaders to apply to images similar to Photoshop effects. For example this effect: ...
1
vote
1answer
415 views

Shader which supports vertex colors and pixel lights?

From my question at Unity Answers: Hello everyone, I'm facing a bit of a problem here: I need a shader which has the ability to colour individual vertices and be lit pixel by pixel. Until recently, I ...
1
vote
2answers
412 views

How to set multiple times, in a single spritebatch, the same pixel shader parameter

I make a test with Effect class in XNA and I want to set multiple times the same parameters (MyParameter in below code). My code is : [...] //In Engine class Effect ShaderEffect = ...
1
vote
2answers
159 views

Ward model implementation: specular component too weak

I'm trying to implement the Ward shading model, the anisotropic, computationally efficient version: This is how I made it: float alphaX=0.5, alphaY=0.5; // asinotropic roughness float ...
1
vote
1answer
234 views

Color grading, shaders and 3d textures

I'm trying to implement color correction with the 3d lookup table. The lookup table is actually just a 2d texture 256x16 and consists of 16 squares which one is 16x16. When it comes to rendering, I ...
1
vote
1answer
776 views

Volumetric Fog Shader - Camera Issue

I am trying to build an infinite fog shader. This fog is applied on a 3D plane. For the moment I have a Z-Depth Fog. And I encounter some issues. As you can see in the screenshot, there are two views. ...
0
votes
1answer
75 views

How does OpenGL determine different outputs with shaders?

Lets say I have this GLSL code: #version 330 out vec4 outputColor; void main() { float lerpValue = gl_FragCoord.y / 500.0f; outputColor = mix(vec4(1.0f, 1.0f, 1.0f, 1.0f), ...
0
votes
2answers
267 views

What does tex1D do with a 2d texture?

If I call tex1d from my pixel shader on a texture that has been initialized as a texture2d will it treat the data as a one dimensional array and then just take the element at whichever position you ...