i get strange results when loading an .obj file in SharpDX. It gets semi-transparent. I just can not figure out the problem. It looks like the normals are inverted at some faces but i am not sure. I also tried to duplicate the vertices and inverse every normal, but nothing helps. Could it be that i am doing wrong draw calls? I draw for every object in the scene and after that i present it.
After some testing, i think it could also be the shader. But like i already said i am not sure about that. This is the Shadercode:
cbuffer data :register(b0)
{
float4x4 worldViewProj;
};
struct VS_IN
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
};
struct PS_IN
{
float4 position : SV_POSITION;
float2 texcoord : TEXCOORD;
};
//texture
Texture2D textureMap;
SamplerState textureSampler
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = Wrap;
AddressV = Wrap;
};
PS_IN VS( VS_IN input)
{
PS_IN output = (PS_IN)0;
output.position = mul(worldViewProj,input.position);
output.texcoord=input.texcoord;
return output;
}
float4 PS( PS_IN input ) : SV_Target
{
return textureMap.Sample( textureSampler, input.texcoord );
}
Also i am new to shader.