A2K / vscode-hlsl-preview

HLSL live preview for VSCode
11 stars 0 forks source link

Black output with Textures #1

Open FitiLsan opened 4 years ago

FitiLsan commented 4 years ago

Hi! When I'm trying to visualize my texture in pixel shader preview I'am getting black output

sampler MySamp;
Texture2D <float4> MyTex;

float4 main( float2 TexCoords : TEXCOORD ) : SV_Target
{
    return MyTex.Sample( MySamp, TexCoords);
}

MVS Code Version 1.39.1 UuMnhJm-U6c 1

ckLXHL commented 4 years ago

same problem, no texture can be use

gabrieloc commented 2 years ago

@A2K any ideas here? would love to have this functionality

broken-bytes commented 1 year ago

Doesn't work for me at all. Output is always black.

YIJUAN7 commented 3 months ago
Texture2D myTex;
sampler myTexSampler = 
sampler_state
{
    Texture = <myTex>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};
float4 main(in float2 uv: TEXCOORD0):SV_TARGET
{
    return myTex.Sample(myTexSampler, uv);
}

这段代码可以正常釆样纹理