Convert TerraWorld Scenes from Standard Rendering Pipeline to HDRP & URP
Quote from terraunity on October 11, 2021, 4:08 pm
***Ver. 2.51.1 and up users, click on me!***
***If your login is not detected, please refresh the page!***
We have been working on a solution to convert your scenes created in Unity's Standard pipeline into any SRP (HDRP/URP) projects.
As always, we have automatization in mind and came up with a converter which exports your scene as a unitypackage file to be imported into any HDRP or URP projects with the help of Unity's Material Upgrade system.
Login & download the zip file attached in this post to get the converter.
โผ Click Below for Video Tutorial โผ
https://youtu.be/QVSq1Rehwdw
- Find the script (ExportSceneToSRP.cs) and place it under "Assets\TerraWorld\Core\Common\Scripts\Editor"
in your current project. An option will be added to Unity menus under "Tools/TerraUnity/Export Scene To SRP"
so that you can run the converter from there after you have a world created with TerraWorld in your scene.
By doing this, TerraWorld will create a unitypackage file in project root named "SRP Scene.unitypackage" which can be imported into your HDRP/URP projects.
- When finished importing, find the script โMassiveGrass.csโ in the attached zip file and replace it with the one already in the project. The updated script handles proper rendering of grass layers in scenes while in HDRP or URP projects.
Please note that the above steps is only applicable to TerraWorld ver. 2.30.3 as the next version will already have the converter and updated scripts included.
You can now load the scene you have created in the original project but you will find the scene empty-ish with pink materials.
So there is only one step to reveal and render the scene in target pipeline which is Unity's own "Material Upgrade" process.
- To update materials from built-in to HDRP, read here: https://docs.unity3d.com/Packages/[email protected]/manual/Upgrading-To-HDRP.html
- To update materials from built-in to URP, read here: https://docs.unity3d.com/Packages/[email protected]/manual/upgrading-your-shaders.html
The Unity's material upgrade process will convert materials to the suitable ones in the current pipeline and renders them properly.
Please note that you may lose some custom features (terrain's anti-tiling or color correction, vegetation's wind, snow...) which were already available in TerraWorld Standard pipeline scenes since all materials are now converted to Unity's built-in ones without these features. Go ahead and read the following if you need to get started for better rendering on world elements using built-in Lit shaders or other stock or 3rd party shaders.
You can go ahead and tweak each material settings or completely change them to any shaders you wish. Below are a few examples to cover some potential artifacts or giving each material a better look:
- For grass layers you need to tweak some material parameters to turn on double sided rendering since we need to render both front and back faces of grass blades. In HDRP/Lit materials, make sure "Double-Sided" is enabled and its "Normal Mode" is set to "None" or "Mirror", in URP/Lit materials set "Render Face" to "Both".
- For clouds in HDRP, you need to disable "Transparent Depth Prepass" in HDRP/Lit materials to render properly.
- For water surfaces and proper water rendering, change its material to anything other than built-in Lit shaders of your own or 3rd party shaders to render water based on your scene style.
- Use any custom or 3rd party terrain materials on your terrain objects for better surface rendering.
Regarding visual effects and post processing, both HDRP & URP have their own solutions to bring up a beautiful scene on par with TW's Standard version which was already available in the VFX tab.
In HDRP, if you directly load the scene from the converter, you need to add "Sky and Fog Volume" from the menu: GameObject/Volume. After this it may be possible that your scene is darkened, so you only need to select the Directional Light in scene hierarchy and the scene lighting will be initialized properly.
And as the final note, even when you import created scene through this converter into any SRP projects, all TerraWorld's world editing tools are available and you can use them to tweak layers via scene hierarchy and layers' inspector as shown in this video:
Hope you enjoy building games in your HDRP or URP projects using TerraWorld's scene builder and editing tools.
***Ver. 2.51.1 and up users, click on me!***
***If your login is not detected, please refresh the page!***
We have been working on a solution to convert your scenes created in Unity's Standard pipeline into any SRP (HDRP/URP) projects.
As always, we have automatization in mind and came up with a converter which exports your scene as a unitypackage file to be imported into any HDRP or URP projects with the help of Unity's Material Upgrade system.
Login & download the zip file attached in this post to get the converter.
โผ Click Below for Video Tutorial โผ
- Find the script (ExportSceneToSRP.cs) and place it under "Assets\TerraWorld\Core\Common\Scripts\Editor"
in your current project. An option will be added to Unity menus under "Tools/TerraUnity/Export Scene To SRP"
so that you can run the converter from there after you have a world created with TerraWorld in your scene.
By doing this, TerraWorld will create a unitypackage file in project root named "SRP Scene.unitypackage" which can be imported into your HDRP/URP projects.
- When finished importing, find the script โMassiveGrass.csโ in the attached zip file and replace it with the one already in the project. The updated script handles proper rendering of grass layers in scenes while in HDRP or URP projects.
Please note that the above steps is only applicable to TerraWorld ver. 2.30.3 as the next version will already have the converter and updated scripts included.
You can now load the scene you have created in the original project but you will find the scene empty-ish with pink materials.
So there is only one step to reveal and render the scene in target pipeline which is Unity's own "Material Upgrade" process.
- To update materials from built-in to HDRP, read here: https://docs.unity3d.com/Packages/[email protected]/manual/Upgrading-To-HDRP.html
- To update materials from built-in to URP, read here: https://docs.unity3d.com/Packages/[email protected]/manual/upgrading-your-shaders.html
The Unity's material upgrade process will convert materials to the suitable ones in the current pipeline and renders them properly.
Please note that you may lose some custom features (terrain's anti-tiling or color correction, vegetation's wind, snow...) which were already available in TerraWorld Standard pipeline scenes since all materials are now converted to Unity's built-in ones without these features. Go ahead and read the following if you need to get started for better rendering on world elements using built-in Lit shaders or other stock or 3rd party shaders.
You can go ahead and tweak each material settings or completely change them to any shaders you wish. Below are a few examples to cover some potential artifacts or giving each material a better look:
- For grass layers you need to tweak some material parameters to turn on double sided rendering since we need to render both front and back faces of grass blades. In HDRP/Lit materials, make sure "Double-Sided" is enabled and its "Normal Mode" is set to "None" or "Mirror", in URP/Lit materials set "Render Face" to "Both".
- For clouds in HDRP, you need to disable "Transparent Depth Prepass" in HDRP/Lit materials to render properly.
- For water surfaces and proper water rendering, change its material to anything other than built-in Lit shaders of your own or 3rd party shaders to render water based on your scene style.
- Use any custom or 3rd party terrain materials on your terrain objects for better surface rendering.
Regarding visual effects and post processing, both HDRP & URP have their own solutions to bring up a beautiful scene on par with TW's Standard version which was already available in the VFX tab.
In HDRP, if you directly load the scene from the converter, you need to add "Sky and Fog Volume" from the menu: GameObject/Volume. After this it may be possible that your scene is darkened, so you only need to select the Directional Light in scene hierarchy and the scene lighting will be initialized properly.
And as the final note, even when you import created scene through this converter into any SRP projects, all TerraWorld's world editing tools are available and you can use them to tweak layers via scene hierarchy and layers' inspector as shown in this video:
Hope you enjoy building games in your HDRP or URP projects using TerraWorld's scene builder and editing tools.
Uploaded files:
Quote from terraunity on October 17, 2021, 1:49 pmMy pleasure, would love to see your creations with this ๐
My pleasure, would love to see your creations with this ๐
Quote from [email protected] on December 13, 2021, 9:50 amHi Amir
As I'm login, I cannot see the download link yet
Even after refreshing or reloading completely I still get this
***If your login is not detected, please refresh the page!***Can you please send the direct link here?
Hi Amir
As I'm login, I cannot see the download link yet
Even after refreshing or reloading completely I still get this
***If your login is not detected, please refresh the page!***
Can you please send the direct link here?
Quote from terraunity on December 13, 2021, 10:01 amSorry for the inconvenience caused by our forums login bug; ***If your login is not detected, please refresh the page!***ย is always there no matter if you are logged in or not.
So if you want to download the file, make sure you are logged in, refresh the page and find the file as attachment at the end of the first post where you see Uploaded files:
Do you see the link to the zip file?
Sorry for the inconvenience caused by our forums login bug; ***If your login is not detected, please refresh the page!***ย is always there no matter if you are logged in or not.
So if you want to download the file, make sure you are logged in, refresh the page and find the file as attachment at the end of the first post where you see Uploaded files:
Do you see the link to the zip file?
Quote from terraunity on November 23, 2022, 8:03 amUpdated the scripts in the attached zip in the original post to be synced with latest TerraWorld changes.
Updated the scripts in the attached zip in the original post to be synced with latest TerraWorld changes.
Quote from terraunity on December 12, 2022, 10:24 amUPDATE:
Using the built-in scripts in TerraWorld 2.51.1 in Unity 2021.3.8 (this version works the best for now until Unity addresses instanced shader errors as reported here: https://discord.com/channels/450550727924908044/596275512129749003/1044580333284249661)
Setup Instructions:
- So there is no need to update any scripts from our forums since they already come with TerraWorld ver. 2.51.1, but you only need to open up the script "ExportSceneToSRP.cs" in your IDE and uncomment the line: [MenuItem("Tools/TerraUnity/Export Scene To SRP (Experimental)", false, 20)] so that the converter will be revealed and being accessed from the menus Tools/TerraUnity/Export Scene To SRP (Experimental)
- After selecting the menu "TerraUnity/Export Scene To SRP (Experimental)" TW's scene converter will automatically generate a unitypackage out of your current scene including all dependencies put in your project's root directory next to the Assets folder. This package can be imported into any SRP (HDRP/URP) projects and you only need to run Unity's material conversion process to convert scene materials into the proper ones based on template.
- Since auto installer will not run in SRP projects, one more manual step is needed. Open up Project Settings window and go to the Player section, under "Scripting Define Symbols" add "TW_HDRP" if you are in HDRP or add "TW_URP" if you are in URP project and hit Apply button so that some functionalities will be unlocked such as grass being rendered also in game mode.
- If materials are not the same as in original's project in BIRP, then simply select that material and change its settings since sometimes Unity fails to retrieve original settings while converting materials (e.g. in URP, I had to select grass materials and change their "Render Face" to "Both" & activate "Alpha Clipping" to make them cutout as shown)
UPDATE:
Using the built-in scripts in TerraWorld 2.51.1 in Unity 2021.3.8 (this version works the best for now until Unity addresses instanced shader errors as reported here: https://discord.com/channels/450550727924908044/596275512129749003/1044580333284249661)
Setup Instructions:
- So there is no need to update any scripts from our forums since they already come with TerraWorld ver. 2.51.1, but you only need to open up the script "ExportSceneToSRP.cs" in your IDE and uncomment the line: [MenuItem("Tools/TerraUnity/Export Scene To SRP (Experimental)", false, 20)] so that the converter will be revealed and being accessed from the menus Tools/TerraUnity/Export Scene To SRP (Experimental)
- After selecting the menu "TerraUnity/Export Scene To SRP (Experimental)" TW's scene converter will automatically generate a unitypackage out of your current scene including all dependencies put in your project's root directory next to the Assets folder. This package can be imported into any SRP (HDRP/URP) projects and you only need to run Unity's material conversion process to convert scene materials into the proper ones based on template.
- Since auto installer will not run in SRP projects, one more manual step is needed. Open up Project Settings window and go to the Player section, under "Scripting Define Symbols" add "TW_HDRP" if you are in HDRP or add "TW_URP" if you are in URP project and hit Apply button so that some functionalities will be unlocked such as grass being rendered also in game mode.
- If materials are not the same as in original's project in BIRP, then simply select that material and change its settings since sometimes Unity fails to retrieve original settings while converting materials (e.g. in URP, I had to select grass materials and change their "Render Face" to "Both" & activate "Alpha Clipping" to make them cutout as shown)