Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
camera [2021/06/13 03:24]
uninomiconadmin
camera [2021/06/13 03:27]
uninomiconadmin
Line 2: Line 2:
  
 ==== Camera.SetReplacementShader ==== ==== Camera.SetReplacementShader ====
 +
 SetReplacementShader will not render objects if their original materials don't contain any properties required by the replacement shader. For example, if your replacement shader uses _MainTex, and there is an object in the scene that doesn't have _MainTex, it won't be rendered at all. SetReplacementShader will not render objects if their original materials don't contain any properties required by the replacement shader. For example, if your replacement shader uses _MainTex, and there is an object in the scene that doesn't have _MainTex, it won't be rendered at all.
 +
 +The 'tag' argument accepts the name of a tag in the 'Tags' property block of the shader. When provided, Unity will pick a sub-shader from the replacement shader that matches the value of the Tag. So if the tag argument is 'RenderType', you can provide two sub-shaders 'Opaque' and 'Transparent' in the replacement shader, and Unity will pick the sub-shader that matches the original object.
  
 Shaders can be replaced in the SceneView using ''[[sceneview|SceneView]].SetSceneViewShaderReplace''. Shaders can be replaced in the SceneView using ''[[sceneview|SceneView]].SetSceneViewShaderReplace''.
camera.txt ยท Last modified: 2021/06/14 16:16 by uninomiconadmin