diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-14 23:00:42 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-14 23:00:42 -0800 |
| commit | d1eb208ecbeba1ab7bf894d9f14d2652739bc63e (patch) | |
| tree | f80778fef335ea69fb1cb8892e908a56be0fef1b /Scripts | |
| parent | f0d753b1cfa07079886abe0c3c5fc7ee75b426fd (diff) | |
Impostors: integrate into 3ner
Diffstat (limited to 'Scripts')
| -rw-r--r-- | Scripts/Impostors.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Scripts/Impostors.cs b/Scripts/Impostors.cs index e8513eb..b82dc8f 100644 --- a/Scripts/Impostors.cs +++ b/Scripts/Impostors.cs @@ -312,10 +312,10 @@ public class Impostors : MonoBehaviour var exportSettings = new (Texture2D atlas, TextureExportSettings settings, string materialProp)[] { - (albedoAtlas, new TextureExportSettings("albedo", mipmaps: true, sRGB: true, alphaTransparency: true), "_ImpostorAtlas"), - (normalAtlas, new TextureExportSettings("normal", mipmaps: true, sRGB: false), "_ImpostorNormalAtlas"), - (metallicGlossAtlas, new TextureExportSettings("metallic_gloss", mipmaps: true, sRGB: false), "_ImpostorMetallicGlossAtlas"), - (depthAtlas, new TextureExportSettings("depth", isEXR: true, mipmaps: false, sRGB: false, filter: FilterMode.Bilinear, uncompressed: true), "_ImpostorDepthAtlas") + (albedoAtlas, new TextureExportSettings("albedo", mipmaps: true, sRGB: true, alphaTransparency: true), "_Impostors_Atlas"), + (normalAtlas, new TextureExportSettings("normal", mipmaps: true, sRGB: false), "_Impostors_Normal_Atlas"), + (metallicGlossAtlas, new TextureExportSettings("metallic_gloss", mipmaps: true, sRGB: false), "_Impostors_Metallic_Gloss_Atlas"), + (depthAtlas, new TextureExportSettings("depth", isEXR: true, mipmaps: false, sRGB: false, filter: FilterMode.Bilinear, uncompressed: true), "_Impostors_Depth_Atlas") }; string[] paths = new string[exportSettings.Length]; @@ -336,14 +336,16 @@ public class Impostors : MonoBehaviour { DestroyExistingImpostor(); - Shader shader = Shader.Find("yum_food/Gimmicks/Impostors"); + Shader shader = Shader.Find("yum_food/3ner"); if (shader == null) { Debug.LogError("Shader not found"); return; } impostorMaterial = new Material(shader); for (int i = 0; i < textures.Length; i++) impostorMaterial.SetTexture(exportSettings[i].materialProp, textures[i]); - impostorMaterial.SetInt("_GridResolution", gridResolution); - impostorMaterial.SetFloat("_SphereRadius", sphere_radius_); + impostorMaterial.SetInt("_Impostors_Grid_Resolution", gridResolution); + impostorMaterial.SetFloat("_Impostors_Sphere_Radius", sphere_radius_); + impostorMaterial.SetFloat("_Impostors_Enabled", 1); + impostorMaterial.SetFloat("_Cull", (float)UnityEngine.Rendering.CullMode.Front); AssetDatabase.CreateAsset(impostorMaterial, Path.Combine(OutputFolder, $"{baseName}_mat.mat")); impostorObject = GameObject.CreatePrimitive(PrimitiveType.Quad); |
