public static Texture2D GenerateBillboardTexture(GameObject prefab, BillboardQuality billboardQuality,
                                                         int billboardLodIndex, VegetationShaderType vegetationShaderType, Quaternion rotationOffset,
                                                         Color backgroundColor)
        {
            Shader diffuseShader = BillboardShaderDetector.GetDiffuceBillboardAtlasShader(prefab);


            //if (vegetationShaderType == VegetationShaderType.Speedtree)
            //{

            //    diffuseShader = Shader.Find("AwesomeTechnologies/Billboards/RenderDiffuseAtlas");
            //}
            //else
            //{
            //    diffuseShader = Shader.Find("AwesomeTechnologies/Billboards/RenderDiffuseAtlasBright");
            //}

            Material  minPostfilter = (Material)Resources.Load("MinPostFilter/MinPostFilter", typeof(Material));
            Texture2D texture       = GenerateBillboardNew(prefab, GetBillboardQualityTileWidth(billboardQuality),
                                                           GetBillboardQualityTileWidth(billboardQuality), GetBillboardQualityColumnCount(billboardQuality),
                                                           GetBillboardQualityRowCount(billboardQuality), diffuseShader, backgroundColor, minPostfilter,
                                                           billboardLodIndex, rotationOffset);

            return(texture);
        }
Beispiel #2
0
        public static Texture2D GenerateBillboardTexture(GameObject prefab, BillboardQuality billboardQuality,
                                                         LODLevel billboardSourceLODLevel, VegetationShaderType vegetationShaderType, Quaternion rotationOffset,
                                                         Color backgroundColor, string overrideBillboardAtlasShader, bool recalculateNormals, float normalBlendFactor)
        {
            Shader diffuseShader = BillboardShaderDetector.GetDiffuceBillboardAtlasShader(prefab);

            if (overrideBillboardAtlasShader != "")
            {
                diffuseShader = Shader.Find(overrideBillboardAtlasShader);
            }

            //if (vegetationShaderType == VegetationShaderType.Speedtree)
            //{

            //    diffuseShader = Shader.Find("AwesomeTechnologies/Billboards/RenderDiffuseAtlas");
            //}
            //else
            //{
            //    diffuseShader = Shader.Find("AwesomeTechnologies/Billboards/RenderDiffuseAtlasBright");
            //}

            Material  minPostfilter = (Material)Resources.Load("MinPostFilter/MinPostFilter", typeof(Material));
            Texture2D texture       = GenerateBillboardNew(prefab, GetBillboardQualityTileWidth(billboardQuality),
                                                           GetBillboardQualityTileWidth(billboardQuality), GetBillboardQualityColumnCount(billboardQuality),
                                                           GetBillboardQualityRowCount(billboardQuality), diffuseShader, backgroundColor, minPostfilter,
                                                           billboardSourceLODLevel, rotationOffset, false, recalculateNormals, normalBlendFactor);

            return(texture);
        }