AmplifyCreations / AmplifyImpostors-Feedback

0 stars 0 forks source link

breaking bake BIRP 2022.3.46 in shaders set forward only #57

Open Dawie3565 opened 1 month ago

Dawie3565 commented 1 month ago

--- BIRP 2022.3.46 --- ASE shader set render path in shader forward only

forward Only image

same shader set All image

diogovtx commented 2 weeks ago

This is not a bug.

What's happening is that Amplify Impostors does not support baking of Transmission or Translucency because it's a Forward-only feature.

To be able to support all BiRP shaders we decided to bake using the deferred pass, which has a fixed layout/format. Independently of the base shader, the outputs are always the same. This isn't the case with a Forward shader, which usually outputs only color and depth.

To be able to support this, the user needs to implement his own Baking shader and assign that to the Baking Preset. We have a sample explaining how this works, called "Custom Baking", on all scriptable pipelines, including BiRP. Custom baking, unlike using the default/null baking shader, uses Forward instead of Deferred. That way we can output whatever we want to use on the impostor.

This is what it looks like: l9ziM1jLqr

Can be assigned here directly, or they can create a new preset: Unity_s09GSfmK6a

And assign it to the Impostor component: Unity_Xb8oe5zIeW

The outputs can be customized to include Transmission or Translucency in the bake, or any other texture information that is required. In this bake shader, some math can run during baking to avoid doing it at runtime in the impostor shader, for example, mixing two Albedo textures.

Hope this helps. Feel free to post any follow up questions.