Simple HLSL switch

Hello all,

I am trying to create a simple HLSL switch inside the custom material node. The code looks like this at the moment:


float1 output;

switch(inputValue)
{
	case '0':
		output = shader1;
		break;
	default:
		output = shader1;
		
}

return output;

The idea is that you plug in a whole bunch of different layers and you can select which one you want to be displayed on your material instance. Rather like a static switch but with unlimited number of inputs. I have a feeling my HLSL code is quite awful and is missing some rather vital things. I have worked with HLSL very little in the past and never created a custom node before. Any help would be greatly appreciated :slight_smile:

https://scontent-a-lhr.xx.fbcdn.net/hphotos-prn1/t1.0-9/10257804_10152098738097986_5279316034014699509_n.jpg

Cheers!

Curious if you ever got anywhere with this.

ah shoot I was already here