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
camera [2021/06/13 03:27]
uninomiconadmin
camera [2021/06/14 16:16] (current)
uninomiconadmin
Line 5: Line 5:
 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 shaderWhen providedUnity will pick a sub-shader from the replacement shader that matches the value of the TagSo if the tag argument is 'RenderType', you can provide two sub-shaders 'Opaqueand 'Transparentin the replacement shaderand Unity will pick the sub-shader that matches the original object.+SetReplacementShader will use the Materials of the existing objects in the scene((all of the textures and instance data is still sent to the replaced))Howeverit only seems to apply keywords that are registered as ''multi_compile''Per-material keywords registered with ''shader_feature'' do not get applied. For exampleif you call SetReplacementShader with the default URP ''Lit.shader'', these keywords will all be turned off: 
 +{{:rider64_ulivqdfbym.png}}
  
 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