HLSL is a proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API.
0
votes
0answers
4 views
Debugging HLSL for Windows 8 application [migrated]
i'm currently in the process of creating a Windows 8 applicaiton using SharpDX (the managed c# directx wrapper). However I have ran into problems with one of my shaders and I want to know if its ...
9
votes
2answers
198 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 ...
2
votes
1answer
76 views
Why is my shadowmap all white?
I was trying out a shadowmap. But all my shadow is white. I think there is some problem with my homogeneous component. Can anybody help me? The rest of my code is written in xna
Here is the hlsl code ...
1
vote
0answers
66 views
Outline Shader Effect for Orthogonal Geometry in XNA
I just recently started learning the art of shading, but I can't give an outline width to 2D, concave geometry when restrained to a single vertex/pixel shader technique (thanks to XNA).
the shape I ...
1
vote
1answer
55 views
HLSL problem with divide by homogeneous component
When I try to divide my position.z by my position.w in HLSL I get as result always 1.0f or higher. Is this a common problem for some reason? When I divide my position.x or y by the w this works fine. ...
3
votes
1answer
70 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 ...
4
votes
1answer
97 views
A Quick HLSL Question (How to modify some HLSL code)
Thanks for wanting to help!
I'm trying to create a circular, repeating ring (that moves outward) on a texture. I've achieved this, to a degree, with the following code:
float distance = ...
0
votes
1answer
59 views
how to create texture for modelmesh?
Is there a possibiltiy to create a texture from a meshpart in xna. By getting a flat version of the mesh. So I can create a texture for it and edit that texture(via rendertarget)? I need to get the ...
1
vote
1answer
116 views
Heightmap in Shader not working
I'm trying to implement GPU-based geometry clipmapping and have problems to apply a simple heightmap to my terrain. For the heightmap I use a simple texture with the surface format "single". I've ...
0
votes
1answer
142 views
Shadows shimmer when camera moves
I've implemented shadow maps in my simple block engine as an exercise. I'm using one directional light and using the view volume to create the shadow matrices. I'm experiencing some problems with the ...
5
votes
1answer
298 views
Dealing with alpha for 2D per pixel lighting
Right now I've got a simple light shader. Every bitmap I draw goes through it to make up the scene. I only draw quads.
texture tex;
sampler2D s = sampler_state {
texture = <tex>;
...
3
votes
3answers
104 views
Finding out what pixel on the screen the fragment falls on
In my 2D game, I render tiles. I want to do lighting without needing an extra buffer the size of the screen.
Either in glsl or hlsl, what could I feed to the shader each time I render a bitmap so ...
4
votes
1answer
199 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
0answers
102 views
Full screen shader causes performance hit
I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting.
To do this, I create a new bitmap each time the display resizes that ...
0
votes
1answer
78 views
How would I write a shader that supports 2 different texture coordinates?
Hi I am not very good with writing shaders. How would I make a shader that simply supports 2 texture coordinates so I can load up 2 different textures to be used at the same time but on different ...