Tag Info

Hot answers tagged

4

Ok, given the wireframe view, it is clear that your problem is T-junctions. Remove them and the artifacts will go away. If you provide information on how you get/generate the meshes, you could get help on how to remove them as well :)


2

Your input layout defines POSITION as R32G32B32_FLOAT but Vertex's first member is an XMFloat4. This results in garbage in the TEX input. To fix the problem, switch to a XMFloat3 for the Vertex position member. Also, the offset for your NORMAL is set to zero - this should be D3D11_APPEND_ALIGNED_ELEMENT as well.


2

The compiler won't always put the ".xyz" of a hlsl variable into ".xyz" of a register, if that's what you're referring to - sometimes it will move between .xyz, .xyw, .yzw, or even between components in separate registers, depending on if it's some intermediate calculation value or not and how much register pressure there is. As far as I'm aware there's no ...


1

COLOR0 is DX9. Since you're dealing with DX11 (ps_5_0) you need to replace COLOR0 with SV_Target.


1

I do it like this, so no divide in the PS. Vertex Shader code follows: struct VertextoPixel { float4 pos : SV_POSITION; float2 tex : TEXCOORD0; }; VertextoPixel main(uint vI : SV_VERTEXID) { float2 inTex = float2(vI%2,vI%4/2); VertextoPixel Out = (VertextoPixel)0; ...


1

The key step that you're missing is the implicit slot assignment that occurs when you compile a shader. When you compile an HLSL shader that contains a bindable object (be it a Texture2D, RWStructuredBuffer, or cbuffer), each object must be assigned a slot number. This corresponds to the UINT StartSlot parameter to e.g. VSSetConstantBuffers. You can ...



Only top voted, non community-wiki answers of a minimum length are eligible