Skip to content

Clept0/XRay-Rendering-URP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🔍 X-Ray for Unity URP

xrayTitle

A simple X-Ray effect for Unity's Universal Render Pipeline (URP) that makes selected objects visible through obstacles. Ideal for third-person games, strategy views, and target highlighting.


⚙️ Renderer Setup

Renderer Settings
•	Make sure the Experimental Render Objects feature is properly configured in your URP Renderer asset.
•	Assign a dedicated Layer (e.g., XRay, RenderAbove) to the objects that should be rendered above all others.
  • Use the included LayerSwitchScript to toggle the X-Ray effect at runtime.

🎨 X-Ray Material

  • The X-Ray material is fully customizable via Shader Graph.
  • If no custom material is assigned, the object’s original material will be restored when X-Ray is disabled.
  • Material switching is handled automatically during runtime.

🎮 Demo Scene

Demo Scene

✅ Features

  • Compatible with Unity URP (Universal Render Pipeline)
  • Easy integration and setup
  • Runtime toggling via script
  • Supports fallback to original materials
  • Includes a working demo scene

📝 Technical Notes

This system is based on a URP Forward Renderer Feature called Render Objects, which allows specific objects to be rendered on top of others regardless of depth. The core functionality relies on this feature to achieve the "see-through" or X-Ray effect.

The included Shader Graph-based material is purely optional and only affects visual style (e.g., transparency, glow, dissolve effects).

You can use:

  • Your own X-Ray styled material,
  • The default material of the object,
  • Or no material override at all.

This makes the system flexible: it works even without a custom shader – the Render Feature handles the actual visibility.

  • Tested with Unity 2022.3.12f1 LTS and URP
  • Shader Graph-based – not compatible with Built-in Render Pipeline

🧠 Credits

Based on this YouTube tutorial by Gabriel Aguiar Prod.

About

A simple X-Ray effect for Unity's Universal Render Pipeline (URP) that makes selected objects visible through obstacles.

Topics

Resources

Stars

Watchers

Forks

Contributors