Question by
elsaafluid · Feb 12, 2016 at 09:35 AM ·
shader programming
mixed texture able to control the opacity through script
So I need to create a mix texture of two images, yet i need to control each one's alpha value in the run time, I found this code in the forum
Shader "Unlit/MixTextures" {
Properties {
_MainTex ("Main Base(RGB) Alpha(A)", 2D) = "white" {}
_MainTex2 ("Main2 Base(RGB) Alpha(A)", 2D) = "white" {}
}
SubShader {
Tags{"Queue"="Transparent"}
Pass{
Lighting Off
SetTexture [_MainTex] {
combine texture, texture
}
}
Pass{
Blend DstColor Zero
Lighting Off
SetTexture [_MainTex2] {
combine texture, texture
}
}
}
Fallback "Diffuse"
}
Yet could anyone please tell me how do I access _mainTex and _MainTex2 through c# independently?
Comment
Your answer
Follow this Question
Related Questions
Fresnel/Edge shader problem 1 Answer
Custom shader not working on Samsung S6 1 Answer
Unity 2018 without shader editor 1 Answer
Display reflection on iOS 0 Answers
Combine 2 Shaders,Combine 2 shaders 0 Answers