Stride Shader (Filter) naming conventions and (hidden) keys and variables from Base Classes

hi all,

When I create a new Shader(Filter), the input texture texture is called “tex0col”. I had a look into the Edge shader, which also inherits from : FilterBase, but there the texture is called “Texture0”. Is there a naming convention behind these names?

“Texture0TexelSize”… is this similar to beta’s “invtargetsize”, and can I put this postfix behind any texture resource to access its dimensions? (MyTextureTexelSize.xy?)

What exactly does “WantsMips” do? (Because the shader also works of I do not generate mips for my texture?

I could not find reference code using the shader explorer.
Also checked the Stride documentation, but just found one entry in “shadowmapbase

Some pointers would be helpful.

These are pre-defined by stride and in case of the TFX refer to the respective texture inputs.

tex0col is there for convenience I assume, so in a simpler case you don’t have to sample yourself.

Afaik WantsMips tells the “upstream” shader to generate mipmaps.

Idk what happens if you use SampleLevel with a texture that has no mips. I’d guess it then just defaults to Level 0?

2 Likes

You can select the var and ShaderExplorer shows you where it is defined (and also click it to go to the definition).

“Texture0TexelSize”… is this similar to beta’s “invtargetsize”, and can I put this postfix behind any texture resource to access its dimensions? (MyTextureTexelSize.xy?)

yes, you can use it anywhere if it is inheriting from Texturing

3 Likes