2
votes
1answer
70 views

XNA 4.0 HLSL - strange depth map

I want to draw my pre-rendered depth map to the scene. I get my depth value in the following way: basically (Pixel Shader) // Depth is stored as distance from camera / far plane distance, 1-d for ...
1
vote
0answers
40 views

Grid patter appear over bloom when resolution is lower than 1366x768

The bloom post process in our engine is done via consecutive downscaling of the treshhold texture down to 1/64x1/64 of the main size. Every texture we use is R16G16B16A16 FP16. Afterwards, we ...
0
votes
0answers
146 views

Implementing Exponential Shadow Mapping

I've been following the tutorials (link1) and (link2) to implement Shadow Mapping. However, I'm getting shadowing artifacts which are quite ugly. I've done some research, and found that ESM ...
1
vote
1answer
41 views

Proper Directional light on multiple models

I've been trying to implement a Directional light into an XNA game I'm working on, but for what ever reason, I cannot seem to get the directional light to be a true directional light. Instead, I am ...
0
votes
0answers
28 views

Skip the first RenderTarget when writing to MRT with Opaque blending

I am writing to three rendertargets and whant to know how to tell a GPU not to write to the first RT. When you write a shader you can simply output less data than you have RTs (like output a single ...
2
votes
1answer
115 views

What's the difference between Textures and VertexTextures in XNA?

The GraphicsDevice class of XNA has the properties Textures and VertexTextures. What is the exact difference? I don't really understand what MSDN tells me about this. I usually use Effect parameters ...
0
votes
1answer
127 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
2
votes
0answers
291 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...
5
votes
2answers
436 views

XNA 3.1 to 4.0 Vertex Shader Not Drawing

I have recently been converting our XNA 3.1 game to XNA 4.0 and am stuck on the shaders. I have the game running, but nothing is drawing to the screen, except things not using a shader. This is only ...
6
votes
1answer
591 views

Do I need to rewrite my HLSL shaders when porting from XNA to MonoGame?

I'm looking at porting an XNA project I have to monogame, but I have a fair number of HLSL shaders. It seems that Monogame for PC uses OpenGL as the rendering backend, and I'd rather not have to ...
0
votes
2answers
808 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; // ...
1
vote
1answer
761 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 ...
1
vote
2answers
194 views

How (if possible) would I change the BasicEffect Matrix mid draw

Say, for example, I have a list of enemies. Each enemy is a textured quad which is the stored in a singular shared VertexBuffer and IndexBuffer with the buffer usage set to BufferUsage.WriteOnly ...
0
votes
1answer
671 views

Some help understanding and modifying a 2D shader

I have a similar question as the one posed here, except that I don't wish to use a 1D Color Palette. I simply wish to have it display 1 color of my choosing (red, for example). I plan to use this ...
2
votes
1answer
1k 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
744 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 ...
3
votes
1answer
262 views

Write to one channel of R16G16 texture on Xbox

I was going to draw my shadow map into one channel of a 16 bit texture and then draw a different shadow map into another channel of the same texture. I realized that this might not be possible to do ...
2
votes
1answer
511 views

Model in Blender GLSL to XNA HLSL

Is it possible to make model in Blender, with enabled GLSL, add multiple textures, etc, and then just load it in XNA, where's own HLSL? Will it work?
4
votes
2answers
2k views

C# XNA - Sky Sphere Question

I have been banging my head against the wall trying to get a sky sphere to work appropriately in XNA 4.0. I have the sphere loading correctly, and even textured, but i would like something a little ...
1
vote
1answer
513 views

Porting an HLSL 3.0 shader to 2.0?

I have a couple of .fx files from a Shader-Based 2D Shadows example. I want to utilize the same kind of technique with XNA 4.0's Reach profile, which if I understand correctly needs to have HLSL 2.0 ...