Saving as a texture?

Avatar
  • updated
  • Answered

Is it possible to save a shape as a texture in order to use it in UI Image?

Thanks!

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Answered

currently there's no built-in support for that, but it is possible to render shapes to a render texture, either using a camera that outputs to that RT, or using the immediate mode draw functions to render directly to an RT, and then convert it to a Texture2D using ReadPixels, then save it as an asset!

Avatar
piotrO

A direct render to a RT is perfect for my needs! 

Thanks

Avatar
Freya Holmér creator
  • Answer
  • Answered

currently there's no built-in support for that, but it is possible to render shapes to a render texture, either using a camera that outputs to that RT, or using the immediate mode draw functions to render directly to an RT, and then convert it to a Texture2D using ReadPixels, then save it as an asset!