A proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API.
15
votes
2answers
3k views
Best way to mask 2D sprites in XNA?
I currently am trying to mask some sprites. Rather than explaining it in words, I've made up some example pictures:
The area to mask (in white)
Now, the red sprite that needs to be cropped.
The ...
20
votes
2answers
4k views
How do I create a wide-angle / fisheye lens with HLSL?
What are the concepts that need to be implemented in order to achieve the effect of a wide angle lens of varying extremities?
Pseudocode and specific explanation referring to the various stages of ...
18
votes
12answers
6k views
What are some good resources for learning HLSL?
The last time I tried learning HLSL, I made a few shaders and mostly understood what I was doing, but I still felt like I was stumbling in the dark. Most of what I learned I got from various blog ...
18
votes
3answers
2k views
How can I create a lighting effect like this?
This is the most beautiful 2d lighting I have ever seen, and I'd like to perform lighting like this too. How do I do it?
I don't care about the physics or how the particles are simulated - I only ...
14
votes
6answers
3k views
Modern Shader Book?
I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about ...
4
votes
1answer
613 views
Pass large array to pixel shader
I am trying to write a Pixelshader for a curve effect in Direct2d.
A curve effect maps each color channel value to a different value by using a look up table.
For this effect I would need to pass 3 ...
3
votes
1answer
3k views
SV_POSITION in pixel shader
What are the uses for SV_POSITION in the pixel shader? Previously this was the POSITION semantic and it wasn't readable in the pixel shader, but now that it is, what can it be used for?
In an SM2 ...
6
votes
2answers
792 views
Rendering collections of light sources
I have a small test environment where small point lights are scattered. Players should able to collect them.
The collectible lights are rendered using a simple billboard technique where two triangles ...
4
votes
1answer
218 views
How can I handle the combination of multiple shader effects?
To be able to work efficiently with effects, is there a good way to combine multiple reusable "base" effects to achieve a more complex final result?
For example, say I have an effect that handles ...
3
votes
0answers
454 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: ...
3
votes
3answers
226 views
Does passing uniform constants from technique into shader cause branches?
I am trying to find a way to organize my evergrowing number of shader techniques/functions (I am coding in sm_3.0). One way is to do this:
float4 PS_Crossroads(PS_INPUT input, uniform bool ...
1
vote
1answer
262 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
931 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.
...
1
vote
1answer
142 views
How to mix effects together?
Lets say I have got terrain effect, contains multitexturing, light. Now water effect. It must be different, but must be also affected by light. Other one, player effect, must also be affected by ...
0
votes
1answer
95 views
Glow with forward rendering without two passes/MRT?
I am trying to implement controllable bloom. By controllable I mean bloom that can be requested even for non-bright pixels by adding the bloom value into a model's texture channel. To do this I need ...