All Questions
Tagged with directx fragment-shader
24 questions
0
votes
1
answer
92
views
What is the proper way to write a pixel shader that only outputs depth?
I have an effect that I want to only write to depth.
commandList->OMSetRenderTargets(0, nullptr, FALSE, &m_mainDepthStencilDescriptorHandle.getCpuHandle());
...
0
votes
1
answer
134
views
Relocate texture regions with pixel shader
I'm new to DirectX and pixel shader development. I want to know how to relocate region of input image in post processing.
What I want to achieve is to divide my image into 4 pieces and then relocate ...
0
votes
1
answer
213
views
How to draw stencil ref value
hi i am currently implementing UI screen that shows Depth Complexity of scene,
so that we can figure out how many time each pixels work for same pixels.
for this i need to render stencil ref value.
...
1
vote
0
answers
242
views
What's wrong with my normal mapping, and how can I fix it?
I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping:
And ...
4
votes
2
answers
966
views
DirectX11 - Color Interpolation Along Quad Diagonal
Imagine that we have a vertex structure that looks like this:
struct Vertex
{
XMFLOAT3 position;
XMFLOAT4 color;
};
The vertex shader looks like this:
<...
1
vote
0
answers
89
views
Can sampling an input texture in shader return values updated in same pass?
In my hlsl, (I am using Direct2D helpers which I guess just call tex2D), can D2DSampleInputAtOffset() return a pixel value that was only updated in that same pass ...
0
votes
0
answers
170
views
Shader - Directional Lights Depth
Is there a way to retrieve the deph from directional lights ? I can access the _ShadowMapTexture but this is not the depth.
I found how to access the shadow map of, I think, every light type by using ...
4
votes
1
answer
3k
views
Getting rid of texture bleeding
Edit: I figured out what problem I was facing, it's called Texture/Pixel bleeding, which I was not aware of yet. I posted an answer below consisting of a small description of the problem and a link to ...
6
votes
2
answers
2k
views
Best way of writing pixel manipuliting-intensive applications with OpenGL/Direct3D
Recently I have been making little experiments with engines similar to old Wolfenstein 3D, Doom and Build, engines where the 3D rendering is entirely done in software and therefore you need full ...
0
votes
1
answer
98
views
Sample() returns (0, 0, 0) for normal map 90% of frames
I'm having some trouble reading the values from my Normal map in my lighting fragment shader.
The relevant part of the shader code is as follows:
...
0
votes
2
answers
891
views
Is there a way to optimize this 2D lighting effect shader? [duplicate]
I'm doing a little 2D game in C++ with Direct3D 11.
In the game I want to render a sort of shadow that covers part of the screen:
To do this I am using this pixel shader:
...
2
votes
2
answers
2k
views
What is the depth that a pixel shader may output? Is it necessary to write Depth?
In DirectX11, what does the depth that a Pixel Shader can output mean? Does a pixel shader need to output a depth so that we "write" the depth? If not, why would we output it?
For any doubts, I'm ...
3
votes
1
answer
2k
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 ...
1
vote
2
answers
729
views
Alpha interpolation in a pixel shader
How does the interpolation in a fragment shader work when it comes to the alpha parameter?
I'm programming a shader with SharpDX, DirectX11. My idea is to interpolate 2 3d points of a segment, so ...
1
vote
1
answer
1k
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 ...