c++,directx,directx-11,hlsl,particle-system
I have been trying to add a particle system to my Directx11 graphics demo, and so i have been using the 'Introduction to 3d Game Programming with directx 11' book. Because of this am attempting to use a HLSL StreamOut technique to update the particle system and a separate technique...

opengl-es,textures,glsl,shader,hlsl
I'm currently rewriting a shader written in GLES30 for the GLES20 shader language. I've hit a snag where the shader I need to convert makes a call to the function textureLod, which samples the currently bound texture using a specific level-of-detail. This call is made within the fragment shader, which...

hlsl,texture2d,pixel-shader,direct3d11
In my HLSL for Direct3d 11 app, I'm having a problem where the texture.Sample intrinsic always return 0. I know my data and parameters are correct because if I use texture.Load instead of Sample the value returned is correct. Here are my declarations: extern Texture2D<float> texMask; SamplerState TextureSampler : register...

c#,xna,hlsl
In Xna I would like to draw my model with a custom effect.. SO I would like to get the textures from the mesh. foreach (ModelMesh mesh in model.Meshes) { foreach (ModelMeshPart part in mesh.MeshParts) { effect.Parameters["World"].SetValue(World ); effect.Parameters["View"].SetValue(View); effect.Parameters["Projection"].SetValue(Projection); effect.Parameters["TextureEnabled"].SetValue(true); var basicEffect = part.Effect as BasicEffect; if (basicEffect !=...

c++,directx,direct3d,hlsl,direct3d11
I'm trying to implement post shaders (pixel shaders) as a test. I have a texture to which all stuff is rendered, and the post shader simply copies this texture to the back buffer. If this texture is larger than the back buffer, the post shading process results in dimming: However,...

opengl,directx,glsl,shader,hlsl
I'm trying to understand how passing parameters is implemented in shader languages. I've read several articles and documentation, but still I have some doubts. In particular I'm trying to understand the differences with a C++ function call, with a particular emphasis on performances. There are slightly differences between HSLS,Cg and...

opengl,directx,glsl,shader,hlsl
I am trying to create a simple subsurface scattering effect using a shader but I am facing a small issue. Look at those screenshots. The three images represents three lighting states (above surface, really close to surface, subsurface) with various lighting colors (red and blue) and always the same subsurface...

c++,directx,shader,hlsl
I need lines of a certain thickness in my CAD viewer and found out that I should use a geometry shader to accomplish this. I then went ahead and found demo code of a geometry shader that creates lines at a given thickness. Here: https://github.com/paulhoux/Cinder-Samples/blob/master/GeometryShader/assets/shaders/lines1.geom Discussion about it here: https://forum.libcinder.org/topic/smooth-thick-lines-using-geometry-shader...

c++,filter,textures,wrap,hlsl
Edit: I have identified the problem to be similar to the question here but I still can't come up with a solution since my problem is a little different. I am using C++ and HLSL and need to have my texture coordinates wrap so that the texture is tiled across...

3d,directx,shader,hlsl
I am drawing spheres on billboards by passing center world positions via a StructuredBuffer and use the geometry shader to build a billboard facing the camera. The sphere is drawn correctly and I can figure out the UVs. Now I would like to light it but I cannot figure how...

c++,directx,shader,hlsl
So I moved from this problem: Previous problem to this one :). I made 2 constant buffers in C++ which I'm passing to my HLSL Shader but when I debug and look into the buffers they are just filled with zeros except the last 3 numbers (which are -572662307). I...

directx,hlsl,normals,geometry-shader
Because of limitations I have to calculate vertex normals inside my geometry shader. Because of this limitation the normals are per-face instead of interpolated between faces on the vertex, meaning per-pixel directional lighting is just a waste. Because the normals are only known from the Geometry Shader onward, I can't...

c#,directx,padding,hlsl,sharpdx
I have a cbuffer in my shader.fx file, like so: cbuffer lights : register (b1) { float4 Light1Color; float3 Light1Direction; float4 Light2Color; float3 Light2Direction; float4 Light3Color; float3 Light3Direction; } I had some issues filling this cbuffer from my code, it ended up being an array of the following struct: struct...

c++,hlsl,directcompute
I really can't figure out what's going on here. I have a compute shader that takes in an FFT result (from real input) and computes the powers of each bin, storing them in a different buffer (UAV). The FFT implementation is that of the D3DCSX library. The shader in question:...

arrays,directx,shader,hlsl
When I try to compile I get the error: X4505: sum of temp register and indexable temp registers exceeds limit of 4096. However my shader does work in FX Composer. The reason it crashes is probably because I use a very large array since I'm using marching cubes. const static...

opengl,glsl,shader,hlsl,normals
I already have a shader that generates a normal map from a height map. Now I need to apply the effect to all 360 degrees of the rotated heightmap. Of coarse I could just apply the effect 360 times to each heighmap, but if I have already done it once...

direct3d,hlsl
I am getting this error: D3D11 ERROR: ID3D11DeviceContext::Dispatch: The Shader Resource View in slot 0 of the Compute Shader unit is using the Format (R32G32B32_FLOAT). This format does not support 'Sample', 'SampleLevel', 'SampleBias' or 'SampleGrad', at least one of which may being used on the Resource by the shader. This...

opengl,directx,glsl,shader,hlsl
I am creating vertex and fragment shaders and I would like to know if using functions inside my shader, for better readability, could have an impact on performance and optimisation.