Sample texture in Custom Code node

Hi there,

I noticed that I can sample a texture in the Custom Code node by connecting it anywhere in the graph. In the example below I used Input5 on the Custom Code node itself. However this leaves the index of the texture undefined. It could be In1, In2, etc.

Is there a better way to make textures available in the Custom Code node?

In1.Sample(SamplerLinearWrap, Input0.xy);

Screenshot 2022-04-07 222524

Unfortunately, the node has Vector4 as inputs-only now. So you can pick the Texture name from generates shader source code (eg. this In2/In3) and sample it there with input texcoords.

I’ll put task to roadmap to improve this.

1 Like