Questions tagged [pixel-shader]
21 questions
57
votes
3 answers
When is a compute shader more efficient than a pixel shader for image filtering?
Image filtering operations such as blurs, SSAO, bloom and so forth are usually done using pixel shaders and "gather" operations, where each pixel shader invocation issues a number of texture fetches to access the neighboring pixel values, and…
Nathan Reed
- 24,302
- 2
- 63
- 103
17
votes
3 answers
Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?
Games and other graphically intensive applications use frameworks like OpenGL and DirectX. Also they require features like pixel shader and DX12.
But why would we need all these frameworks and GPU features when we could just draw everything pixel by…
Suici Doga
- 289
- 2
- 7
9
votes
1 answer
Tweaking a glow shader to make it look better
I have a simple game and and subjects of it are these little lines. It is targeted for iOS and android so it has a HUGE range of processors that it could run on, right now.
I am trying to add realtime glow to them for two reasons
I am trying to…
J.Doe
- 1,445
- 11
- 22
8
votes
3 answers
Changing image so it would look like through colorful glasses
I am currently working on some simple pixel shader in HLSL. I send to shader texture and I want to make it more colorful (something like in the picture below).
In the picture 1 there is original texture. Picture 2 shows an effect that I want to…
bartosz.baczek
- 399
- 1
- 11
8
votes
2 answers
Can (and how so) shaders paint screen pixels beyond those that occupied by the shaded mesh?
I have some experience programming geometry and compute shaders - but never adventured myself in really playing with the fragment shaders. Currently, I am trying to better understand how they work and their potential. One of the things I have read…
AndrewSteer
- 165
- 5
8
votes
1 answer
Cost of parameter passing in webgl pixel shaders?
In a webgl pixel shader, all functions are inlined as i understand it, however you can have parameters that are marked as in versus being inout meaning that their value can change but the value won't persist outside of the function call.
Does this…
Alan Wolfe
- 7,711
- 3
- 29
- 72
8
votes
2 answers
Moires patterns despite using mipmaps
I am working on Silverlight app. I am trying to render floor covered with tiles. Although I am using mip maps I am still getting awful Moire patterns, when trying to render big area.
What I am doing is creating cuboid and then cover it with single…
bartosz.baczek
- 399
- 1
- 11
7
votes
1 answer
HLSL Deferred Rendering
I've recently made the switch to Visual 2015 and the .fx files have been depreciated. My project contained .fx files for the shaders so I've been switching over.
Only during the switch have I changed to using deferred rendering for lighting.
The…
phatgreen
- 141
- 6
6
votes
2 answers
Advice on how to create GLSL 2D soft smoke/cloud shader
I want to recreate this smoke/cloud effect which is used in the Arrival (2016) movie end credits.
I uploaded a sped up version of the credits to see the smoke dynamics.
http://streamable.com/n3309 49s x6 sped up video of the credits
I know how…
Simon Kirsten
- 163
- 1
- 4
6
votes
1 answer
Methods for grid traversal in a glsl pixel shader?
I'm working on a shadertoy "snake" game, using the new multi pass rendering abilities to save game state between frames.
I'm using raytracing to render the board (an AABB), and am planning on using spheres to render sections of the snake's…
Alan Wolfe
- 7,711
- 3
- 29
- 72
6
votes
1 answer
Texture glitch when using simple pixel shader
I have an issue with rendering my textures in Silverlight. When I look at it from above everything looks fine:
But if I only change angle of watching it it looks terrible:
I am using very simple pixel shader (hlsl):
float4 main(VsOutput vertex) :…
bartosz.baczek
- 399
- 1
- 11
5
votes
1 answer
Gpu derivatives. How it's done across 2x2 boundary?
This question bothers me since the first time I got to know about derivatives in pixel shader. Suppose we have a 2d texture:
5 10 20 30
6 11 50 100
If I correctly understand, the derivatives for the pixel [0, 0] will be:
dx = pixel[1, 0] -…
nikitablack
- 711
- 4
- 15
4
votes
0 answers
Unfolding a 3D point to a Cartesian plane
I am writing a texture splatting pixel shader for meshes (not terrain) whereby I find a UV position from a raycast, which I convert to a local position, and then calculate a bounding box around that position.
Then when cycling through the UVs (also…
Garth Wood
- 41
- 2
2
votes
1 answer
How can I implement GIMP's "Colorize" function?
I have an RGB pixel that I'd like to colorize in my program (I'm using GLSL) very similar to how the GIMP "Colors > Colorize" function works.
In my program, I can easily convert between RGB and HSV. I can therefore get:
pix_h, pix_s, pix_v
And I…
carlr
- 21
- 2
2
votes
3 answers
Trouble Finding Simple 2D DirecX11/HLSL Issue
Some possible things that might be the issue and could be explained by someone who is knowledgeable
Order of my indices, In all I've read, your array of indices for a triangle list is just clockwise order, see below how I ordered it for proof. EDIT…
phatgreen
- 141
- 6