Ramp shader with two textures and light mask?


#1

Hello!! Im trying to create a shader network, the idea is create a ramp shader with two texture files, red.png and green.png

I want to put it in a plane, create a spot light, and i want that, the affected zone by light show the file green.png and the other zone (dark zone) show the other file, red.png

I want to see it directly in the viewport (without render needed), I can program the shader if it is necessary. I let an image with the idea to clear up the problem, where you could see the green.png file, but the other part show in black.

PD: If it is possible, i would like to use only maya default materials


#2

Try programming the shader.


#3

If it’s just a plane and a basic spotlight, you can do it by projecting the spotlight’s cone onto the plane, and then in the shader network testing whether the point is inside the projected sphere or not. Use that to set the alpha value of a layeredTexture to pick which image to use.

A ShaderFX shader is probably a better way to go, though.


#4

I will program it if there is no more options, i have programmed some plugins in c++ but never a shader.

I have built this network, it do exactly what i want, but i cant see it in the viewport, it my other objetive. I have tried do it with shaderFX but im not so experienced with shaders network, so i dont know how to do it. This its the network and the render result:

Viewport:

Render:

Shading network:

Im starting to think that, as IfernalDarkness said, program the shader its the only option, but i dont know if it will be visible in the viewport.

Thanks in advance!!