Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mob-sakai/compositecanvasrenderer

CompositeCanvasRenderer bakes multiple source graphics into a bake-buffer (RenderTexture) and renders it. Additional material modification, mesh modification, and baking effects are supported! Let's enjoy the effects that were difficult to implement with UI shaders, such as blur, soft outline, and soft shadow!
https://github.com/mob-sakai/compositecanvasrenderer

bake bloom blur effects glow mirror outline shaders shadow ui unity3d upm-package

Last synced: 3 months ago
JSON representation

CompositeCanvasRenderer bakes multiple source graphics into a bake-buffer (RenderTexture) and renders it. Additional material modification, mesh modification, and baking effects are supported! Let's enjoy the effects that were difficult to implement with UI shaders, such as blur, soft outline, and soft shadow!

Awesome Lists containing this project

README

        

# logo Composite Canvas Renderer

[![](https://img.shields.io/npm/v/com.coffee.composite-canvas-renderer?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.coffee.composite-canvas-renderer/)
[![](https://img.shields.io/github/v/release/mob-sakai/CompositeCanvasRenderer?include_prereleases)](https://github.com/mob-sakai/CompositeCanvasRenderer/releases)
[![](https://img.shields.io/github/release-date/mob-sakai/CompositeCanvasRenderer.svg)](https://github.com/mob-sakai/CompositeCanvasRenderer/releases)
![](https://img.shields.io/badge/Unity-2019.4+-57b9d3.svg?style=flat&logo=unity)
[![](https://img.shields.io/github/license/mob-sakai/CompositeCanvasRenderer.svg)](https://github.com/mob-sakai/CompositeCanvasRenderer/blob/main/LICENSE.txt)
[![](https://mob-sakai.github.io/DocFxForUnity/CodeCoverage/badge_linecoverage.svg)](https://mob-sakai.github.io/TestPkgDev/CodeCoverage/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
[![](https://img.shields.io/github/watchers/mob-sakai/CompositeCanvasRenderer.svg?style=social&label=Watch)](https://github.com/mob-sakai/CompositeCanvasRenderer/subscription)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)

<< [📘 Documentation](#-documentation) | [🎮 Demo](#-demo) | [⚙ Installation](#-installation) | [🚀 Usage](#-usage) | [🤝 Contributing](#-contributing) >>



## 📝 Description

CompositeCanvasRenderer bakes multiple source graphics into a bake-buffer (RenderTexture) and renders it.

It also supports additional material modification, mesh modification, and baking effects, allowing you to enjoy effects that were challenging to implement with standard UI shaders, such as blur, soft outline, and soft shadow.

**Key Features:**

- Bakes multiple source graphics into a `RenderTexture` as **bake-buffer**.
- Utilizes the materials set on the source graphics during the baking process.
- The bake-buffer is automatically baked as needed, or you can trigger manual baking with `SetDirty()`.
- Apply custom effects to the bake-buffer using a `CommandBuffer` after baking (as post-bake effect).
- You can use custom materials for rendering the bake-buffer.

Let's enjoy a wide range of effects that were previously challenging to achieve with standard UI shaders!

#### Features

* **Efficiency**: By combining multiple graphics into a bake-buffer, it reduces the number of draw calls and can significantly improve rendering performance.

* **Automated Baking**: The bake-buffer is automatically generated as needed, simplifying the rendering process and reducing manual intervention.

* **Control**: Users have the flexibility to manually trigger the baking process using SetDirty(), giving them control over when and how the graphics are baked.

* **Material Usage**: It ensures that the materials set on the graphics are used during the baking process, maintaining visual consistency.

* **Post-Bake Effects**: After baking, you can apply various effects to the bake buffer using a command buffer, allowing for additional visual enhancements or post-processing.

* **Built-in Effects**: Several effects are available out of the box!

* **Custom Material Support**: You can use custom materials for rendering the bake-buffer.

* **Foreground/Background Rendering**: Supports both foreground and background rendering.

* **Color and Blend Mode**: Allows you to change color modes and blend modes.

* **Quality and Performance Control**: You can fine-tune quality and performance using the `Down Sampling Rate` parameter.

* **Perspective/Orthographic Rendering**: Supports both perspective and orthographic rendering. In orthographic rendering (where relative `position.z` and relative `rotation.xy` are 0), baking is less frequent.

* **TextMeshPro Compatibility**: Works seamlessly with TextMeshPro. `` and `` tags are supported, and it may also be compatible with other custom UI classes.

* **Editor Support**: Enjoy a convenient editing experience with the ability to preview the bake buffer in the inspector and visualize the baking region in the scene view. You can also customize the behavior from the project settings.



## 📄 Documentation

Check out the detailed documentation to learn more about the project and its features.

[Documentation](http://mob-sakai.github.io/CompositeCanvasRenderer/)



## 🎮 Demo

[WebGL Demo](http://mob-sakai.github.io/CompositeCanvasRenderer/Demo/)

![]()



## ⚙ Installation

_This package requires **Unity 2019.4 or later**._

#### Install via OpenUPM

This package is available on [OpenUPM](https://openupm.com) package registry.
This is the preferred method of installation, as you can easily receive updates as they're released.

If you have [openupm-cli](https://github.com/openupm/openupm-cli) installed, then run the following command in your project's directory:

```
openupm add com.coffee.composite-canvas-renderer
```

#### Install via UPM (using Git URL)

Navigate to your project's Packages folder and open the `manifest.json` file. Then add this package somewhere in the `dependencies` block:

```json
{
"dependencies": {
"com.coffee.composite-canvas-renderer": "https://github.com/mob-sakai/CompositeCanvasRenderer.git?path=Packages/src",
...
},
}
```

To update the package, change suffix `#{version}` to the target version.

* e.g. `"com.coffee.composite-canvas-renderer": "https://github.com/mob-sakai/CompositeCanvasRenderer.git?path=Packages/src#1.0.0",`



## 🚀 Usage

1. Create a GameObject with the `CompositeCanvasRenderer` component.

2. Add UI elements such as Image, RawImage, Text, TextMeshProUGUI, etc., to the GameObject.

3. The baking area is determined by the `RectTransform.size` and the `Expands` option. In the scene view, the baking area is displayed as a magenta rectangle.

4. Adjust the `CompositeCanvasRenderer` settings in the inspector.

5. Select an effect in the inspector and fine-tune its settings.

6. Enjoy!



## 🤝 Contributing

### Issues

Issues are incredibly valuable to this project:

- Ideas provide a valuable source of contributions that others can make.
- Problems help identify areas where this project needs improvement.
- Questions indicate where contributors can enhance the user experience.

### Pull Requests

Pull requests offer a fantastic way to contribute your ideas to this repository.
Please refer to [CONTRIBUTING.md](https://github.com/mob-sakai/CompositeCanvasRenderer/tree/main/CONTRIBUTING.md)
and [develop branch](https://github.com/mob-sakai/CompositeCanvasRenderer/tree/develop) for guidelines.

### Support

This is an open-source project developed during my spare time.
If you appreciate it, consider supporting me.
Your support allows me to dedicate more time to development. 😊

[![](https://user-images.githubusercontent.com/12690315/50731629-3b18b480-11ad-11e9-8fad-4b13f27969c1.png)](https://www.patreon.com/join/2343451?)
[![](https://user-images.githubusercontent.com/12690315/66942881-03686280-f085-11e9-9586-fc0b6011029f.png)](https://github.com/users/mob-sakai/sponsorship)



## License

* MIT

## Author

* ![](https://user-images.githubusercontent.com/12690315/96986908-434a0b80-155d-11eb-8275-85138ab90afa.png) [mob-sakai](https://github.com/mob-sakai) [![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai) ![GitHub followers](https://img.shields.io/github/followers/mob-sakai?style=social)

## See Also

* GitHub page : https://github.com/mob-sakai/CompositeCanvasRenderer
* Releases : https://github.com/mob-sakai/CompositeCanvasRenderer/releases
* Issue tracker : https://github.com/mob-sakai/CompositeCanvasRenderer/issues
* Change log : https://github.com/mob-sakai/CompositeCanvasRenderer/blob/main/CHANGELOG.md