hlsl - How can I check existence of texture in shader programming? -


g_meshtexture : texture file name

sampler meshtexturesampler =  sampler_state {     texture = <g_meshtexture>;     mipfilter = linear;     minfilter = linear;     magfilter = linear; }; 

: sampler

i use "tex2d(meshtexturesampler, in.textureuv)"

which condition in hlsl similar if(g_meshtexture == null) in c++?

there's nothing built-in hlsl test this.

you can add client-loaded parameter tell shader if texture valid or not, or create second alternative shader executes without texture read in cases texture isn't deined (and assigned client c++ prog)


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -