If a render target texture is setup like this
render.enable_texture(0, self.my_target, render.BUFFER_COLOR_BIT)
Should I then be able to use it like so in a shader program?
uniform lowp sampler2D TEX0;
void main() {
gl_FragColor = texture2D(TEX0, var_texcoord0.xy);
}
If so then will this work with multiple textures? Is there a max?
render.enable_texture(0, self.my_target, render.BUFFER_COLOR_BIT)
render.enable_texture(1, self.my_target, render.BUFFER_COLOR_BIT)
render.enable_texture(2, self.my_target, render.BUFFER_COLOR_BIT)
…
uniform lowp sampler2D TEX0;
uniform lowp sampler2D TEX1;
uniform lowp sampler2D TEX3;
void main() {
gl_FragColor = ...
}
So if that works then I can’t think of any other way of getting a extra loaded texture into a shader (minus the normal one) other than making a sprite with an exclusive render predicate, rendering it to a numbered texture in the render script, and then using that texture in whatever shader where multiple textures would really be useful.
Can I get official confirmation if this should work or if it won’t at all? Is there another unsaid way to get other textures into shaders?