Access Texture Coordinate Index via Material Instance?

I am trying to set up a material that allows me to adjust the texture coordinate index in my material instance. Is this possible? I currently have a setup that allows me to edit the uv tiling (see attached picture), but I can’t figure out how to gain parameter access to the coordinate index. This would be really useful, so any ideas would be greatly appreciated!
Thanks,
Matt

1 Like

Hey Matt_Cooke -

There is no direct way to set up a parameter control of the UV Cooridnate index, but there is a workaround of sorts. You can add a StaticSwitchParameter and have one UV Index attached to True and Another Attached to False then the output connected to your Tiling Parameters above.

12762-uvcoord.jpg

Thank You

Eric Ketchum

2 Likes

Thanks Eric,
That works perfectly!
For anyone else wanting to set this up, the network looks like this:

3 Likes

I keep seeing the workaround for switching between two coordinate indexes but how about 5 or even 7? Anything over two?

335169-q.png

easy

1 Like

Hi, I can prupose a solution that works for N coordinate index

You need to create a Custom node that takes as inputs the desired TexCoor[i] nodes and a Scalar Parameter that indicates the desired coordinate index to pass in the material instance. And then a simple if or switch in HLSL/GLSL code and that’s it.

I post image to explain better :

Hope this helps you :slight_smile:

8 Likes

Also, you can use “Switch” node from Math section. Easier than custom node and no any Switch Parametrs

3 Likes

Worked like a charm. Thank you!

2 Likes

Can’t seem to find this node in 5.1. Was it introduced in newer versions?

Hi. Everything the same. Working on 5.2