
[

Отключение буфера глубины (отвязыванием it) решает проблему, но объекты, нарисованные до кубической карты, больше не видны.
Шейдер Skybox записывается как:
Код: Выделить всё
cbuffer Data : register(b0)
{
row_major matrix matWorldViewProj; // MVP transformation
}
TextureCube CubeMapTexture : register(t0);
SamplerState CubeMapSampler
{
Texture = ;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
BorderColor = float4(1, 1, 1, 1);
Filter = LINEAR;
};
struct VertexIn
{
float3 Position : POSITION;
};
struct VertexOut
{
float4 Position : SV_POSITION;
float3 UVW : TEXCOORD0;
};
VertexOut VS_Main(VertexIn v)
{
VertexOut output;
output.Position = mul(float4(v.Position, 1.0f), matWorldViewProj);
output.Position.z = output.Position.w;
output.UVW = v.Position;
return output;
}
float4 PS_Main(VertexOut v) : SV_TARGET
{
return CubeMapTexture.Sample(CubeMapSampler, normalize(v.UVW));
}
Дескриптор D3D11_RASTERIZER_DESC()
- FillMode D3D11_FILL_SOLID
- CullMode D3D11_CULL_BACK
- FrontCounterClockwise False
- DepthBias 0
- DepthBiasClamp 0,00
- SlopeScaledDepthBias 0,00
- DepthClipEnable False
- ScissorEnable False
- MultisampleEnable False
- AntialiasedLineEnable False
- Face: Front Func: Always Fail op: Keep Depth Fail op: Keep Pass op: Keep
- Назад: Front Func: Всегда провал op: Keep Depth Fail op: Keep Pass op: Keep
Это не связано с намоткой вершин, так как при перемещении камеры присутствует мерцание.>
Подробнее здесь: https://stackoverflow.com/questions/798 ... is-enabled
Мобильная версия