Tagged Questions
1
vote
1answer
82 views
Texture Shaders vs. Pixel/Fragment Shaders?
My question is a simple one.
Functionally, practically, and performance-wise, what are the differences between using a D3DX Texture Shader, and using a Pixel/Fragment Shader rendered with a full ...
-4
votes
1answer
76 views
My 2d Shader in XNA falls apart the second I put it into Farseer [closed]
I wrote a simple light shader that I tested in a simple 2d spaceship shooter and it worked fine. Once I imported it into my friend's farseer project with rotatable shapes, it doesn't seem to work ...
3
votes
1answer
167 views
Matrix in constant buffer on the GPU contains NaNs but not on the CPU
I've got a shader with the following constant buffer:
cbuffer ShaderParameters
{
matrix inverseViewProjectionMatrix;
float4 cameraPosition;
};
When using Visual Studio 2012's graphic ...
0
votes
1answer
103 views
Strange rendering in Direct3D 10 [closed]
I'm writing an application which renders graphics on the screen. The application can switch between Direct3D9 and Direct3D10 graphics modules (I wrote DLLs that wrap both D3D9 and D3D10). When trying ...
1
vote
1answer
49 views
How can I get a pointer to ID3DX11EffectShaderVariable from ID3DX11Effect
I'm using the DirectX Effects framework and I want to create an input layout automatically when compiling an effect. I've tried to call ID3DX11Effect->GetVariableByName() with the shader's name, to ...
-1
votes
1answer
89 views
How To Buffer Many Vertex, Geometry, and Pixel Shaders
What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the Device/Device Context without having to reload them from the filesystem every time?
ID3D11Device::CreateVertexShader ...
2
votes
1answer
84 views
Direct3D shader compilation fails with constant buffers
I've been particularly annoyed by a 'bug' for a couple days involving D3DCompile and vertex shaders with constant buffers. I'm assuming the bug is my fault (missing flag or small nuance of the poorly ...
8
votes
1answer
228 views
Curious Transparent Holes Render Artifact
So I'm trying to implement "smooth" terrain in my block engine by giving each surface block a heightmap.
Basically, what I do to generate these "heightmaps" for each block is I generate the heights ...
2
votes
1answer
85 views
Nine Patch Images in DirectX
In Android development I found nine patch images very useful to draw images that have a fixed border. When the image is scaled the inner part scales, but the border stays at a fixed size.
I was ...
9
votes
3answers
865 views
Fastest way to render lines with AA, varying thickness in DirectX
So I'm doing some DirectX development, using SharpDX under .NET to be exact (but DirectX/C++ API solutions are applicable). I'm looking for the fastest way to render lines in an orthogonal projection ...
3
votes
1answer
164 views
Why are some objects not rendering properly?
Here's a button I exported from Blender into a .x format:
Now here it is in the game with BasicEffect applied to everything:
And now with my custom shader:
And there's the problem. While the ...
4
votes
2answers
262 views
ConsumeStructuredBuffer, what am I doing wrong?
I'm trying to implement the 3rd exercise in chapter 12 of Introduction to 3D Game Programming with DirectX 11, that is:
Implement a Compute Shader to calculate the length of 64 vectors.
Previous ...
9
votes
4answers
497 views
Avoid if statements in DirectX 10 shaders?
I have heard that if statements should be avoid in shaders, because both parts of the statements will be execute, and than the wrong will be dropped (which harms the performance).
It's still a ...
0
votes
2answers
209 views
How can I capture every frame in DirectX 9 using a shader
This is actually a follow up to this question
How to capture the screen in DirectX 9 to a raw bitmap in memory without using D3DXSaveSurfaceToFile
The proponent of the best solution suggested that I ...
2
votes
0answers
233 views
Where is the Shader Designer?
I have VS2012 Ultimate and I've been trying to access (find) the Shader Designer. I searched through MSDN's text and Channel9's videos, but they keep failing to mention how to access it...
Can ...
1
vote
1answer
199 views
Intercepting DirectX calls and optimizing the overal performance of games
I would like to use a DirectX proxy dll to intercept (and possibly optimize) the graphics calls being made by normal PC games. I am going to "screen cast" a game with ffmpeg or something similar and ...
0
votes
0answers
83 views
How to get warnings when compiling fx files
When I compile DirectX shaders (.fx files), I dont see any compiler warnings unless there was an error in the effect.
This happens both when using the offline FXC compiler, as well as calling ...
1
vote
2answers
185 views
What could cause a pixel shader to paint outside the lines of the vertex shader output?
From what I understand, the pixels that a pixel shader operates on are specified implicitly by the SV_POSITION output (in DirectX) of the vertex shader. What then could cause a pixel shader to render ...
4
votes
1answer
380 views
Bitwise operators in DX9 ps_2_0 shader
I've got the following code in a shader:
// v & y are both uints
nPixel = v;
nPixel << 8;
nPixel |= y;
and this gives me the following error in compilation:
shader.fx(80,10): error ...
0
votes
0answers
211 views
Differences in cg shader code for OpenGL vs. for DirectX?
I have been trying to use an existing library that automatically generates shaders (Hydrax plugin for Ogre3D).
These shaders are used to render water and somewhat involved, but are not extremely ...
8
votes
2answers
512 views
Handle many lights in a scene (with shaders)
I'm curious about how to handle many lights in a scene. Given a very big map in a role playing game, with dungeons (with lights in there) etc. I know about deferred lighting, but that only answers how ...
9
votes
3answers
875 views
Pixel-perfect rendering to a rendertarget with a fullscreen quad
I have some trouble rendering a bunch of values to a rendertarget. The values never end up in the exact range I want them to. Basically I use a fullscreen quad and a pixel shader to render to my ...
2
votes
2answers
582 views
Multiple render targets and gamma correctness in Direct3D9
Let's say in a deferred renderer when building your G-Buffer you're going to render texture color, normals, depth and whatever else to your multiple render targets at once.
Now if you want to have a ...
18
votes
3answers
4k views
For voxel rendering, what is more efficient: pre-made VBO or a geometry shader?
Given a fairly static voxel array, what is more efficient: using the CPU to pre-generate a VBO to render the voxel faces (ignoring more advanced forms of rendering like marching cubes for now) or ...
0
votes
1answer
550 views
How to not-unroll loops in Shader Model 3 HLSL
I'm working on raycaster in HLSL, unfortunately it have to be in DX9. But it cannot be compiled
I did similar raycaster in DX11 and i know that there is always problem with FXC compiler that it tries ...
2
votes
2answers
656 views
implementing multi pass rendering in a game engine
I have done multi pass rendering before and understand how it works. I did a simple example which rendered a basic scene with shadows. This was all done in one file. Now I am trying to figure out is ...
4
votes
2answers
796 views
Real time reflections
I just had a quick look at the new Crysis 2 DX11 update, and was quite surprised by some of the new features, especially the real time reflections on moving models. From what I could gather, there are ...
4
votes
3answers
1k views
Loading and using an HLSL shader?
I've been looking everywhere and all I can find are tutorials on writing the shaders. None of them showed me how to incorporate them into my scene.
So essentially:
Given an hlsl shader, if I were to ...
1
vote
1answer
283 views
Output from vertex shader in D3D9
I've been looking at creating some 2D rendering systems in D3D9, basically because I don't like ID3DXSprite. For the output of the vertex shader, what co-ordinate system does the run-time expect ...
10
votes
3answers
2k views
Why do pixel shaders not let us read directly from the framebuffer or the depth buffer?
Letting me sample the framebuffer or the depthbuffer in the pixel shader would be an extremely useful feature. Even just being able to know the depth or the color of whatever is behind the current ...
2
votes
2answers
599 views
Compatibility between DirectX 9 and DirectX 10 shaders
I am a beginner to game development and as I am used to programming in C# I decided to go for XNA. I've been playing around with it for a while and now I am learning the basics of HLSL shaders, I have ...
14
votes
1answer
2k views
The practical cost of swapping effects
I use XNA for my projects and on those forums I sometimes see references to the fact that swapping an effect for a mesh has a relatively high cost, which surprises me as I thought to swap an effect ...
13
votes
6answers
2k 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 ...
8
votes
3answers
849 views
Very slow direct3D texture sampling
So I'm writing a small game using Direct3D 9 and I'm using multitexturing for the terrain. All I'm doing is sampling 3 textures and a blend map and getting the overall color from the three textures ...
6
votes
2answers
969 views
Looking for an example of glass with XNA or DirectX 9
Any good pointers on how to get the refractive look of glass? I'm looking to create a think piece of glass type of look, sort of the type that you'd have on bathroom shower doors.
8
votes
6answers
3k views
Good example of a multi-pass effect?
In XNA (and Direct3D in general AFAIK), rather than creating individual vertex and fragment shaders, you bundle potentially many related shaders into 'Effects'. When you come to use an effect you ...
