So Im pretty new to ShaderLab and scripting in general and Ive been reading through the tutorials and the one thing I noticed is that with shaders there really isnt any sort of opacity slider or float that we can put in from 0-1 that will change the opacity of a material. Is there a way to implement this into a shader to adjust the opacity of a material?
To make semitransparent materials, you can use the built-in Transparent family of shaders. The alpha channel of the main texture is multiplied by the alpha of the main colour, and the result is used for opacity in the shader.
thanks. But there is no way to have a slider in the inspector of the material like in the hypershader of maya?
you can if you write an own shader that wastes performance to use a float for range then you can specify it with a number. normally the texture is used becuase it allows you to specify transparency per pixel and in an art program
Properties don't have a significant performance cost, but they do need to bear some relation to how the shader works. Adding a separate alpha slider when there is already a perfectly good alpha value in the main colour is inefficient.