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

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -