Tagged Questions
0
votes
1answer
33 views
Shader registers for different graphics card
The title is not very explicative, so i'll try to make myself clear.
I have two "working"(on which i work on) PCs : a desktop that runs an NVIDIA GT440 an a laptop with a RADEON HD 4650. I have a ...
0
votes
1answer
31 views
Weird rendering issue when applying lightmap through HLSL
I have a weird issue when trying to render the lightmaps in my game.
Please see the following screenshots.
Note how the scene looks up close with the lightmaps enabled.
Note how that same part of ...
1
vote
0answers
110 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: ...
0
votes
2answers
76 views
The saturate function is not working in my pixel shader
I wrote a pixel shader for my game and when I tried to compile it an error occurred:
ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
When I removed all the saturate ...
3
votes
1answer
183 views
Per Instance Textures, and Vertex And Pixel Shaders?
How do you implement per instance textures, vertex shaders, and pixel shaders?
Given:
1. Two different model templates in Vertex Buffer, Square & Triangle
2. Instance Buffer with [n] instances of ...
0
votes
2answers
105 views
How to implement input-texture limited alphablending of 2 textures with HLSL?
I try to implement a HLSL shader the does the normal Alphablend with premultiplied colors (just as XNA4 does) but depending on some existing colors. One can think of adding a glow to a 2D terrain ...
0
votes
2answers
327 views
HLSL shader optimization [closed]
The following HLSL shader (without preprocessing) results in 65 arithmetic operations (see below). Can the same effect achieved with <=64 operations?
// Center of "light"
float x;
float y;
// ...
0
votes
0answers
96 views
How to efficiently render resizable GUI elements in DirectX?
I wonder what would be most efficient way to render the GUI elements.
When we're talking about constant-size elements (that can still be moving), the textures' atlas seems to be good.
But what with ...
3
votes
1answer
527 views
In HLSL pixel shader , why is SV_POSITION different to other semantics?
In my HLSL pixel shader, SV_POSITION seems to have different values to any other semantic I use. I don't understand why this is. Can you please explain it?
For example, I am using a triangle with the ...
4
votes
1answer
730 views
How do I use screen-space derivatives to antialias a parametric shape in a pixel shader?
In Valve's Alpha Tested Magnification paper, it mentions using "per-pixel screen-space derivatives" for doing anti-aliasing. My understanding is that this is the ddx and ddy intrinsic functions in ...
1
vote
1answer
540 views
Pixel Shader, YUV-RGB Conversion failing
I am tasked with playing back a video hthat comes in in a YUV format as an overlay in a larger game. I am not a specialist in Direct3d, so I am struggling. I managed to get a shader working and am ...
1
vote
1answer
568 views
2D Mask antialiasing in xna hlsl
I have two texture2d , one of these is a mask texture and have 2kind color
and i use that for mask (filter) second texture2D
something like
float4 tex = tex2D(sprite, texCoord);
float4 bitMask ...
0
votes
0answers
165 views
What's a good way to organize samplers for HLSL?
According to MSDN, I can have 4096 samplers per context. That's a lot, considering there's only a handful of common sampler states.
That tempts me to initialize an array containing a whole bunch of ...
1
vote
1answer
429 views
Need to combine a color, mask, and sprite layer in a shader
My task: to display a sprite using different team colors. I have a sprte graphic, part of which has to be displayed as a team color. The color isn't 'flat', i.e. it shades from brighter to darker. I ...
2
votes
3answers
3k views
Hue, saturation, brightness, contrast effect in hlsl
I am new to pixel shader, and I am trying to write a simple brightness, contrast, hue, saturation effect. I have written a shader for it but I doubt that my shader is not providing me correct result, ...
1
vote
1answer
379 views
Sampling from Normal Map and Diffuse Map in Pixel Shader
I'm having some issue changing a basic lighting shader to take a normal texture and a diffuse texture for a model and then using the normal texture for lighting.
The code is very simple and i can't ...
2
votes
1answer
785 views
Why is a fully transparent pixel still rendered?
I am trying to make a pixel shader that achieves an effect similar to this video http://www.youtube.com/watch?v=f1uZvurrhig&feature=related
My basic idea is render the scene to a temp render ...
0
votes
2answers
1k views
How to achieve after-image pixel shader effect
How would one go about writing a pixel shader like this one in XNA 4.0?
http://www.youtube.com/watch?v=f1uZvurrhig&feature=related
1
vote
1answer
629 views
How to set TextureFilter to Point to make example Bloom filter work?
I have simple app that renders some particles and now I am trying to apply the bloom shader from the xna samplers ( http://create.msdn.com/en-US/education/catalog/sample/bloom ) to it, but I am ...
1
vote
1answer
740 views
XNA - Getting HLSL pixel of current render target?
I'm setting a render target in XNA using the following lines of code:
Game.GraphicsDevice.SetRenderTarget(physicsTexture);
Game.GraphicsDevice.Clear(Color.White);
...
0
votes
1answer
491 views
D3D11 - Setting multiple ID3D11SamplerStates for the pixel shader stage once and leaving them be
In my Direct3D 11 application, I am using several sampler states to retrieve texture data. Some of them are used in all pixel shaders, some of them are only used in very specific ones.
The question ...
1
vote
0answers
462 views
How can I run the pixel shader effect?
Stated below is the code for my pixel shader which I am rendering after the vertex shader.
I have set the wordViewProjection matrix in my program but I don't know to set the progress variable i.e in ...