- Home /
Swapping between Diffuse and Transparent/Diffuse Shaders
I have a scene setup with a lot of trees in it. The camera movement is dynamic, and certain views place a tree or two right in front of the camera. I have a raycast setup to grab a list of gameobjects between the camera and the object being viewed (a building in this case).
I know I can set the trees to use the Transparent/Diffuse shader and make them see-through, but I don't want 100+ trees on the screen using Transparent shaders since, according to my research, that will drop performance dramatically, especially on mobile devices.
So, how can I set just one or two trees dynamically to be transparent? Is it best to use multiple materials on the trees and swap between them (I can see this causing the game to skip)? Will the Transparent/Diffuse shaders cause performance hits if their alpha is set to 1 (meaning if I have 100+ Transparent/Diffuse trees that are completely visible, does this cause a performance hit when compared to them all being Diffuse)?
Any help would be greatly appreciated.
Your answer
Follow this Question
Related Questions
Semi transparent Object behind walls? 1 Answer
Setting up a simple depth-based Shader Replacement material? 0 Answers
Tinted alpha 1 Answer
Semitransparent object that cast shadow 0 Answers
different material for multi camera 1 Answer